From 692078352e51166194b916115dce9ba8a80d41fd Mon Sep 17 00:00:00 2001 From: Lukaswnd Date: Thu, 18 Jan 2024 12:24:18 +0100 Subject: [PATCH 1/2] Fix VirtualMatrixPanel with NO_GFX fix Compile error, 'rotate' in void VirtualMatrixPanel::setRotation is not defined, when using NO_GFX add int16_t width() and int16_t height(), when using NO_GFX Otherwise you cant get the dimensions of the virtual panel --- src/ESP32-VirtualMatrixPanel-I2S-DMA.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ESP32-VirtualMatrixPanel-I2S-DMA.h b/src/ESP32-VirtualMatrixPanel-I2S-DMA.h index 2738599..a6b9d15 100644 --- a/src/ESP32-VirtualMatrixPanel-I2S-DMA.h +++ b/src/ESP32-VirtualMatrixPanel-I2S-DMA.h @@ -124,6 +124,11 @@ public: void drawPixel(int16_t x, int16_t y, CRGB color); #endif +#ifdef NO_GFX + inline int16_t width() const { return _virtualResX; } + inline int16_t height() const { return _virtualResY; } +#endif + uint16_t color444(uint8_t r, uint8_t g, uint8_t b) { return display->color444(r, g, b); @@ -479,6 +484,9 @@ inline void VirtualMatrixPanel::setRotation(uint8_t rotate) // Change the _width and _height variables used by the underlying adafruit gfx library. // Actual pixel rotation / mapping is done in the getCoords function. +#ifdef NO_GFX + int8_t rotation; +#endif rotation = (rotate & 3); switch (rotation) { case 0: // nothing From 75e9478e7f98c063e98c1ce97b1011eee3afa840 Mon Sep 17 00:00:00 2001 From: Lukaswnd Date: Thu, 18 Jan 2024 12:33:38 +0100 Subject: [PATCH 2/2] Add width() and height() for NO_GFX add int16_t width() and int16_t height(), when NO_GFX is enabled. you also could get the dimesions the following way height = matrix.getCfg().mx_height; width = matrix.getCfg().mx_width * matrix.getCfg().chain_length; but I think the new funktions are simpler --- src/ESP32-HUB75-MatrixPanel-I2S-DMA.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h index 6fcca10..c5df926 100644 --- a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h +++ b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h @@ -571,6 +571,11 @@ public: void drawPixel(int16_t x, int16_t y, CRGB color); #endif +#ifdef NO_GFX + inline int16_t width() const { return m_cfg.mx_width * m_cfg.chain_length; } + inline int16_t height() const { return m_cfg.mx_height; } +#endif + void drawIcon(int *ico, int16_t x, int16_t y, int16_t cols, int16_t rows); // Colour 444 is a 4 bit scale, so 0 to 15, colour 565 takes a 0-255 bit value, so scale up by 255/15 (i.e. 17)!