fix possible race condition in lcdFlush

This commit is contained in:
kevin koenig
2022-06-11 15:38:08 +02:00
committed by Raphael Coeffic
parent 60293ae763
commit 01c80f7868
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -143,7 +143,10 @@ void lcdRefresh()
void lcdFlushed()
{
lv_disp_flush_ready(refr_disp);
// its possible to get here before flushLcd is ever called.
// so check for nullptr first. (Race condition if you put breakpoints in startup code)
if (refr_disp != nullptr)
lv_disp_flush_ready(refr_disp);
}
//TODO: move this somewhere else