cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt Handler

sirpak
Associate II
Posted on March 22, 2016 at 12:46

Hi, 

I have two interrupt with different pre-emption priority.

When the higher priority interrupt handler is executed, I would like to ''kill'' the lower priority interrupt handler, if it was running.

is it possible?

Thanks,

Marco

#handler #interrupt
3 REPLIES 3
Posted on March 22, 2016 at 13:38

is it possible?

Yes, but you'd have to dig into the stack/state, I'm not sure it is the practical solution. It would be far cleaner if you solved your logic problem in a way that doesn't require this. Can you signal your other context to stop and leave?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sirpak
Associate II
Posted on March 22, 2016 at 14:26

Hi Clive,

Yes, I already tried to set a flag and when the lower priority interrupt get back, before modifying the output, checks the flag.

The problem is when the higher priority interrupt come after the flag check instruction. 

Is there a library function to empty the stack of lower priority interrupt?

Thanks,

Posted on March 22, 2016 at 16:32

Is there a library function to empty the stack of lower priority interrupt?

I'm not sure it is something appropriate for a library, it requires *you* to understand the processor context, in your system, and unwind it, to do this you'd review and understand the ARM TRMs thoroughly.

If you are doing too much in the lower priority interrupt, perhaps that needs to move to a worker task, and you need to add more test/abort points, if the arrival of an interrupt needs to stop processing.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..