You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a RP2040 and I am trying to go dormant. When using sleep_run_from_xosc it complains that hardware_alarm_callback_t is not defined in this scope. Adding #include "hardware/timer.h" to pico-extras/src/rp2_common/pico_sleep/include/pico/sleep.h will fix it but I am pretty sure some kind of test would have caught that the whole thing doesn't compile. Anything I am doing wrong here?
Thanks
The text was updated successfully, but these errors were encountered:
ping @peterharperuk as he was the last person to edit the pico_sleep code 😴 (in #79 ).
I am pretty sure some kind of test would have caught that the whole thing doesn't compile.
The code in pico-extras (and pico-playground) is unsupported / experimental, and so it gets much less testing than the code in pico-sdk and pico-examples.
Yes, good catch. The test code builds fine but it has #include "pico/stdlib.h" before #include "pico/sleep.h" which includes "hardware/timer.h" for us. As a workaround just include it before including sleep.h and I'll push a fix.
peterharperuk
added a commit
to peterharperuk/pico-extras
that referenced
this issue
Mar 5, 2025
If you include sleep.h first you get a compile error as
hardware_alarm_callback_t is not defined. Fix this by including the
appropriate header.
Fixesraspberrypi#89
I am pretty new to C so this might be stupid.
I am using a RP2040 and I am trying to go dormant. When using
sleep_run_from_xosc
it complains thathardware_alarm_callback_t
is not defined in this scope. Adding#include "hardware/timer.h"
topico-extras/src/rp2_common/pico_sleep/include/pico/sleep.h
will fix it but I am pretty sure some kind of test would have caught that the whole thing doesn't compile. Anything I am doing wrong here?Thanks
The text was updated successfully, but these errors were encountered: