OSTmrCreate ((OS_TMR *)&my_tmr,
(CPU_CHAR *)"MySoftTimer",
(OS_TICK )10,
(OS_TICK )10,
(OS_OPT )OS_OPT_TMR_PERIODIC,
(OS_TMR_CALLBACK_PTR )TmrCallback,
(void *)"Timer Over!",
(OS_ERR *)err);
OSTmrStart ((OS_TMR *)&my_tmr,
(OS_ERR *)err);
ts_start = OS_TS_GET();
while (DEF_TRUE) {
OSTimeDly ( 1000, OS_OPT_TIME_DLY, & err ); // 这里必须加一个延时函数,否则程序跑不起来,正在学习ucos, 请大神们指导下,非常感谢
}
} |