Disabling Interrupts?

12 Oct 2009

Hello all.

I'm just about to implement a bunch of push buttons in a hand contrroller design and (since I haven't tried this yet) was wondering if I tie the button press to an edge interrupt am I going to see potentially more than one InterruptIn nesting? In other designs I've done, the interrupt can be disabled or masked while the in routine ensuring that the interrupt function occurs only once for the event. Does the InterruptIn disable the interrupt until it returns? Also, can I check the state of the digital line while I'm in the routine to see if the button is being held down?

Thanks for the help...

Gary

12 Oct 2009

Hi Gary,

Gary Trimble wrote:
if I tie the button press to an edge interrupt am I going to see potentially more than one InterruptIn nesting? Does the InterruptIn disable the interrupt until it returns? Also, can I check the state of the digital line while I'm in the routine to see if the button is being held down?

The interrupt will re-enable when the interrupt function returns (so you won't get nesting). And yep, you can read the state of the button in the interrupt routine. So hopefully just what you need.

Perhaps write some simple test apps to prove to yourself (and us) you get the desired behaviour before trying to integrate.

Thanks,
Simon