|
大家好,
最近使用zigbee sdk 中的软件定时器时遇到一个问题,我定义一个test1定时器 ,一个test2定时器,在test1的回调用启动test2定时器,这样会遇到test 虽然添加成功了,它不会执行回调,希望得到你们的帮助,谢谢,
测试程序如下:
ev_timer_event_t *test1_Evt = NULL;
ev_timer_event_t *test2_Evt = NULL;
s32 test1_timer(void *arg)
{
int tick_time =0;
printf("test1_timer tigger\n");
stop_time1();
start_time2();//启动timer2
tick_time=-1;
return tick_time;
}
s32 test2_timer(void *arg)
{
printf("test2_timer tigger\n");
stop_time2();
return -1;
}
void stop_time1()
{
if(test1_Evt)
{
TL_ZB_TIMER_CANCEL(&test1_Evt);
printf("stop timer 1\n");
}
}
void stop_time2()
{
if(test2_Evt)
{
TL_ZB_TIMER_CANCEL(&test2_Evt);
printf("stop timer 2\n");
}
}
void start_time1()
{
test1_Evt = TL_ZB_TIMER_SCHEDULE(test1_timer,NULL,100);
if(test1_Evt )
{
printf("test_timer1 successful\n");
}
printf("start timer 1\n");
}
void start_time2()
{
test2_Evt = TL_ZB_TIMER_SCHEDULE(test2_timer,NULL,3);
if(test2_Evt )
{
printf("test_timer2 successful\n");
}
printf("start timer 2\n");
}
|
|