#ifndef OS_TIMERCNT
#define OS_TIMERCNT 5
#endif
二、在 task 中建立 timer。
OS_ID tmr1;
tmr1 = os_tmr_create (300, 1); /// after 300 system_tick, callback.
if (tmr1 == NULL) {
printf ("Failed to create user timer.\n");
}
三、在 RTX_Config.c 修改 timer 的 callback 函式 os_tmr_call。
void os_tmr_call (U16 info) {
/* This function is called when the user timer has expired. Parameter */
/* 'info' holds the value, defined when the timer was created. */
/* HERE: include optional user code to be executed on timeout. */
}
沒有留言:
張貼留言