diff options
| author | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-08-19 20:44:07 +0100 |
|---|---|---|
| committer | mrfaptastic <12006953+mrfaptastic@users.noreply.github.com> | 2021-08-19 20:44:07 +0100 |
| commit | a2d3efc0f393a6fc569d465aab76aad9e51a874c (patch) | |
| tree | 48570017398c633d01d9e22f9ba0b42c1aa02500 | |
| parent | aa0c7785b27210a0608f0a42b0c96f204c10a4d1 (diff) | |
Update ESP32-HUB75-MatrixPanel-I2S-DMA.h
| -rw-r--r-- | ESP32-HUB75-MatrixPanel-I2S-DMA.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/ESP32-HUB75-MatrixPanel-I2S-DMA.h index 93b5227..bcfd671 100644 --- a/ESP32-HUB75-MatrixPanel-I2S-DMA.h +++ b/ESP32-HUB75-MatrixPanel-I2S-DMA.h @@ -496,17 +496,18 @@ class MatrixPanel_I2S_DMA { { if ( !m_cfg.double_buff) return; - // Flip to other buffer as the backbuffer. i.e. Graphic changes happen to this buffer (but aren't displayed until showDMABuffer()) - back_buffer_id ^= 1; - #if SERIAL_DEBUG Serial.printf_P(PSTR("Set back buffer to: %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() == false) { } + + // Flip to other buffer as the backbuffer. i.e. Graphic changes happen to this buffer (but aren't displayed until showDMABuffer()) + back_buffer_id ^= 1; + } inline void setPanelBrightness(int b) |
