This reverts commit b6cbfce5dd, reversing
changes made to c5227fd15e.
This commit is contained in:
mrfaptastic 2021-08-19 19:22:29 +01:00
parent b6cbfce5dd
commit d9e2f85f98
2 changed files with 21 additions and 17 deletions

View file

@ -388,7 +388,7 @@ class MatrixPanel_I2S_DMA {
// Setup the ESP32 DMA Engine. Sprite_TM built this stuff. // Setup the ESP32 DMA Engine. Sprite_TM built this stuff.
configureDMA(m_cfg); //DMA and I2S configuration and setup configureDMA(m_cfg); //DMA and I2S configuration and setup
flipDMABuffer(); // show backbuf_id of 0 showDMABuffer(); // show backbuf_id of 0
#if SERIAL_DEBUG #if SERIAL_DEBUG
if (!initialized) if (!initialized)
@ -495,27 +495,33 @@ class MatrixPanel_I2S_DMA {
inline void flipDMABuffer() inline void flipDMABuffer()
{ {
if ( !m_cfg.double_buff) return; 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);
// Flip to other buffer as the backbuffer. i.e. Graphic changes happen to this buffer (but aren't displayed until showDMABuffer()) // 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; back_buffer_id ^= 1;
#if SERIAL_DEBUG #if SERIAL_DEBUG
Serial.printf_P(PSTR("Set back buffer to: %d\n"), back_buffer_id); Serial.printf_P(PSTR("Set back buffer to: %d\n"), back_buffer_id);
#endif #endif
// Wait before we allow any writing to the buffer. Stop flicker.
while(!i2s_parallel_is_previous_buffer_free()) { delay(1); }
} }
// stub function for compatibility inline void showDMABuffer()
void showDMABuffer(){} {
if (!m_cfg.double_buff) return;
// check if backbuffer still has DMA transfer in progress or is it safe to write there #if SERIAL_DEBUG
bool backbuffready(){ return i2s_parallel_is_previous_buffer_free(); } 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); }
}
inline void setPanelBrightness(int b) inline void setPanelBrightness(int b)
{ {
// Change to set the brightness of the display, range of 1 to matrixWidth (i.e. 1 - 64) // Change to set the brightness of the display, range of 1 to matrixWidth (i.e. 1 - 64)

View file

@ -98,9 +98,7 @@ class VirtualMatrixPanel
} }
void flipDMABuffer() { display->flipDMABuffer(); } void flipDMABuffer() { display->flipDMABuffer(); }
void showDMABuffer() {} void showDMABuffer() { display->showDMABuffer(); }
bool backbuffready(){ return display->backbuffready(); }
void drawDisplayTest(); void drawDisplayTest();