kopia lustrzana https://github.com/raspberrypi/pico-playground
Changes from code review
rodzic
f74bd50af7
commit
54e7410307
|
@ -42,7 +42,7 @@ static void aon_sleep(void) {
|
||||||
|
|
||||||
// Go to sleep for 10 seconds, with RTC running off GP20
|
// Go to sleep for 10 seconds, with RTC running off GP20
|
||||||
// The external clock is the RTC of another pico being fed to 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() {
|
int main() {
|
||||||
|
@ -66,7 +66,7 @@ int main() {
|
||||||
sleep_run_from_xosc();
|
sleep_run_from_xosc();
|
||||||
#else
|
#else
|
||||||
printf("Switching to LPSC\n");
|
printf("Switching to LPSC\n");
|
||||||
sleep_run_from_lpsc();
|
sleep_run_from_lposc();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uart_default_tx_wait_blocking();
|
uart_default_tx_wait_blocking();
|
||||||
|
|
|
@ -41,9 +41,7 @@ int main() {
|
||||||
printf("Sleeping for 10 seconds\n");
|
printf("Sleeping for 10 seconds\n");
|
||||||
uart_default_tx_wait_blocking();
|
uart_default_tx_wait_blocking();
|
||||||
|
|
||||||
int alarm_id = -1;
|
if (sleep_goto_sleep_for(10000, &alarm_sleep_callback)) {
|
||||||
sleep_goto_sleep_for(10000, &alarm_sleep_callback, &alarm_id);
|
|
||||||
if (alarm_id >= 0) {
|
|
||||||
// Make sure we don't wake
|
// Make sure we don't wake
|
||||||
while (!awake) {
|
while (!awake) {
|
||||||
printf("Should be sleeping\n");
|
printf("Should be sleeping\n");
|
||||||
|
|
|
@ -28,7 +28,7 @@ static void aon_sleep(void) {
|
||||||
uart_default_tx_wait_blocking();
|
uart_default_tx_wait_blocking();
|
||||||
|
|
||||||
// Go to sleep
|
// Go to sleep
|
||||||
sleep_goto_aon_sleep_until(&ts, &sleep_callback);
|
sleep_goto_sleep_until(&ts, &sleep_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
Ładowanie…
Reference in New Issue