DMA2D configuration error fix (-DDEBUG_WINDOWS) (#190)

* Fixes DMA2D ConfError

* Check configuration and transfer errors

Check for DMA2D configuration and transfer errors and do not enter the otherwise endless while loop. Thx to @raphaelcoeffic for the tip.
This commit is contained in:
Risto
2021-06-11 15:56:30 +02:00
committed by GitHub
parent 430902ae6f
commit f665ce5a9d
2 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ class FabButton: public Button {
#if defined(DEBUG_WINDOWS)
std::string getName() const override
{
return "FabButton(" + std::to_string(icon) + ")";
return "FabButton";
}
#endif
+24
View File
@@ -369,6 +369,10 @@ void DMAFillRect(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, ui
/* Start Transfer */
DMA2D_StartTransfer();
/* Check configuration error */
if ((DMA2D_GetFlagStatus(DMA2D_FLAG_CE) == SET) || (DMA2D_GetFlagStatus(DMA2D_FLAG_TE) == SET))
return; // Exit if configuration or transfer error
/* Wait for CTC Flag activation */
while (DMA2D_GetFlagStatus(DMA2D_FLAG_TC) == RESET);
}
@@ -409,6 +413,10 @@ void DMACopyBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x,
/* Start Transfer */
DMA2D_StartTransfer();
/* Check configuration error */
if ((DMA2D_GetFlagStatus(DMA2D_FLAG_CE) == SET) || (DMA2D_GetFlagStatus(DMA2D_FLAG_TE) == SET))
return; // Exit if configuration or transfer error
/* Wait for CTC Flag activation */
while (DMA2D_GetFlagStatus(DMA2D_FLAG_TC) == RESET);
}
@@ -458,6 +466,10 @@ void DMACopyAlphaBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_
/* Start Transfer */
DMA2D_StartTransfer();
/* Check configuration error */
if ((DMA2D_GetFlagStatus(DMA2D_FLAG_CE) == SET) || (DMA2D_GetFlagStatus(DMA2D_FLAG_TE) == SET))
return; // Exit if configuration or transfer error
/* Wait for CTC Flag activation */
while (DMA2D_GetFlagStatus(DMA2D_FLAG_TC) == RESET);
}
@@ -512,6 +524,10 @@ void DMACopyAlphaMask(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t
/* Start Transfer */
DMA2D_StartTransfer();
/* Check configuration error */
if ((DMA2D_GetFlagStatus(DMA2D_FLAG_CE) == SET) || (DMA2D_GetFlagStatus(DMA2D_FLAG_TE) == SET))
return; // Exit if configuration or transfer error
/* Wait for CTC Flag activation */
while (DMA2D_GetFlagStatus(DMA2D_FLAG_TC) == RESET);
}
@@ -545,6 +561,10 @@ void DMABitmapConvert(uint16_t * dest, const uint8_t * src, uint16_t w, uint16_t
/* Start Transfer */
DMA2D_StartTransfer();
/* Check configuration error */
if ((DMA2D_GetFlagStatus(DMA2D_FLAG_CE) == SET) || (DMA2D_GetFlagStatus(DMA2D_FLAG_TE) == SET))
return; // Exit if configuration or transfer error
/* Wait for CTC Flag activation */
while (DMA2D_GetFlagStatus(DMA2D_FLAG_TC) == RESET);
}
@@ -578,6 +598,10 @@ void lcdCopy(void * dest, void * src)
/* Start Transfer */
DMA2D_StartTransfer();
/* Check configuration error */
if ((DMA2D_GetFlagStatus(DMA2D_FLAG_CE) == SET) || (DMA2D_GetFlagStatus(DMA2D_FLAG_TE) == SET))
return; // Exit if configuration or transfer error
/* Wait for CTC Flag activation */
while (DMA2D_GetFlagStatus(DMA2D_FLAG_TC) == RESET);
}