Lv_timer_create: when using timers to update display, handle display stuff regularly

When using multiple update functions through lv_timer_create, when lv_timer_handler runs it executes all timer callbacks if needed (depending on respective delays).
But internal handling of touches, screen updates or any other lvgl-managed work happens only when these updates are done. So when you need a long time to run them (let’s say 100ms), touch responsiveness feels awful.

What would be the right way to tackle this problem, having lvgl touch data (lv_indev_data_t) taken care of, and improve responsiveness of the screen, while breaking individual updates functions into smaller chunks ? May be related to timer lv_indev_read_timer_cb.

Thank you !

Hey,

Just few question to make sure that I understand correctly:

  • do you have single screen which might take 100ms to update?
  • do you have other non-LVGL timer that might take longer to run?

Hello,

I think the root of your problem is the timer callback possibly taking 100ms. What on earth are you doing in this callback? I suggest splitting whatever you are trying to do into smaller chunks and using that timer to set a flag to start executing that function.