「App:Library:LVGL:docs:Porting:Tick interface」の版間の差分
(同じ利用者による、間の1版が非表示) | |||
9行目: | 9行目: | ||
LVGL needs a system tick to know elapsed time for animations and other tasks. | LVGL needs a system tick to know elapsed time for animations and other tasks. | ||
− | You need to call the <code style="color: #bb0000;">lv_tick_inc(tick_period)</code> function periodically and provide the call period in milliseconds. For example, <code style="color: #bb0000;">lv_tick_inc(1)</code> when calling every millisecond. | + | You need to call the <code style="color: #bb0000;">lv_tick_inc(tick_period)</code> function periodically and provide the call period in milliseconds. |
+ | |||
+ | For example, <code style="color: #bb0000;">lv_tick_inc(1)</code> when calling every millisecond. | ||
<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. | ||
32行目: | 34行目: | ||
− | <code style="color: #bb0000;">lv_tick_inc(tick_period)</code> | + | |
+ | 関数<code style="color: #bb0000;">lv_tick_inc(tick_period)</code>を定期的に呼び出し、呼び出し期間をミリ秒単位で指定する必要があります。 | ||
+ | |||
+ | たとえば、1ミリ秒ごとに呼び出す場合<code style="color: #bb0000;">lv_tick_inc(1)</code>。 | ||
− | <code style="color: #bb0000;"> | + | 経過したミリ秒を正確に知るには、<code style="color: #bb0000;">lv_task_handler</code>の実行に時間がかかる場合でも、<code style="color: #bb0000;">lv_tick_inc</code>は<code style="color: #bb0000;">lv_task_handler()</code>より優先度の高いルーチン(割り込みなど)で呼び出す必要があります。 |
− | + | FreeRTOSを使用すると、<code style="color: #bb0000;">lv_tick_inc</code>は<code style="color: #bb0000;">vApplicationTickHook</code>で呼び出すことができます。 | |
− | Linuxベースのオペレーティングシステム(Raspberry | + | Linuxベースのオペレーティングシステム(Raspberry Piなど)では、<code style="color: #bb0000;">lv_tick_inc</code>は次のようなスレッドで呼び出すことができます。 |
<syntaxhighlight lang="C++" style="border: 1px dashed gray;"> | <syntaxhighlight lang="C++" style="border: 1px dashed gray;"> | ||
void * tick_thread (void * args ) | void * tick_thread (void * args ) | ||
51行目: | 56行目: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
− | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | + | :[[App:Library:LVGL:docs:Porting#Tick interface|戻る : Previous]] |
94行目: | 99行目: | ||
:: 'prev_tick'からの経過ミリ秒 | :: 'prev_tick'からの経過ミリ秒 | ||
|} | |} | ||
− | :[[App:Library:LVGL:docs:Porting|戻る : Previous]] | + | :[[App:Library:LVGL:docs:Porting#Tick interface|戻る : Previous]] |
2022年8月18日 (木) 22:40時点における最新版
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 For example,
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*/
}
}
|
関数 たとえば、1ミリ秒ごとに呼び出す場合
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
|