Skip to content

Commit 39ad07f

Browse files
committed
Put system to sleep in non-debugging builds
1 parent 9e24117 commit 39ad07f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

rtos/rtos_idle.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,19 @@
2121
*/
2222

2323
#include "rtos/rtos_idle.h"
24+
#include "sleep_api.h"
2425

2526
static void default_idle_hook(void)
2627
{
2728
/* Sleep: ideally, we should put the chip to sleep.
28-
Unfortunately, this usually requires disconnecting the interface chip (debugger).
29-
This can be done, but it would break the local file system.
29+
Unfortunately, this usually requires disconnecting the interface chip (debugger).
30+
This can be done, but it would break the local file system.
3031
*/
31-
// sleep();
32+
#ifdef NDEBUG
33+
#if DEVICE_SLEEP
34+
sleep();
35+
#endif // DEVICE_SLEEP
36+
#endif // NDEBUG
3237
}
3338
static void (*idle_hook_fptr)(void) = &default_idle_hook;
3439

0 commit comments

Comments
 (0)