File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -242,14 +242,16 @@ void DisplayApp::Refresh() {
242
242
// If not true, then wait that amount of time
243
243
queueTimeout = CalculateSleepTime ();
244
244
if (queueTimeout == 0 ) {
245
- // Keep running the task handler if it still has things to draw
246
- while (!lv_task_handler ()) {
245
+ // Only advance the tick count when LVGL is done
246
+ // Otherwise keep running the task handler while it still has things to draw
247
+ // Note: under high graphics load, LVGL will always have more work to do
248
+ if (lv_task_handler () > 0 ) {
249
+ // Drop frames that we've missed if drawing/event handling took way longer than expected
250
+ while (queueTimeout == 0 ) {
251
+ alwaysOnTickCount += 1 ;
252
+ queueTimeout = CalculateSleepTime ();
253
+ }
247
254
};
248
- // Drop frames that we've missed if the loop took way longer than expected to execute
249
- while (queueTimeout == 0 ) {
250
- alwaysOnTickCount += 1 ;
251
- queueTimeout = CalculateSleepTime ();
252
- }
253
255
}
254
256
} else {
255
257
queueTimeout = portMAX_DELAY;
You can’t perform that action at this time.
0 commit comments