does it support ISR event queue?

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

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
yushanh
Posts: 31
Joined: Mon Jul 29, 2013 6:23 pm

does it support ISR event queue?

Post by yushanh »

Hi all,

I wonder if ChibiOS support ISR queue? For example, I have an external interrupt driver which will be invoked when button is pressed, and inside the handler the LED will blink one time. But if I press the button 10 times really fast, it won't blink 10 times as what I expected. Is this feature supported or will it be there in the future? Thanks!

S.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: does it support ISR event queue?

Post by Giovanni »

There is no such a thing like an ISR queue as far I know. An interrupt can be pending or not, if you try to trigger an interrupt that is already pending and not yet served then the second event is lost. It is not matter of operating system, it is how the interrupt controller works.

Since interrupt servicing is *very* fast I would look for a problem in your application.

Giovanni
colin
Posts: 149
Joined: Thu Dec 22, 2011 7:44 pm

Re: does it support ISR event queue?

Post by colin »

Giovanni is right. If you need to handle an edge-triggered interrupt event that might happen repeatedly in a short time, you need to write an ISR that will be quickly (in about 12 core clock cycles) be entered on the interrupt event, then the ISR clears the interrupt flag so that a subsequent edge will cause the interrupt to be pend again. Don't do any long handling in the ISR itself -- you would use an RTOS construct like a message queue or semaphore or something if you need to do long processing, and that long processing would then be performed by a thread (not in an interrupt context) after the ISR completes. If you really have very rapid events, and you need to do a lot of processing, then you will possibly have to re-evaluate your design... maybe take advantage of more specialized hardware processing instead of doing it in firmware.
Post Reply