Skip to content

Commit 005a7f4

Browse files
committed
cc3200: Fix extint_enable behaviour when the callback is updated.
1 parent 181fe50 commit 005a7f4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cc3200/mods/pybpin.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,15 @@ STATIC void pin_extint_enable (mp_obj_t self_in) {
331331
MAP_PRCMHibernateWakeupSourceDisable(hib_pin);
332332
}
333333
}
334-
// if idx is invalid, the the pin supports active_idle interrupts for sure
334+
// if idx is invalid, the the pin supports active interrupts for sure
335335
if (idx >= PYBPIN_NUM_WAKE_PINS || pybpin_wake_pin[idx].active) {
336336
MAP_GPIOIntClear(self->port, self->bit);
337337
MAP_GPIOIntEnable(self->port, self->bit);
338338
}
339+
// in case in was enabled before
340+
else if (idx < PYBPIN_NUM_WAKE_PINS && !pybpin_wake_pin[idx].active) {
341+
MAP_GPIOIntDisable(self->port, self->bit);
342+
}
339343
}
340344

341345
STATIC void pin_extint_disable (mp_obj_t self_in) {

0 commit comments

Comments
 (0)