diff --git a/main.c b/main.c index d5f46f2..e0f7b54 100644 --- a/main.c +++ b/main.c @@ -1,5 +1,6 @@ #include "pico/sleep.h" #include "pico/stdlib.h" +#include "pico/runtime_init.h" #include #include #include @@ -49,7 +50,10 @@ void recover_from_sleep(uint scb_orig, uint clock0_orig, uint clock1_orig){ clocks_hw->sleep_en1 = clock1_orig; //reset clocks - clocks_init(); +<<<<<<< Updated upstream +======= + runtime_init_clocks(); +>>>>>>> Stashed changes stdio_init_all(); return; @@ -110,6 +114,7 @@ int main() { while (true) { gpio_put(LED_PIN, 1); sleep_ms(2000); + // Current draw on a Pico is ~24.8 mA @ 3.3V awake = false; printf("Sleep from xosc\n"); @@ -120,6 +125,8 @@ int main() { rtc_set_datetime(&t); //sleep here, in this case for 1 min rtc_sleep(46,0); + // During this one minute sleep, the current draw is 4.13 mA @ 3.3V. + // With the LED off, it would be only 1.47 mA! //will return here and awake should be true while (!awake) { @@ -143,5 +150,6 @@ int main() { printf("Sleep from sleep_ms\n"); uart_default_tx_wait_blocking(); sleep_ms(2000); + // During this 2 second not-so-deep sleep w/ the the LED off, the current consumption is 22.4 mA @ 3.3V } }