Problem running a periodic timer and one shot timer

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Problem running a periodic timer and one shot timer

979 次查看
larrydemuth
Contributor III

I'm using a K64 and my code needs to run 2 types of timers in 2 different tasks.

One timer is a periodic timer and is set up with a call to _timer_start_periodic_every function, and the period is 100mS. The timer works fine.

The other timer is a one shot timer and is set up with a call to _timer_start_oneshot_after function, and the time is between 1 and 1000 seconds. The will be very infrequent, but when I invoke the code, the _timer_start_oneshot_after function stops at the _lwsem_wait, in the _timer_start_oneshot_after_internal function, and never returns.

If I remove the periodic timer and invoke the code for the one shot timer, the one shot works fine, so I verified both timers work by themselves.

Is it not possible to run 2 timers? Or a combination of timers? I have tried adjusting the timer priority (1, 2, 10)  and stack size (10k for verifying this isn't the problem), but it doesn't seem to help.

Larry

0 项奖励
1 回复

807 次查看
larrydemuth
Contributor III

Never mind, I found the problem. The periodic timer handler had a loop with a _time_delay function call in it, and this is no doubt messing with the timer interrupt. Have to redo it.

0 项奖励