diff options
| author | lols <me_hotemail@hotmail.com> | 2022-07-23 18:16:05 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-23 18:16:05 +0800 |
| commit | b6aabeff933a14b9d0eeadddd5e92189a822319c (patch) | |
| tree | a06e91d1efe185957b8dab967a1a7b185d95efe6 | |
| parent | 38eaea75960d38c7216bc926e6215a37b635c2e8 (diff) | |
fix use GFX_ROOT compile error
for VirtualMatrixPanel
issue#304
| -rw-r--r-- | ESP32-VirtualMatrixPanel-I2S-DMA.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ESP32-VirtualMatrixPanel-I2S-DMA.h b/ESP32-VirtualMatrixPanel-I2S-DMA.h index b2c36d0..e439159 100644 --- a/ESP32-VirtualMatrixPanel-I2S-DMA.h +++ b/ESP32-VirtualMatrixPanel-I2S-DMA.h @@ -101,7 +101,11 @@ class VirtualMatrixPanel virtual void fillScreenRGB888(uint8_t r, uint8_t g,uint8_t b); void clearScreen() { display->clearScreen(); } void drawPixelRGB888(int16_t x, int16_t y, uint8_t r, uint8_t g, uint8_t b); - +#ifdef USE_GFX_ROOT + // 24bpp FASTLED CRGB colour struct support + void fillScreen(CRGB color); + void drawPixel(int16_t x, int16_t y, CRGB color); +#endif uint16_t color444(uint8_t r, uint8_t g, uint8_t b) { return display->color444(r, g, b); } uint16_t color565(uint8_t r, uint8_t g, uint8_t b) { return display->color565(r, g, b); } uint16_t color333(uint8_t r, uint8_t g, uint8_t b) { return display->color333(r, g, b); } @@ -266,6 +270,20 @@ inline void VirtualMatrixPanel::drawPixelRGB888(int16_t x, int16_t y, uint8_t r, this->display->drawPixelRGB888( coords.x, coords.y, r, g, b); } +#ifdef USE_GFX_ROOT +// Support for CRGB values provided via FastLED +inline void VirtualMatrixPanel::drawPixel(int16_t x, int16_t y, CRGB color) +{ + getCoords(x, y); + this->display->drawPixel(coords.x, coords.y, color); +} + +inline void VirtualMatrixPanel::fillScreen(CRGB color) +{ + this->display->fillScreen(color); +} +#endif + inline void VirtualMatrixPanel::setRotate(bool rotate) { _rotate=rotate; |
