From 281c180722fecc06c73b0e0ffeb7f7541c51bee3 Mon Sep 17 00:00:00 2001 From: 0xc0170 Date: Fri, 20 Nov 2015 08:12:29 +0000 Subject: [PATCH] InterrupIn - attach with null clears the function pointer --- libraries/mbed/common/InterruptIn.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/mbed/common/InterruptIn.cpp b/libraries/mbed/common/InterruptIn.cpp index 8692124c14..92f70f2a5e 100644 --- a/libraries/mbed/common/InterruptIn.cpp +++ b/libraries/mbed/common/InterruptIn.cpp @@ -44,6 +44,7 @@ void InterruptIn::rise(void (*fptr)(void)) { _rise.attach(fptr); gpio_irq_set(&gpio_irq, IRQ_RISE, 1); } else { + _rise.attach(NULL); gpio_irq_set(&gpio_irq, IRQ_RISE, 0); } } @@ -53,6 +54,7 @@ void InterruptIn::fall(void (*fptr)(void)) { _fall.attach(fptr); gpio_irq_set(&gpio_irq, IRQ_FALL, 1); } else { + _fall.attach(NULL); gpio_irq_set(&gpio_irq, IRQ_FALL, 0); } }