Skip to content

Commit 1961803

Browse files
committed
codal_app/microbithal: Make microbit_hal_power_deep_sleep return bool.
Signed-off-by: Damien George <damien@micropython.org>
1 parent c5ab627 commit 1961803

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/codal_app/microbithal.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@ void microbit_hal_power_off(void) {
127127
uBit.power.off();
128128
}
129129

130-
void microbit_hal_power_deep_sleep(bool wake_on_ms, uint32_t ms) {
130+
bool microbit_hal_power_deep_sleep(bool wake_on_ms, uint32_t ms) {
131131
if (wake_on_ms) {
132-
uBit.power.deepSleep(ms, true);
132+
return uBit.power.deepSleep(ms, true);
133133
} else {
134134
uBit.power.deepSleep();
135+
return true; // Sleep was interrupted by a wake event.
135136
}
136137
}
137138

src/codal_app/microbithal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void microbit_hal_power_clear_wake_sources(void);
112112
void microbit_hal_power_wake_on_button(int button, bool wake_on_active);
113113
void microbit_hal_power_wake_on_pin(int pin, bool wake_on_active);
114114
void microbit_hal_power_off(void);
115-
void microbit_hal_power_deep_sleep(bool wake_on_ms, uint32_t ms);
115+
bool microbit_hal_power_deep_sleep(bool wake_on_ms, uint32_t ms);
116116

117117
void microbit_hal_pin_set_pull(int pin, int pull);
118118
int microbit_hal_pin_get_pull(int pin);

0 commit comments

Comments
 (0)