Can I safely call lv_timer_handler() less often?

What LVGL version are you using?

8.2

What do you want to achieve?

I want to know what the consequence of calling lv_timer_handler() less often (every 33ms) is.

What have you tried so far?

I’ve tried calling it less often and don’t see a problem. The docs are kind of vague about why it should be called every 5ms. I’d also like to know why if I don’t call it at all, LVGL doesn’t display anything.

Thanks

1 Like

lv_timer_handler() is where LVGL actually does its work; managing timers, capturing inputs, sending events and most importantly rendering stuff. Calling it less frequently means giving less room to LVGL to work. It will still work if called less frequently, but your mileage may vary.
The indication to call it every 5 milliseconds is probably arbitrary, that’s why the docs are vague.

If you don’t call it LVGL can’t work at all, so it displays nothing.

1 Like

Mattia is right, but I wanted to add one more thing: as long as lv_tick_inc() is called at a higher priority, lv_tick_handler() returns the milliseconds until you should call it again. You can call it before that thought, but the thread running LVGL can do other work or nap as needed.