File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -242,14 +242,16 @@ void DisplayApp::Refresh() {
242242 // If not true, then wait that amount of time
243243 queueTimeout = CalculateSleepTime ();
244244 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+ }
247254 };
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- }
253255 }
254256 } else {
255257 queueTimeout = portMAX_DELAY;
You can’t perform that action at this time.
0 commit comments