aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrfaptastic <12006953+mrfaptastic@users.noreply.github.com>2021-08-19 19:34:40 +0100
committermrfaptastic <12006953+mrfaptastic@users.noreply.github.com>2021-08-19 19:34:40 +0100
commit055ff08fe51da232c28d0fffeda6a4808eb141c1 (patch)
tree6e1e4defcba3811b7882c42941a309a0600e2d92
parentd9e2f85f98cd794c8288d0cd76697fb49ec7c666 (diff)
Double buffer function reduction
Can't get rid of the wait while statement though...
-rw-r--r--ESP32-HUB75-MatrixPanel-I2S-DMA.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/ESP32-HUB75-MatrixPanel-I2S-DMA.h
index f8648a1..93b5227 100644
--- a/ESP32-HUB75-MatrixPanel-I2S-DMA.h
+++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.h
@@ -388,7 +388,7 @@ class MatrixPanel_I2S_DMA {
// Setup the ESP32 DMA Engine. Sprite_TM built this stuff.
configureDMA(m_cfg); //DMA and I2S configuration and setup
- showDMABuffer(); // show backbuf_id of 0
+ //showDMABuffer(); // show backbuf_id of 0
#if SERIAL_DEBUG
if (!initialized)
@@ -492,7 +492,7 @@ class MatrixPanel_I2S_DMA {
static void color565to888(const uint16_t color, uint8_t &r, uint8_t &g, uint8_t &b);
- inline void flipDMABuffer()
+ inline void IRAM_ATTR flipDMABuffer()
{
if ( !m_cfg.double_buff) return;
@@ -503,25 +503,12 @@ class MatrixPanel_I2S_DMA {
Serial.printf_P(PSTR("Set back buffer to: %d\n"), back_buffer_id);
#endif
- // Wait before we allow any writing to the buffer. Stop flicker.
- while(!i2s_parallel_is_previous_buffer_free()) { delay(1); }
- }
-
- inline void showDMABuffer()
- {
-
- if (!m_cfg.double_buff) return;
-
- #if SERIAL_DEBUG
- Serial.printf_P(PSTR("Showtime for buffer: %d\n"), back_buffer_id);
- #endif
-
i2s_parallel_flip_to_buffer(I2S_NUM_0, back_buffer_id);
// Wait before we allow any writing to the buffer. Stop flicker.
- while(!i2s_parallel_is_previous_buffer_free()) { delay(1); }
+ while(i2s_parallel_is_previous_buffer_free() == false) { }
}
-
+
inline void setPanelBrightness(int b)
{
// Change to set the brightness of the display, range of 1 to matrixWidth (i.e. 1 - 64)