Skip to content

Commit 71d482d

Browse files
author
Daniel Campora
committed
cc3200: Clear the pending interrupt flag when disabling RTC callbacks.
1 parent a9afcb1 commit 71d482d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cc3200/mods/pybrtc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,13 @@ STATIC void pyb_rtc_callback_enable (mp_obj_t self_in) {
111111
STATIC void pyb_rtc_callback_disable (mp_obj_t self_in) {
112112
// check the wake from param
113113
if (pybrtc_data.prwmode & PYB_PWR_MODE_ACTIVE) {
114-
// enable the slow clock interrupt
114+
// disable the slow clock interrupt
115115
MAP_PRCMIntDisable(PRCM_INT_SLOW_CLK_CTR);
116116
}
117117
// disable wake from ldps and hibernate
118118
pybsleep_configure_timer_wakeup (PYB_PWR_MODE_ACTIVE);
119+
// read the interrupt status to clear any pending interrupt
120+
(void)MAP_PRCMIntStatus();
119121
}
120122

121123
/******************************************************************************/
@@ -217,7 +219,7 @@ STATIC mp_obj_t pyb_rtc_callback (mp_uint_t n_args, const mp_obj_t *pos_args, mp
217219
// set the lpds callback
218220
pybsleep_set_timer_lpds_callback(_callback);
219221

220-
// the interrupt priority is ignored since is already set to to highest level by the sleep module
222+
// the interrupt priority is ignored since it's already set to to highest level by the sleep module
221223
// to make sure that the wakeup callbacks are always called first when resuming from sleep
222224

223225
// enable the interrupt (the object is not relevant here, the function already knows it)

0 commit comments

Comments
 (0)