feat(timer): support lv_timer_handler_set_resume_cb (#4680)

Signed-off-by: XiaoweiYan <yanxiaowei@xiaomi.com>
Co-authored-by: XiaoweiYan <yanxiaowei@xiaomi.com>
This commit is contained in:
bjsylvia
2023-10-24 21:00:07 +08:00
committed by GitHub
parent 0c2815ee8d
commit 4bc07a8552
3 changed files with 44 additions and 0 deletions

View File

@@ -69,6 +69,18 @@ You can make a timer repeat only a given number of times with
automatically be deleted after it's called the defined number of times.
Set the count to ``-1`` to repeat indefinitely.
Enable and Disable
******************
You can enable or disable a timer with :cpp:expr:`lv_timer_enable(en)`.
Pause and Resume
****************
:cpp:expr:`lv_timer_pause(timer)` pauses the specified timer.
:cpp:expr:`lv_timer_resume(timer)` resumes the specified timer.
Measure idle time
*****************
@@ -78,6 +90,14 @@ the overall system, only :cpp:func:`lv_timer_handler`. It can be misleading if
you use an operating system and call :cpp:func:`lv_timer_handler` in a timer, as
it won't actually measure the time the OS spends in an idle thread.
Timer handler resume callback
*****************************
When the `lv_timer_handler` is stopped, if you want to pay attention to the wake-up
timing of the `lv_timer_handler`, you can set a resume callback using
:cpp:expr:`lv_timer_handler_set_resume_cb(cb, user_data)`.
The callback should have a ``void (*lv_timer_handler_resume_cb_t)(void*)`` prototype.
Asynchronous calls
******************