diff options
author | Daniel Campora <daniel@wipy.io> | 2015-05-01 22:04:26 +0200 |
---|---|---|
committer | Daniel Campora <daniel@wipy.io> | 2015-05-03 11:21:12 +0200 |
commit | 71d482df4719c08436c90cbdb09f169cc00737af (patch) | |
tree | 7f185dcf9f59d81c0f2a37da79dfce609eae435a | |
parent | a9afcb159acacd0d605dd54fc69709650bd336b8 (diff) | |
download | micropython-71d482df4719c08436c90cbdb09f169cc00737af.tar.gz micropython-71d482df4719c08436c90cbdb09f169cc00737af.zip |
cc3200: Clear the pending interrupt flag when disabling RTC callbacks.
-rw-r--r-- | cc3200/mods/pybrtc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cc3200/mods/pybrtc.c b/cc3200/mods/pybrtc.c index 9c42222bc4..95b676d4a3 100644 --- a/cc3200/mods/pybrtc.c +++ b/cc3200/mods/pybrtc.c @@ -111,11 +111,13 @@ STATIC void pyb_rtc_callback_enable (mp_obj_t self_in) { STATIC void pyb_rtc_callback_disable (mp_obj_t self_in) { // check the wake from param if (pybrtc_data.prwmode & PYB_PWR_MODE_ACTIVE) { - // enable the slow clock interrupt + // disable the slow clock interrupt MAP_PRCMIntDisable(PRCM_INT_SLOW_CLK_CTR); } // disable wake from ldps and hibernate pybsleep_configure_timer_wakeup (PYB_PWR_MODE_ACTIVE); + // read the interrupt status to clear any pending interrupt + (void)MAP_PRCMIntStatus(); } /******************************************************************************/ @@ -217,7 +219,7 @@ STATIC mp_obj_t pyb_rtc_callback (mp_uint_t n_args, const mp_obj_t *pos_args, mp // set the lpds callback pybsleep_set_timer_lpds_callback(_callback); - // the interrupt priority is ignored since is already set to to highest level by the sleep module + // the interrupt priority is ignored since it's already set to to highest level by the sleep module // to make sure that the wakeup callbacks are always called first when resuming from sleep // enable the interrupt (the object is not relevant here, the function already knows it) |