问题描述: 设置软件定时器,周期运转,创建成功(返回句柄,并且ERR=0),可以不进入回调函数
相关程序:
void OS_Timer0(OS_TMR *ptmr, void *p_arg)
{
GPIO_ToggleBits(LED4);
}
OS_TMR *pTimer0 = 0;
void Startup_SoftTimer(void)
{
unsigned char err=0;
pTimer0=OSTmrCreate(5,1,OS_TMR_OPT_PERIODIC, (OS_TMR_CALLBACK)OS_Timer0, (INT8U *)0,"OSTIMER0", &err) ;//100MS
OSTmrStart(pTimer0,&err);
}
void Task_KEY(void *pdata)
{
Startup_SoftTimer();
while(1)
{
}
}
void Task_start()
{
...
OSTaskCreate(Task_KEY, (void *)0, &Stk_Task_KEY[TASK_TEST_KEY_STK_SIZE-1], OS_USER_PRIO_GET(9));
..
} |