Skip to content

Commit

Permalink
writeColor()
Browse files Browse the repository at this point in the history
  • Loading branch information
moononournation committed Jun 14, 2021
1 parent 8d7f2c7 commit 47c5dee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/Arduino_TFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Arduino_TFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions src/Arduino_TFT_18bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Arduino_TFT_18bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 47c5dee

Please sign in to comment.