-
Notifications
You must be signed in to change notification settings - Fork 7.7k
modules: lvgl: add automatic lv_timer_handler call #93281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modules: lvgl: add automatic lv_timer_handler call #93281
Conversation
a6a0929
to
f36fd97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need a testcase somewhere in tests/samples with this option enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool feature 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A cleaner solution IMO is:
- Have a
k_work_q
as the "thread" - Use a
k_work_delayable
to be (re)scheduled - Call
lv_timer_hander
in the delayed work handler and re-schedule based on the result
EDIT: Added benefit: the work queue could be user exposed to allow submitting/scheduling more work onto the LVGL thread.
f36fd97
to
8582b98
Compare
@pdgendt I implemented using the workqueus, I kepi the previous one on the commit history, for easy comparisation |
Didn't notice this, please squash in that case. |
@JarmouniA what would be a good way for testing this option? Just duplicate one of the samples but using this option and removing the sleep loop? BTW this can be part of another PR? |
inside of its own thread when user enable it on the LVGL Zephyr options menu, using this option makes the calling of the lv_timer_handler driven by an internal timer and thread. Options like priority and stack size for this thread are exposed making it configurable by the application. Signed-off-by: Felipe Neves <[email protected]> modules: lvgl: put LVGL core into a dedicated workqueue Replacing the initial approach based on timers and semaphore Signed-off-by: Felipe Neves <[email protected]>
8582b98
to
bacbb3a
Compare
Thank you @pdgendt , I exposed also the workqueue via a function |
b34bf4d
to
ab493d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff, do you see the same gains you had like using the timer? It probably should as these use the same low level primitives.
If I understand the purpose of this PR correctly, putting
and
in between ifndef CONFIG_LV_Z_RUN_LVGL_ON_WORKQUEUE... endif then adding a testcase in sample.yaml with extra_configs: CONFIG_LV_Z_RUN_LVGL_ON_WORKQUEUE=y would work, no?
|
@pdgendt yes they offer the same performance and better timer slippage correction than using the sleep loop approach, but the workqueue is much cleaner |
Added the tests case on the demo samples as pointed by @JarmouniA , the missing piece of this PR, please everyone take another look :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreeing with @JarmouniA, one case for building the sample with the new option should be good enough, otherwise LGTM :^)
adb0dfa
to
15f72ee
Compare
@JarmouniA @faxe1008 , got it, I left only the case of the demo benchmark then please PTAL again :) |
still seeing all of them |
that uses the LVGL internal workqueue option to drive the LVGL core automatically Signed-off-by: Felipe Neves <[email protected]>
15f72ee
to
872ddbc
Compare
Uhh, It seems I edited from the wrong place, thanks for notice @JarmouniA, just corrected :) Thank you! |
|
@kartben any chance on making this on the 4.2? This change will improve significant the timing characteristics of the LVGL core. |
only bug fixes are backported. |
Nevermind @JarmouniA, @kartben the 4.2 is already out, I was thinking that Zephyr was approaching on feature freeze |
inside of its own thread when user enable it on
the LVGL Zephyr options menu, using this option makes the calling of the lv_timer_handler driven by an internal timer and thread. Options like priority and stack size for this thread are exposed making it configurable by the application.
Worth to mention, this option is disbaled by default due the nature of the current samples of the LVGL that invokes lv_timer_handler from the application