「App:Library:LVGL:docs:Porting:Tick interface」の版間の差分
22行目: | 22行目: | ||
<code style="color: #bb0000;">lv_tick_inc</code> should be called in a higher priority routine than <code style="color: #bb0000;">lv_task_handler()</code> (e.g. in an interrupt) to precisely know the elapsed milliseconds even if the execution of <code style="color: #bb0000;">lv_task_handler</code> takes more time. | <code style="color: #bb0000;">lv_tick_inc</code> should be called in a higher priority routine than <code style="color: #bb0000;">lv_task_handler()</code> (e.g. in an interrupt) to precisely know the elapsed milliseconds even if the execution of <code style="color: #bb0000;">lv_task_handler</code> takes more time. | ||
+ | |||
With FreeRTOS <code style="color: #bb0000;">lv_tick_inc</code> can be called in <code style="color: #bb0000;">vApplicationTickHook</code>. | With FreeRTOS <code style="color: #bb0000;">lv_tick_inc</code> can be called in <code style="color: #bb0000;">vApplicationTickHook</code>. | ||
36行目: | 37行目: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| | | | ||
+ | |||
+ | |||
+ | LVGLには、アニメーションやその他のタスクの経過時間を知るためのシステムティックが必要です。 | ||
+ | |||
+ | |||
+ | <code>lv_tick_inc(tick_period)</code>関数を定期的に呼び出し、呼び出し期間をミリ秒単位で指定する必要があります。たとえば、<code>lv_tick_inc(1)</code>ミリ秒ごとに呼び出す場合。 | ||
+ | |||
+ | |||
+ | <code>lv_tick_inclv_task_handler()</code>の実行に時間がかかる場合でも、経過したミリ秒を正確に知るには、(割り込みなどで)より優先度の高いルーチンで呼び出す必要があります<code>lv_task_handler</code>。 | ||
+ | |||
+ | |||
+ | FreeRTOS<code>lv_tick_inc</code>を使用すると、で呼び出すことができます<code>vApplicationTickHook</code>。 | ||
+ | |||
+ | Linuxベースのオペレーティングシステム(Raspberry Piなど)<code>lv_tick_inc</code>では、次のようなスレッドで呼び出すことができます。 | ||
+ | void * tick_thread (void * args ) | ||
+ | { | ||
+ | while (1 ) { | ||
+ | usleep (5 * 1000 ); /*5ミリ秒スリープ*/ | ||
+ | lv_tick_inc (5 ); /*5ミリ秒が経過したことをLVGLに通知します*/ | ||
+ | } | ||
+ | } | ||
|} | |} | ||
:[[App:Library:LVGL:docs:Porting|戻る : Previous]] | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | ||
62行目: | 84行目: | ||
:: the elapsed milliseconds since 'prev_tick' | :: the elapsed milliseconds since 'prev_tick' | ||
| | | | ||
+ | |||
+ | |||
+ | 1ミリ秒の分解能でsystem tickへのアクセスを提供します | ||
+ | |||
+ | '''Functions''' | ||
+ | |||
+ | ; uint32_t lv_tick_get(void) | ||
+ | : 起動してからの経過ミリ秒を取得します | ||
+ | : '''戻り値''' | ||
+ | :: 経過ミリ秒 | ||
+ | |||
+ | ; uint32_t lv_tick_elaps(uint32_t prev_tick) | ||
+ | : 前のタイムスタンプから経過したミリ秒を取得します | ||
+ | : '''パラメーター''' | ||
+ | :: '''prev_tick-'''以前のタイムスタンプ(lv_tick_get()の戻り値) | ||
+ | : '''戻り値''' | ||
+ | :: 'prev_tick'からの経過ミリ秒 | ||
|} | |} | ||
:[[App:Library:LVGL:docs:Porting|戻る : Previous]] | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] |
2022年6月22日 (水) 14:22時点における版
https://docs.lvgl.io/8.2/porting/tick.html
英文 | 自動翻訳 |
---|---|
Tick interface
英文 | 自動翻訳 |
---|---|
LVGL needs a system tick to know elapsed time for animations and other tasks. You need to call the
On Linux based operating systems (e.g. on Raspberry Pi) 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*/
}
}
|
Linuxベースのオペレーティングシステム(Raspberry Piなど) void * tick_thread (void * args ) { while (1 ) { usleep (5 * 1000 ); /*5ミリ秒スリープ*/ lv_tick_inc (5 ); /*5ミリ秒が経過したことをLVGLに通知します*/ } } |
API
英文 | 自動翻訳 |
---|---|
Provide access to the system tick with 1 millisecond resolution Functions
|
Functions
|