Improved check for rendering in progress in HX83XX display driver, now both chip select and DMA enable bit are verified

This commit is contained in:
Silvano Seva 2020-10-25 17:22:33 +01:00 committed by Niccolò Izzo
parent 1877f92905
commit bf3488def8
1 changed files with 6 additions and 2 deletions

View File

@ -401,8 +401,12 @@ void display_render()
bool display_renderingInProgress()
{
/* Rendering is in progress if display's chip select is low. */
return gpio_readPin(LCD_CS);
/*
* Rendering is in progress if display's chip select is low or a DMA
* transfer is in progress.
*/
bool dmaBusy = (DMA2_Stream7->CR & DMA_SxCR_EN) ? true : false;
return (gpio_readPin(LCD_CS) == 0) || dmaBusy;
}
void *display_getFrameBuffer()