diff --git a/src/Arduino_TFT.cpp b/src/Arduino_TFT.cpp index d6627a65..1bd67ff1 100644 --- a/src/Arduino_TFT.cpp +++ b/src/Arduino_TFT.cpp @@ -225,14 +225,14 @@ void Arduino_TFT::setRotation(uint8_t r) _currentH = 0xFFFF; } -// TFT optimization code, too big for ATMEL family -#if !defined(LITTLE_FOOT_PRINT) - void Arduino_TFT::writeColor(uint16_t color) { _bus->write16(color); } +// TFT optimization code, too big for ATMEL family +#if !defined(LITTLE_FOOT_PRINT) + void Arduino_TFT::writeBytes(uint8_t *data, uint32_t len) { _bus->writeBytes(data, len); diff --git a/src/Arduino_TFT.h b/src/Arduino_TFT.h index 30281cc5..e93b8dd1 100644 --- a/src/Arduino_TFT.h +++ b/src/Arduino_TFT.h @@ -34,10 +34,10 @@ class Arduino_TFT : public Arduino_GFX virtual void writeRepeat(uint16_t color, uint32_t len); void setAddrWindow(int16_t x, int16_t y, uint16_t w, uint16_t h); + virtual void writeColor(uint16_t color); // TFT optimization code, too big for ATMEL family #if !defined(LITTLE_FOOT_PRINT) - virtual void writeColor(uint16_t color); virtual void writePixels(uint16_t *data, uint32_t size); virtual void writeIndexedPixels(uint8_t *bitmap, uint16_t *color_index, uint32_t len); virtual void writeIndexedPixelsDouble(uint8_t *bitmap, uint16_t *color_index, uint32_t len); diff --git a/src/Arduino_TFT_18bit.cpp b/src/Arduino_TFT_18bit.cpp index 93844968..6cb48f3d 100644 --- a/src/Arduino_TFT_18bit.cpp +++ b/src/Arduino_TFT_18bit.cpp @@ -14,6 +14,13 @@ Arduino_TFT_18bit::Arduino_TFT_18bit( { } +void Arduino_TFT_18bit::writeColor(uint16_t color) +{ + _bus->write((color & 0xF800) >> 8); + _bus->write((color & 0x07E0) >> 3); + _bus->write(color << 3); +} + void Arduino_TFT_18bit::writePixelPreclipped(int16_t x, int16_t y, uint16_t color) { writeAddrWindow(x, y, 1, 1); @@ -43,13 +50,6 @@ void Arduino_TFT_18bit::writeRepeat(uint16_t color, uint32_t len) // TFT optimization code, too big for ATMEL family #if !defined(LITTLE_FOOT_PRINT) -void Arduino_TFT_18bit::writeColor(uint16_t color) -{ - _bus->write((color & 0xF800) >> 8); - _bus->write((color & 0x07E0) >> 3); - _bus->write(color << 3); -} - void Arduino_TFT_18bit::writePixels(uint16_t *data, uint32_t len) { uint16_t d; diff --git a/src/Arduino_TFT_18bit.h b/src/Arduino_TFT_18bit.h index 8b4515ef..0e946117 100644 --- a/src/Arduino_TFT_18bit.h +++ b/src/Arduino_TFT_18bit.h @@ -14,12 +14,12 @@ class Arduino_TFT_18bit : public Arduino_TFT public: Arduino_TFT_18bit(Arduino_DataBus *bus, int8_t rst, uint8_t r, bool ips, int16_t w, int16_t h, uint8_t col_offset1, uint8_t row_offset1, uint8_t col_offset2, uint8_t row_offset2); + void writeColor(uint16_t color) override; void writePixelPreclipped(int16_t x, int16_t y, uint16_t color) override; void writeRepeat(uint16_t color, uint32_t len) override; // TFT optimization code, too big for ATMEL family #if !defined(LITTLE_FOOT_PRINT) - void writeColor(uint16_t color) override; void writePixels(uint16_t *data, uint32_t len) override; void writeIndexedPixels(uint8_t *bitmap, uint16_t *color_index, uint32_t len) override; void writeIndexedPixelsDouble(uint8_t *bitmap, uint16_t *color_index, uint32_t len) override;