VOID taskSampleEntry1(VOID)
{
UINT32 lx;
UINT16 last=LOS_TickCountGet();
while(1)
{
LOS_TaskDelay(1000);
lx=LOS_TickCountGet();
printf("taskSampleEntry1 running,task1 SP:%08x,tick:%u\r\n", __get_SP(),lx-last);
last=lx;
}
}
打印输出为
taskSampleEntry1 running,task1 SP:20001f54,tick:1970
taskSampleEntry1 running,task1 SP:20001f54,tick:1970
taskSampleEntry1 running,task1 SP:20001f54,tick:1981
taskSampleEntry1 running,task1 SP:20001f54,tick:1991
延时1000ms,实际时间差不多。问题是ticks基本加倍了,为什么呢?
另外,增加一个软件定时器后,实际延时时间基本上只有0.5秒,移置适配有问题?