mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #1443 from 0xc0170/fix_interruptin_clear
InterrupIn - attach with null clears the function pointerpull/2453/head^2
commit
d2dde861b4
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue