chore(doc): fix typos in task-handler.md (#3153)

This commit is contained in:
Gabriel Wang
2022-03-08 19:29:40 +00:00
committed by GitHub
parent fcc1152f9c
commit 08a3cc0eb6
+4 -4
View File
@@ -19,22 +19,22 @@ while(1) {
} }
``` ```
If you intend to use `lv_timer_handler()` in a super-loop, a helper function`lv_run_timer_handler_in_period(__ms)` is provided to simplify the porting: If you want to use `lv_timer_handler()` in a super-loop, a helper function`lv_timer_handler_run_in_period()` is provided to simplify the porting:
```c ```c
while(1) { while(1) {
... ...
lv_timer_handler_run_period(5); /* run lv_timer_handler() every 5ms */ lv_timer_handler_run_in_period(5); /* run lv_timer_handler() every 5ms */
... ...
} }
``` ```
In OS environment, you can use it together with the delay or sleep provided by OS: In an OS environment, you can use it together with the **delay** or **sleep** provided by OS to release CPU whenever possible:
```c ```c
while (1) { while (1) {
lv_timer_handler_run_in_period(5); /* run lv_timer_handler() every 5ms */ lv_timer_handler_run_in_period(5); /* run lv_timer_handler() every 5ms */
sleep(5); /* sleep 5ms */ my_delay_ms(5); /* delay 5ms to avoid unnecessary polling */
} }
``` ```