acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

tick.md (1029B)

      1 ```eval_rst
      2 .. include:: /header.rst
      3 :github_url: |github_link_base|/porting/tick.md
      4 ```
      5 # Tick interface
      6 
      7 LVGL needs a system tick to know elapsed time for animations and other tasks.
      8 
      9 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.
     10 
     11 `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.
     12 
     13 With FreeRTOS `lv_tick_inc` can be called in `vApplicationTickHook`.
     14 
     15 On Linux based operating systems (e.g. on Raspberry Pi) `lv_tick_inc` can be called in a thread like below:
     16 ```c
     17 void * tick_thread (void *args)
     18 {
     19       while(1) {
     20         usleep(5*1000);   /*Sleep for 5 millisecond*/
     21         lv_tick_inc(5);      /*Tell LVGL that 5 milliseconds were elapsed*/
     22     }
     23 }
     24 ```
     25 
     26 
     27 
     28 ## API
     29 
     30 ```eval_rst
     31 
     32 .. doxygenfile:: lv_hal_tick.h
     33   :project: lvgl
     34 
     35 ```