clearScreen() now wipes only color data for current buffer
Signed-off-by: Emil Muratov <gpm@hotplug.ru>
This commit is contained in:
parent
f73552b652
commit
8ebc5e933a
3 changed files with 18 additions and 18 deletions
|
@ -588,18 +588,6 @@ void MatrixPanel_I2S_DMA::updateMatrixDMABuffer(uint8_t red, uint8_t green, uint
|
|||
} // colour depth loop (8)
|
||||
} // updateMatrixDMABuffer (full frame paint)
|
||||
|
||||
/**
|
||||
* clear screen to black and reset all service bits
|
||||
*/
|
||||
void MatrixPanel_I2S_DMA::clearScreen(){
|
||||
clearFrameBuffer();
|
||||
brtCtrlOE(brightness);
|
||||
if (m_cfg.double_buff){
|
||||
clearFrameBuffer(1);
|
||||
brtCtrlOE(brightness, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief - clears and reinitializes color/control data in DMA buffs
|
||||
* When allocated, DMA buffs might be dirtry, so we need to blank it and initialize ABCDE,LAT,OE control bits.
|
||||
|
|
|
@ -370,7 +370,7 @@ class MatrixPanel_I2S_DMA {
|
|||
|
||||
|
||||
// Flush the DMA buffers prior to configuring DMA - Avoid visual artefacts on boot.
|
||||
clearScreen(); // Must fill the DMA buffer with the initial output bit sequence or the panel will display garbage
|
||||
resetbuffers(); // Must fill the DMA buffer with the initial output bit sequence or the panel will display garbage
|
||||
|
||||
// Setup the ESP32 DMA Engine. Sprite_TM built this stuff.
|
||||
configureDMA(m_cfg); //DMA and I2S configuration and setup
|
||||
|
@ -398,10 +398,10 @@ class MatrixPanel_I2S_DMA {
|
|||
virtual void fillScreen(uint16_t color); // overwrite adafruit implementation
|
||||
|
||||
/**
|
||||
* clears DMA buffers and reinitializes control bits
|
||||
* to just clear the screen to black fillScreen(0) works faster
|
||||
* A wrapper to fill the entire Screen with black
|
||||
* if double buffering is used, than only back buffer is cleared
|
||||
*/
|
||||
void clearScreen();
|
||||
inline void clearScreen(){ updateMatrixDMABuffer(0,0,0); };
|
||||
|
||||
#ifndef NO_FAST_FUNCTIONS
|
||||
/**
|
||||
|
@ -547,7 +547,7 @@ class MatrixPanel_I2S_DMA {
|
|||
* Stop the ESP32 DMA Engine. Screen will forever be black until next ESP reboot.
|
||||
*/
|
||||
void stopDMAoutput() {
|
||||
clearScreen();
|
||||
resetbuffers();
|
||||
i2s_parallel_stop_dma(I2S_NUM_1);
|
||||
}
|
||||
|
||||
|
@ -573,6 +573,18 @@ class MatrixPanel_I2S_DMA {
|
|||
/* Update the entire DMA buffer (aka. The RGB Panel) a certain colour (wipe the screen basically) */
|
||||
void updateMatrixDMABuffer(uint8_t red, uint8_t green, uint8_t blue);
|
||||
|
||||
/**
|
||||
* wipes DMA buffer(s) and reset all color/service bits
|
||||
*/
|
||||
inline void resetbuffers(){
|
||||
clearFrameBuffer();
|
||||
brtCtrlOE(brightness);
|
||||
if (m_cfg.double_buff){
|
||||
clearFrameBuffer(1);
|
||||
brtCtrlOE(brightness, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_FAST_FUNCTIONS
|
||||
/**
|
||||
|
|
|
@ -70,7 +70,7 @@ class VirtualMatrixPanel
|
|||
virtual void drawPixel(int16_t x, int16_t y, uint16_t color);
|
||||
virtual void fillScreen(uint16_t color); // overwrite adafruit implementation
|
||||
void clearScreen() {
|
||||
fillScreen(0);
|
||||
display->clearScreen();
|
||||
}
|
||||
//void drawPixelRGB565(int16_t x, int16_t y, uint16_t color);
|
||||
void drawPixelRGB888(int16_t x, int16_t y, uint8_t r, uint8_t g, uint8_t b);
|
||||
|
|
Loading…
Reference in a new issue