lvgl / lv_binding_micropython

LVGL binding for MicroPython
MIT License
237 stars 157 forks source link

Make lvgl tick more accurate. (rebase to master) #130

Closed rockindy closed 3 years ago

amirgon commented 3 years ago

In general looks good to me.
What do you think @embeddedt ?

embeddedt commented 3 years ago

I am still not convinced about the * 2 logic. Why can't you just call lv_tick_inc(acc) and get rid of the accumulated ticks? LVGL can handle larger-than-normal values being passed to lv_tick_inc.

rockindy commented 3 years ago

@amirgon , I have added parenthesis, thanks.

@embeddedt , I think avoid using * 2 logic is great suggestion and has updated it in the new commit. Thanks. delta - tick_ms is a very small error which is less than 1ms, the acc needs several ticks to reach 1ms and more ticks to reach LV_TICK_RATE. We should only call lv_tick_inc() when the unit of argument is ms.

amirgon commented 3 years ago

@embeddedt - Do you have any more comments about this? Can I merge this?

embeddedt commented 3 years ago

Looks good.

amirgon commented 3 years ago

Merged. Thank you!