From 3dd4103d71f4f288738a210aa4c4ff94c0fb34cd Mon Sep 17 00:00:00 2001 From: Sol Huebner Date: Sun, 9 Jan 2022 05:20:14 -0500 Subject: [PATCH 1/2] VirtualMatrixPanel NO_GFX fix getCoords can not access width() and height() with NO_GFX and setRotate is a GFX function so it needs to be part of the #ifndef NO_GFX check --- ESP32-VirtualMatrixPanel-I2S-DMA.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ESP32-VirtualMatrixPanel-I2S-DMA.h b/ESP32-VirtualMatrixPanel-I2S-DMA.h index f4f1834..7eafdcc 100644 --- a/ESP32-VirtualMatrixPanel-I2S-DMA.h +++ b/ESP32-VirtualMatrixPanel-I2S-DMA.h @@ -133,7 +133,7 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t &x, int16_t &y) { //Serial.println("Called Base."); coords.x = coords.y = -1; // By defalt use an invalid co-ordinates that will be rejected by updateMatrixDMABuffer - if ( x < 0 || x >= width() || y < 0 || y >= height() ) { // Co-ordinates go from 0 to X-1 remember! width() and height() are out of range! + if ( x < 0 || x >= virtualResX || y < 0 || y >= virtualResY ) { // Co-ordinates go from 0 to X-1 remember! width() and height() are out of range! //Serial.printf("VirtualMatrixPanel::getCoords(): Invalid virtual display coordinate. x,y: %d, %d\r\n", x, y); return coords; } @@ -246,9 +246,11 @@ inline void VirtualMatrixPanel::drawPixelRGB888(int16_t x, int16_t y, uint8_t r, inline void VirtualMatrixPanel::setRotate(bool rotate) { _rotate=rotate; - + +#ifndef NO_GFX // We don't support rotation by degrees. if (rotate) { setRotation(1); } else { setRotation(0); } +#endif } inline void VirtualMatrixPanel::setPhysicalPanelScanRate(PANEL_SCAN_RATE rate) { From a42dcb458bcff3ed8667710690ad8c7ef30cc4b6 Mon Sep 17 00:00:00 2001 From: Sol Huebner Date: Sun, 9 Jan 2022 05:21:33 -0500 Subject: [PATCH 2/2] small explanation update --- ESP32-VirtualMatrixPanel-I2S-DMA.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ESP32-VirtualMatrixPanel-I2S-DMA.h b/ESP32-VirtualMatrixPanel-I2S-DMA.h index 7eafdcc..7228232 100644 --- a/ESP32-VirtualMatrixPanel-I2S-DMA.h +++ b/ESP32-VirtualMatrixPanel-I2S-DMA.h @@ -133,7 +133,7 @@ inline VirtualCoords VirtualMatrixPanel::getCoords(int16_t &x, int16_t &y) { //Serial.println("Called Base."); coords.x = coords.y = -1; // By defalt use an invalid co-ordinates that will be rejected by updateMatrixDMABuffer - if ( x < 0 || x >= virtualResX || y < 0 || y >= virtualResY ) { // Co-ordinates go from 0 to X-1 remember! width() and height() are out of range! + if ( x < 0 || x >= virtualResX || y < 0 || y >= virtualResY ) { // Co-ordinates go from 0 to X-1 remember! otherwise they are out of range! //Serial.printf("VirtualMatrixPanel::getCoords(): Invalid virtual display coordinate. x,y: %d, %d\r\n", x, y); return coords; }