diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/zinger/board.h | 1 | ||||
-rw-r--r-- | board/zinger/runtime.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/board/zinger/board.h b/board/zinger/board.h index df642890a7..89a44f370f 100644 --- a/board/zinger/board.h +++ b/board/zinger/board.h @@ -32,6 +32,7 @@ #undef CONFIG_COMMON_PANIC_OUTPUT #undef CONFIG_COMMON_RUNTIME #undef CONFIG_COMMON_TIMER +#define CONFIG_LOW_POWER_IDLE #undef CONFIG_CONSOLE_CMDHELP #undef CONFIG_DEBUG_ASSERT #undef CONFIG_DEBUG_EXCEPTIONS diff --git a/board/zinger/runtime.c b/board/zinger/runtime.c index d07139dbaf..4dda979d46 100644 --- a/board/zinger/runtime.c +++ b/board/zinger/runtime.c @@ -9,11 +9,13 @@ #include "cpu.h" #include "debug.h" #include "registers.h" +#include "system.h" #include "task.h" #include "timer.h" #include "util.h" volatile uint32_t last_event; +uint32_t sleep_mask; timestamp_t get_time(void) { @@ -139,7 +141,8 @@ uint32_t task_wait_event(int timeout_us) if (timeout_us < 0) { asm volatile ("wfi"); } else if (timeout_us <= - (STOP_MODE_LATENCY + SET_RTC_MATCH_DELAY)) { + (STOP_MODE_LATENCY + SET_RTC_MATCH_DELAY) || + !DEEP_SLEEP_ALLOWED) { STM32_TIM32_CCR1(2) = STM32_TIM32_CNT(2) + timeout_us; STM32_TIM_SR(2) = 0; /* clear match flag */ STM32_TIM_DIER(2) = 2; /* match interrupt */ |