From 54e741030728fcc03d84339abfdc4102c99a06a0 Mon Sep 17 00:00:00 2001 From: Peter Harper Date: Thu, 7 Nov 2024 19:20:06 +0000 Subject: [PATCH] Changes from code review --- sleep/hello_dormant/hello_dormant_aon.c | 4 ++-- sleep/hello_sleep/hello_sleep_alarm.c | 4 +--- sleep/hello_sleep/hello_sleep_aon.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sleep/hello_dormant/hello_dormant_aon.c b/sleep/hello_dormant/hello_dormant_aon.c index 71ec056..481af1b 100644 --- a/sleep/hello_dormant/hello_dormant_aon.c +++ b/sleep/hello_dormant/hello_dormant_aon.c @@ -42,7 +42,7 @@ static void aon_sleep(void) { // Go to sleep for 10 seconds, with RTC running off GP20 // The external clock is the RTC of another pico being fed to GP20 - sleep_goto_aon_dormant_until(&ts, &sleep_callback); + sleep_goto_dormant_until(&ts, &sleep_callback); } int main() { @@ -66,7 +66,7 @@ int main() { sleep_run_from_xosc(); #else printf("Switching to LPSC\n"); - sleep_run_from_lpsc(); + sleep_run_from_lposc(); #endif uart_default_tx_wait_blocking(); diff --git a/sleep/hello_sleep/hello_sleep_alarm.c b/sleep/hello_sleep/hello_sleep_alarm.c index 751c0db..205bf35 100755 --- a/sleep/hello_sleep/hello_sleep_alarm.c +++ b/sleep/hello_sleep/hello_sleep_alarm.c @@ -41,9 +41,7 @@ int main() { printf("Sleeping for 10 seconds\n"); uart_default_tx_wait_blocking(); - int alarm_id = -1; - sleep_goto_sleep_for(10000, &alarm_sleep_callback, &alarm_id); - if (alarm_id >= 0) { + if (sleep_goto_sleep_for(10000, &alarm_sleep_callback)) { // Make sure we don't wake while (!awake) { printf("Should be sleeping\n"); diff --git a/sleep/hello_sleep/hello_sleep_aon.c b/sleep/hello_sleep/hello_sleep_aon.c index 1749ca2..256dc8e 100644 --- a/sleep/hello_sleep/hello_sleep_aon.c +++ b/sleep/hello_sleep/hello_sleep_aon.c @@ -28,7 +28,7 @@ static void aon_sleep(void) { uart_default_tx_wait_blocking(); // Go to sleep - sleep_goto_aon_sleep_until(&ts, &sleep_callback); + sleep_goto_sleep_until(&ts, &sleep_callback); } int main() {