From fd7629e52c4c6863922d1a974b776d381da966b5 Mon Sep 17 00:00:00 2001 From: mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> Date: Mon, 16 Aug 2021 13:29:44 +0100 Subject: [PATCH] Update --- ESP32-HUB75-MatrixPanel-I2S-DMA.cpp | 2 +- ESP32-HUB75-MatrixPanel-I2S-DMA.h | 2 ++ examples/1_SimpleTestShapes/1_SimpleTestShapes.ino | 3 --- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp index 8805795..e32fb26 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.cpp @@ -754,7 +754,7 @@ void MatrixPanel_I2S_DMA::brtCtrlOE(int brt, const bool _buff_id){ /* * overload for compatibility */ -bool MatrixPanel_I2S_DMA::begin(int r1, int g1, int b1, int r2, int g2, int b2, int a, int b, int c, int d, int e, int lat, int oe, int clk){ +bool MatrixPanel_I2S_DMA::begin(int r1, int g1, int b1, int r2, int g2, int b2, int a, int b, int c, int d, int e, int lat, int oe, int clk) { // RGB m_cfg.gpio.r1 = r1; m_cfg.gpio.g1 = g1; m_cfg.gpio.b1 = b1; diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/ESP32-HUB75-MatrixPanel-I2S-DMA.h index 6a4bf02..113bffe 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.h +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.h @@ -350,6 +350,8 @@ class MatrixPanel_I2S_DMA { /* Propagate the DMA pin configuration, allocate DMA buffs and start data ouput, initialy blank */ bool begin(){ + + if (initialized) return; // we don't do this twice or more! // Change 'if' to '1' to enable, 0 to not include this Serial output in compiled program #if SERIAL_DEBUG diff --git a/examples/1_SimpleTestShapes/1_SimpleTestShapes.ino b/examples/1_SimpleTestShapes/1_SimpleTestShapes.ino index da454ef..cfcd768 100644 --- a/examples/1_SimpleTestShapes/1_SimpleTestShapes.ino +++ b/examples/1_SimpleTestShapes/1_SimpleTestShapes.ino @@ -111,9 +111,6 @@ void setup() { dma_display->clearScreen(); dma_display->fillScreen(myWHITE); -// - dma_display->begin(); // use default pins - // fix the screen with green dma_display->fillRect(0, 0, dma_display->width(), dma_display->height(), dma_display->color444(0, 15, 0)); delay(500);