Time-Out timer event

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
JoVM
Posts: 89
Joined: Thu Mar 12, 2015 12:13 pm

Time-Out timer event

Post 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
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Time-Out timer event

Post 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
JoVM
Posts: 89
Joined: Thu Mar 12, 2015 12:13 pm

Re: Time-Out timer event

Post by JoVM »

@Giovanni

Tnx! chSysLockFromISR blocks regular interrupts? So Only after time-out u can accept again USART interrupts? I did not try yet.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Time-Out timer event

Post by Giovanni »

The two things are not related, chSysLockFromISR() enters a critical zone from an ISR, chEvtWaitXXXTimeout() waits for events in Thread context.

Giovanni
JoVM
Posts: 89
Joined: Thu Mar 12, 2015 12:13 pm

Re: Time-Out timer event

Post 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.
Post Reply