📄 testostimerreset.c
字号:
#include "timerTest.h"
void t3_entry(unsigned32 id , void *data)
{
printk("[%s]\n",data);
}
int testOSTimerReset()
{
OS_STATUS status;
unsigned32 t_id;
printf("*** test of OSTimerReset ***\n");
printf("create a timer.\n");
status = OSTimerCreate ("TIMER" , &t_id);
if (status != OS_OK)
{
printf("OSTimerCreate error:[%s]\n",serrno(errno));
return -1;
}
printf("fire the timer for 5000 ticks.\n");
status = OSTimerFireAfter (t_id , 5000 , t3_entry , "testOSTimerReset:in timer");
if (status != OS_OK)
{
printf("OSTimerFireAfter error:[%s]\n",serrno(errno));
return -1;
}
printf("task Delay 4000 ticks,then cancel the timer.\n");
OSTaskDelay(4000);
status = OSTimerReset (t_id);
if (status != OS_OK)
{
printf("OSTimerReset error:[%s]\n",serrno(errno));
return -1;
}
else
printf("OSTimerReset OK\n");
printf("task Delay 6000 ticks\n");
OSTaskDelay(6000);
OSTimerDelete (t_id);
printf("*** OSTimerReset test OK! ***\n");
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -