/* Optimised routine to draw a horizontal line faster than setting individual pixels.  */
void lcdDrawHLine(uint16_t x0, uint16_t x1, uint16_t y, uint16_t color)
/* Optimised routine to draw a horizontal line faster than setting individual pixels.  */
void lcdDrawHLine(uint16_t x0, uint16_t x1, uint16_t y, uint16_t color)
{
  uint16_t x, pixels;
  if (x1 < x0)
  {
    x = x1;
    x1 = x0;
    x0 = x;
  }
  if (x1 >= ssd1351Properties.width)
  {
    x1 = ssd1351Properties.width - 1;
  }
  if (x0 >= ssd1351Properties.width)
  {
    x0 = ssd1351Properties.width - 1;
  }
  ssd1351SetCursor(x0, y);
  CMD(SSD1351_CMD_WRITERAM);
  for (pixels = 0; pixels < x1 - x0 + 1; pixels++)
  {
    DATA(color >> 8);
    DATA(color);
  }
  ssd1351GoHome();
}