summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-12-08 13:05:21 -0800
committerScott Shawcroft <scott@tannewt.org>2020-12-08 13:05:21 -0800
commit0b4bcd9599cc07ff85d6a70297ae86ff3b02cdec (patch)
treeadcb5e0752633af7303caba7c6b6e1835b360906 /main.c
parent40118bcf57f026fd6a58733501c759a9ba87e835 (diff)
Fix build and more comments
Diffstat (limited to 'main.c')
-rwxr-xr-xmain.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/main.c b/main.c
index 9eb478729..5aa9131a0 100755
--- a/main.c
+++ b/main.c
@@ -391,7 +391,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
int64_t connecting_delay_ticks = CIRCUITPY_USB_CONNECTED_SLEEP_DELAY * 1024 - port_get_raw_ticks(NULL);
if (connecting_delay_ticks > 0) {
// Set when we've waited long enough so that we wake up from the
- // sleep_until_interrupt below and loop around to the real deep
+ // port_idle_until_interrupt below and loop around to the real deep
// sleep in the else clause.
port_interrupt_after_ticks(connecting_delay_ticks);
// Deep sleep if we're not connected to a host.
@@ -414,6 +414,11 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
if (!asleep) {
tick_rgb_status_animation(&animation);
} else {
+ // This waits until a pretend deep sleep alarm occurs. They are set
+ // during common_hal_alarm_set_deep_sleep_alarms. On some platforms
+ // it may also return due to another interrupt, that's why we check
+ // for deep sleep alarms above. If it wasn't a deep sleep alarm,
+ // then we'll idle here again.
port_idle_until_interrupt();
}
}