diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-06-01 15:41:47 +1000 |
| commit | dd27c3530432ea0b09f01e604bf577f31d8ef841 (patch) | |
| tree | bbf86cf81a78f0ff0b07f31f1c390db473f26fd3 /lib/lvgl/docs/porting/tick.md | |
| parent | 6fd588e970470b15936187980829916d0dbe77bb (diff) | |
| download | tangara-fw-dd27c3530432ea0b09f01e604bf577f31d8ef841.tar.gz | |
convert lvgl from submodule to a plain old directory
Diffstat (limited to 'lib/lvgl/docs/porting/tick.md')
| m--------- | lib/lvgl | 0 | ||||
| -rw-r--r-- | lib/lvgl/docs/porting/tick.md | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/lib/lvgl b/lib/lvgl deleted file mode 160000 -Subproject 0732400e7b564dd0e7dc4a924619d8e19c5b23a diff --git a/lib/lvgl/docs/porting/tick.md b/lib/lvgl/docs/porting/tick.md new file mode 100644 index 00000000..a3e8e94e --- /dev/null +++ b/lib/lvgl/docs/porting/tick.md @@ -0,0 +1,31 @@ +# Tick interface + +LVGL needs a system tick to know elapsed time for animations and other tasks. + +You need to call the `lv_tick_inc(tick_period)` function periodically and provide the call period in milliseconds. For example, `lv_tick_inc(1)` when calling every millisecond. + +`lv_tick_inc` should be called in a higher priority routine than `lv_task_handler()` (e.g. in an interrupt) to precisely know the elapsed milliseconds even if the execution of `lv_task_handler` takes more time. + +With FreeRTOS `lv_tick_inc` can be called in `vApplicationTickHook`. + +On Linux based operating systems (e.g. on Raspberry Pi) `lv_tick_inc` can be called in a thread like below: +```c +void * tick_thread (void *args) +{ + while(1) { + usleep(5*1000); /*Sleep for 5 millisecond*/ + lv_tick_inc(5); /*Tell LVGL that 5 milliseconds were elapsed*/ + } +} +``` + + + +## API + +```eval_rst + +.. doxygenfile:: lv_hal_tick.h + :project: lvgl + +``` |
