aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormrcodetastic <12006953+mrcodetastic@users.noreply.github.com>2024-07-22 13:47:02 +0100
committermrcodetastic <12006953+mrcodetastic@users.noreply.github.com>2024-07-22 13:47:02 +0100
commitfdc9019d99be3edae64447347afaa4f9ad628fe6 (patch)
treef4a78923192c499ac513fca4c65b269e7faa5837 /src
parent628ffa8c3345c83ece651b35544ca5a3d2eab2b1 (diff)
Enhance GFX_LITE support
Diffstat (limited to 'src')
-rw-r--r--src/ESP32-HUB75-MatrixPanel-I2S-DMA.h19
-rw-r--r--src/ESP32-VirtualMatrixPanel-I2S-DMA.h18
2 files changed, 22 insertions, 15 deletions
diff --git a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h
index 939c421..6067e7f 100644
--- a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h
+++ b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h
@@ -12,11 +12,11 @@
// #include <Arduino.h>
#include "platforms/platform_detect.hpp"
-#ifdef USE_GFX_ROOT
-#include <FastLED.h>
-#include "GFX.h" // Adafruit GFX core class -> https://github.com/mrfaptastic/GFX_Root
+#ifdef USE_GFX_LITE
+ // Slimmed version of Adafruit GFX + FastLED: https://github.com/mrcodetastc/GFX_Lite
+ #include "GFX_Lite.h"
#elif !defined NO_GFX
-#include "Adafruit_GFX.h" // Adafruit class with all the other stuff
+ #include "Adafruit_GFX.h" // Adafruit class with all the other stuff
#endif
/*******************************************************************************************
@@ -366,7 +366,8 @@ private:
}; // end of structure HUB75_I2S_CFG
/***************************************************************************************/
-#ifdef USE_GFX_ROOT
+#ifdef USE_GFX_LITE
+// Slimmed version of Adafruit GFX + FastLED: https://github.com/mrcodetastic/GFX_Lite
class MatrixPanel_I2S_DMA : public GFX
{
#elif !defined NO_GFX
@@ -386,7 +387,7 @@ public:
*
*/
MatrixPanel_I2S_DMA()
-#ifdef USE_GFX_ROOT
+#ifdef USE_GFX_LITE
: GFX(MATRIX_WIDTH, MATRIX_HEIGHT)
#elif !defined NO_GFX
: Adafruit_GFX(MATRIX_WIDTH, MATRIX_HEIGHT)
@@ -401,7 +402,7 @@ public:
*
*/
MatrixPanel_I2S_DMA(const HUB75_I2S_CFG &opts)
-#ifdef USE_GFX_ROOT
+#ifdef USE_GFX_LITE
: GFX(opts.mx_width * opts.chain_length, opts.mx_height)
#elif !defined NO_GFX
: Adafruit_GFX(opts.mx_width * opts.chain_length, opts.mx_height)
@@ -572,7 +573,7 @@ public:
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 USE_GFX_ROOT
+#ifdef USE_GFX_LITE
// 24bpp FASTLED CRGB colour struct support
void fillScreen(CRGB color);
void drawPixel(int16_t x, int16_t y, CRGB color);
@@ -930,7 +931,7 @@ inline void MatrixPanel_I2S_DMA::fillScreenRGB888(uint8_t r, uint8_t g, uint8_t
updateMatrixDMABuffer(r, g, b); // RGB only (no pixel coordinate) version of 'updateMatrixDMABuffer'
}
-#ifdef USE_GFX_ROOT
+#ifdef USE_GFX_LITE
// Support for CRGB values provided via FastLED
inline void MatrixPanel_I2S_DMA::drawPixel(int16_t x, int16_t y, CRGB color)
{
diff --git a/src/ESP32-VirtualMatrixPanel-I2S-DMA.h b/src/ESP32-VirtualMatrixPanel-I2S-DMA.h
index cf92a87..50706a4 100644
--- a/src/ESP32-VirtualMatrixPanel-I2S-DMA.h
+++ b/src/ESP32-VirtualMatrixPanel-I2S-DMA.h
@@ -26,10 +26,16 @@
*******************************************************************/
#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
-#ifndef NO_GFX
-#include <Fonts/FreeSansBold12pt7b.h>
+#ifdef USE_GFX_LITE
+// Slimmed version of Adafruit GFX + FastLED: https://github.com/mrcodetastic/GFX_Lite
+ #include "GFX_Lite.h"
+ #include <Fonts/FreeSansBold12pt7b.h>
+#elif !defined NO_GFX
+ #include "Adafruit_GFX.h" // Adafruit class with all the other stuff
+ #include <Fonts/FreeSansBold12pt7b.h>
#endif
+
// #include <iostream>
struct VirtualCoords
@@ -67,7 +73,7 @@ enum PANEL_CHAIN_TYPE
CHAIN_BOTTOM_LEFT_UP_ZZ
};
-#ifdef USE_GFX_ROOT
+#ifdef USE_GFX_LITE
class VirtualMatrixPanel : public GFX
#elif !defined NO_GFX
class VirtualMatrixPanel : public Adafruit_GFX
@@ -78,7 +84,7 @@ class VirtualMatrixPanel
public:
VirtualMatrixPanel(MatrixPanel_I2S_DMA &disp, int _vmodule_rows, int _vmodule_cols, int _panelResX, int _panelResY, PANEL_CHAIN_TYPE _panel_chain_type = CHAIN_NONE)
-#ifdef USE_GFX_ROOT
+#ifdef USE_GFX_LITE
: GFX(_vmodule_cols * _panelResX, _vmodule_rows * _panelResY)
#elif !defined NO_GFX
: Adafruit_GFX(_vmodule_cols * _panelResX, _vmodule_rows * _panelResY)
@@ -121,7 +127,7 @@ public:
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
+#ifdef USE_GFX_LITE
// 24bpp FASTLED CRGB colour struct support
void fillScreen(CRGB color);
void drawPixel(int16_t x, int16_t y, CRGB color);
@@ -459,7 +465,7 @@ 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
+#ifdef USE_GFX_LITE
// Support for CRGB values provided via FastLED
inline void VirtualMatrixPanel::drawPixel(int16_t x, int16_t y, CRGB color)
{