Problem running a periodic timer and one shot timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem running a periodic timer and one shot timer

273 Views
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 Kudos
1 Reply

101 Views
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 Kudos