aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrfaptastic <12006953+mrfaptastic@users.noreply.github.com>2021-03-31 18:29:03 +0100
committermrfaptastic <12006953+mrfaptastic@users.noreply.github.com>2021-03-31 18:29:03 +0100
commit4af72ab98dfe4801520e9a2eca4ff3931ff51851 (patch)
treef588c9dfcc83427aa2d5b8a69aebf220f049c306
parent5062df590ef517c2ed64f3d80591037ca5b2bb73 (diff)
Update VirtualMatrixPanel class
-rw-r--r--ESP32-HUB75-MatrixPanel-I2S-DMA.h25
-rw-r--r--ESP32-VirtualMatrixPanel-I2S-DMA.h12
2 files changed, 15 insertions, 22 deletions
diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/ESP32-HUB75-MatrixPanel-I2S-DMA.h
index 846cc76..9df1390 100644
--- a/ESP32-HUB75-MatrixPanel-I2S-DMA.h
+++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.h
@@ -14,19 +14,10 @@
*/
//#define NO_FAST_FUNCTIONS
-
-/*
- * Enable the use of FastLED CRGB values directly to drawPixel.
- * i.e. drawPixel(x, y, CRGB color)
- */
-//#define FASTLED_CRGB_SUPPORT 1
-
-
/* Use GFX_Root (https://github.com/mrfaptastic/GFX_Root) instead of Adafruit_GFX library.
* > Removes Bus_IO & Wire.h library dependencies.
- * > Provides 24bpp (CRGB) color support for Adafruit_GFX functions like drawCircle etc.
- * > Use this compile-time directive with FASTLED_CRGB_SUPPORT if 24bpp graphics
- * functions are needed.
+ * > Provides 24bpp (CRGB) colour support for Adafruit_GFX functions like drawCircle etc.
+ * > Requires FastLED.h
*/
//#define USE_GFX_ROOT 1
@@ -102,14 +93,12 @@
#include "esp32_i2s_parallel_v2.h"
#ifdef USE_GFX_ROOT
- #include "GFX.h" // Adafruit GFX core class -> https://github.com/mrfaptastic/GFX_Root
+ #include <FastLED.h>
+ #include "GFX.h" // Adafruit GFX core class -> https://github.com/mrfaptastic/GFX_Root
#elif !defined NO_GFX
#include "Adafruit_GFX.h" // Adafruit class with all the other stuff
#endif
-#ifdef FASTLED_CRGB_SUPPORT
- #include <FastLED.h>
-#endif
/***************************************************************************************/
@@ -455,10 +444,10 @@ class MatrixPanel_I2S_DMA {
void fillScreenRGB888(uint8_t r, uint8_t g, uint8_t b);
void drawPixelRGB888(int16_t x, int16_t y, uint8_t r, uint8_t g, uint8_t b);
-#ifdef FASTLED_CRGB_SUPPORT
+#ifdef USE_GFX_ROOT
// 24bpp FASTLED CRGB colour struct support
- void drawPixel(int16_t x, int16_t y, CRGB color);
void fillScreen(CRGB color);
+ void drawPixel(int16_t x, int16_t y, CRGB color);
#endif
void drawIcon (int *ico, int16_t x, int16_t y, int16_t cols, int16_t rows);
@@ -720,7 +709,7 @@ inline void MatrixPanel_I2S_DMA::fillScreenRGB888(uint8_t r, uint8_t g,uint8_t b
updateMatrixDMABuffer(r, g, b); // RGB only (no pixel coordinate) version of 'updateMatrixDMABuffer'
}
-#ifdef FASTLED_CRGB_SUPPORT
+#ifdef USE_GFX_ROOT
// Support for CRGB values provided via FastLED
inline void MatrixPanel_I2S_DMA::drawPixel(int16_t x, int16_t y, CRGB color)
{
diff --git a/ESP32-VirtualMatrixPanel-I2S-DMA.h b/ESP32-VirtualMatrixPanel-I2S-DMA.h
index 151ebb0..cfda81f 100644
--- a/ESP32-VirtualMatrixPanel-I2S-DMA.h
+++ b/ESP32-VirtualMatrixPanel-I2S-DMA.h
@@ -72,9 +72,9 @@ class VirtualMatrixPanel
void clearScreen() {
fillScreen(0);
}
- void drawPixelRGB565(int16_t x, int16_t y, uint16_t color);
+ //void drawPixelRGB565(int16_t x, int16_t y, uint16_t color);
void drawPixelRGB888(int16_t x, int16_t y, uint8_t r, uint8_t g, uint8_t b);
- void drawPixelRGB24(int16_t x, int16_t y, RGB24 color);
+ //void drawPixelRGB24(int16_t x, int16_t y, RGB24 color);
void drawIcon (int *ico, int16_t x, int16_t y, int16_t module_cols, int16_t module_rows);
uint16_t color444(uint8_t r, uint8_t g, uint8_t b) {
@@ -155,12 +155,13 @@ inline void VirtualMatrixPanel::fillScreen(uint16_t color) // adafruit virtual
// No need to map this.
this->display->fillScreen(color);
}
-
+/*
inline void VirtualMatrixPanel::drawPixelRGB565(int16_t x, int16_t y, uint16_t color)
{
VirtualCoords coords = getCoords(x, y);
this->display->drawPixelRGB565( coords.x, coords.y, color);
}
+*/
inline void VirtualMatrixPanel::drawPixelRGB888(int16_t x, int16_t y, uint8_t r, uint8_t g, uint8_t b)
@@ -169,11 +170,13 @@ inline void VirtualMatrixPanel::drawPixelRGB888(int16_t x, int16_t y, uint8_t r,
this->display->drawPixelRGB888( coords.x, coords.y, r, g, b);
}
+/*
inline void VirtualMatrixPanel::drawPixelRGB24(int16_t x, int16_t y, RGB24 color)
{
VirtualCoords coords = getCoords(x, y);
this->display->drawPixelRGB24(coords.x, coords.y, color);
}
+*/
#ifndef NO_GFX
inline void VirtualMatrixPanel::drawDisplayTest()
@@ -199,7 +202,8 @@ inline void VirtualMatrixPanel::drawIcon (int *ico, int16_t x, int16_t y, int16_
for (j = 0; j < module_cols; j++) {
// This is a call to this libraries version of drawPixel
// which will map each pixel, which is what we want.
- drawPixelRGB565 (x + j, y + i, ico[i * module_cols + j]);
+ //drawPixelRGB565 (x + j, y + i, ico[i * module_cols + j]);
+ drawPixel (x + j, y + i, ico[i * module_cols + j]);
}
}
}