Enable and Disable Interrupt (Rise or Fall on DIO pin)

23 Nov 2012

My application is watching for a falling edge from a pulse input at about 10kHz. It doesn't care about the pulses most of the time. However, there is a routine running every 10ms (100 Hz) that needs to watch for the falling edge.

SO, I want to enable an InterruptIn ONLY when my 10ms subroutine runs. After a falling edge triggers an interrupt, it can disable the interrupt until the next 10ms call.

How do I enable/disable an interrupt, so it only interrupts when I want it to?

24 Nov 2012

Attaching an interrupt is done the normal way shown in the handbook. Detaching interrupts generally can be done by attaching a NULL pointer.

24 Nov 2012

OK, thanks. I'll give that a try. I'm finding that doing some very simple things can be very difficult. The mbed compiler makes difficult things easy but easy things difficult.