Page 1 of 1
Time-Out timer event
Posted: Fri Mar 13, 2015 9:19 pm
by JoVM
I need to start a time-out timer with an event. I don't think a need to occupy one of the hw timers? What is the best option for this timer?
I need to be able to accept UART interrupts after this timer is started.
Kr,Jo
Re: Time-Out timer event
Posted: Fri Mar 13, 2015 10:51 pm
by Giovanni
There is an "EventTimer" module under ./os/various, it uses a virtual timer internally. Also note that the functions chEvtWaitXXXTimeout() can have timeout so the timer could not be necessary at all.
Giovanni
Re: Time-Out timer event
Posted: Sat Mar 14, 2015 3:44 pm
by JoVM
@Giovanni
Tnx! chSysLockFromISR blocks regular interrupts? So Only after time-out u can accept again USART interrupts? I did not try yet.
Re: Time-Out timer event
Posted: Sat Mar 14, 2015 6:36 pm
by Giovanni
The two things are not related, chSysLockFromISR() enters a critical zone from an ISR, chEvtWaitXXXTimeout() waits for events in Thread context.
Giovanni
Re: Time-Out timer event
Posted: Sat Mar 14, 2015 8:51 pm
by JoVM
@Giovanni
chSysLockFromISR refers to tmrcb from event timer. BroadcastI and chVTDoSetI are called in a critcal section.
I'm not really sure what the chEvtWaitXXXTimeout() does.