Commit c1c23e2f authored by danicampora's avatar danicampora
Browse files

cc3200: Remove superfluous code in pybsleep.

parent cd9bc14c
......@@ -113,7 +113,7 @@ uint mpcallback_translate_priority (uint priority) {
void mpcallback_handler (mp_obj_t self_in) {
mpcallback_obj_t *self = self_in;
if (self->handler != mp_const_none) {
if (self && self->handler != mp_const_none) {
// disable interrupts to avoid nesting
uint primsk = disable_irq();
// when executing code within a handler we must lock the GC to prevent
......
......@@ -121,7 +121,7 @@ typedef struct {
******************************************************************************/
STATIC const mp_obj_type_t pybsleep_type;
STATIC nvic_reg_store_t *nvic_reg_store;
STATIC pybsleep_wake_cb_t pybsleep_wake_cb;
STATIC pybsleep_wake_cb_t pybsleep_wake_cb = {NULL, NULL, NULL, 0};
volatile arm_cm4_core_regs_t vault_arm_registers;
STATIC pybsleep_reset_cause_t pybsleep_reset_cause = PYB_SLP_PWRON_RESET;
......@@ -397,30 +397,22 @@ STATIC void PRCMInterruptHandler (void) {
// reading the interrupt status automatically clears the interrupt
if (PRCM_INT_SLOW_CLK_CTR == MAP_PRCMIntStatus()) {
// this interrupt is triggered during active mode
if (pybsleep_wake_cb.timer_lpds_wake_cb) {
mpcallback_handler(pybsleep_wake_cb.timer_lpds_wake_cb);
}
mpcallback_handler(pybsleep_wake_cb.timer_lpds_wake_cb);
}
else {
// interrupt has been triggered while waking up from LPDS
switch (MAP_PRCMLPDSWakeupCauseGet()) {
case PRCM_LPDS_HOST_IRQ:
if (pybsleep_wake_cb.wlan_lpds_wake_cb) {
mpcallback_handler(pybsleep_wake_cb.wlan_lpds_wake_cb);
}
mpcallback_handler(pybsleep_wake_cb.wlan_lpds_wake_cb);
break;
case PRCM_LPDS_GPIO:
if (pybsleep_wake_cb.gpio_lpds_wake_cb) {
mpcallback_handler(pybsleep_wake_cb.gpio_lpds_wake_cb);
}
mpcallback_handler(pybsleep_wake_cb.gpio_lpds_wake_cb);
break;
case PRCM_LPDS_TIMER:
// disable timer was wake-up source
// disable the timer as a wake-up source
pybsleep_wake_cb.timer_wake_pwrmode &= ~PYB_PWR_MODE_LPDS;
MAP_PRCMLPDSWakeupSourceDisable(PRCM_LPDS_TIMER);
if (pybsleep_wake_cb.timer_lpds_wake_cb) {
mpcallback_handler(pybsleep_wake_cb.timer_lpds_wake_cb);
}
mpcallback_handler(pybsleep_wake_cb.timer_lpds_wake_cb);
break;
default:
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment