diff options
author | danicampora <danicampora@gmail.com> | 2015-03-17 13:22:01 +0100 |
---|---|---|
committer | danicampora <danicampora@gmail.com> | 2015-03-17 13:26:09 +0100 |
commit | 005a7f4190584edcd56b65a7f598a610e386fa1c (patch) | |
tree | 01526e62b99718cb8a8b4600485d1c30307dd80c /cc3200/mods/pybpin.c | |
parent | 181fe5016c6b9c0fbe0eae10a03ffa3c3c480338 (diff) | |
download | micropython-005a7f4190584edcd56b65a7f598a610e386fa1c.tar.gz micropython-005a7f4190584edcd56b65a7f598a610e386fa1c.zip |
cc3200: Fix extint_enable behaviour when the callback is updated.
Diffstat (limited to 'cc3200/mods/pybpin.c')
-rw-r--r-- | cc3200/mods/pybpin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cc3200/mods/pybpin.c b/cc3200/mods/pybpin.c index 71799643c5..04825d52b8 100644 --- a/cc3200/mods/pybpin.c +++ b/cc3200/mods/pybpin.c @@ -331,11 +331,15 @@ STATIC void pin_extint_enable (mp_obj_t self_in) { MAP_PRCMHibernateWakeupSourceDisable(hib_pin); } } - // if idx is invalid, the the pin supports active_idle interrupts for sure + // if idx is invalid, the the pin supports active interrupts for sure if (idx >= PYBPIN_NUM_WAKE_PINS || pybpin_wake_pin[idx].active) { MAP_GPIOIntClear(self->port, self->bit); MAP_GPIOIntEnable(self->port, self->bit); } + // in case in was enabled before + else if (idx < PYBPIN_NUM_WAKE_PINS && !pybpin_wake_pin[idx].active) { + MAP_GPIOIntDisable(self->port, self->bit); + } } STATIC void pin_extint_disable (mp_obj_t self_in) { |