mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-08 15:14:43 +02:00
Add dmaWait() for STM32
This commit is contained in:
@@ -401,8 +401,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len)
|
||||
** Function name: dmaBusy
|
||||
** Description: Check if DMA is busy (usefully non-blocking!)
|
||||
***************************************************************************************/
|
||||
// Use "while(tft.dmaBusy());" in sketch for a blocking wait for DMA to complete
|
||||
// or "while( tft.dmaBusy() ) {Do-something-useful;}"
|
||||
// Use while( tft.dmaBusy() ) {Do-something-useful;}"
|
||||
bool TFT_eSPI::dmaBusy(void)
|
||||
{
|
||||
//return (dmaHal.State == HAL_DMA_STATE_BUSY); // Do not use, SPI may still be busy
|
||||
@@ -410,6 +409,17 @@ bool TFT_eSPI::dmaBusy(void)
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: dmaWait
|
||||
** Description: Wait until DMA is over (blocking!)
|
||||
***************************************************************************************/
|
||||
void TFT_eSPI::dmaWait(void)
|
||||
{
|
||||
//return (dmaHal.State == HAL_DMA_STATE_BUSY); // Do not use, SPI may still be busy
|
||||
while (spiHal.State == HAL_SPI_STATE_BUSY_TX); // Check if SPI Tx is busy
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************************
|
||||
** Function name: pushImageDMA
|
||||
** Description: Push pixels to TFT (len must be less than 32767)
|
||||
|
Reference in New Issue
Block a user