We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5a41d8 commit 39f31c3Copy full SHA for 39f31c3
rtos/rtos_idle.c
@@ -22,14 +22,16 @@
22
23
#include "rtos/rtos_idle.h"
24
#include "platform/mbed_sleep.h"
25
+#include "mbed_critical.h"
26
27
static void default_idle_hook(void)
28
{
- /* Sleep: ideally, we should put the chip to sleep.
29
- Unfortunately, this usually requires disconnecting the interface chip (debugger).
30
- This can be done, but it would break the local file system.
31
- */
+ // critical section to complete sleep with locked deepsleep
+ core_util_critical_section_enter();
+ sleep_manager_lock_deep_sleep();
32
sleep();
33
+ sleep_manager_unlock_deep_sleep();
34
+ core_util_critical_section_exit();
35
}
36
static void (*idle_hook_fptr)(void) = &default_idle_hook;
37
0 commit comments