Skip to content

Commit fcdb043

Browse files
committed
Sleep: add deepsleep locks for !DEVICE_SLEEP
If a target do not support sleep (no DEVICE_SLEEP defined), we provide empty deep sleep locking.
1 parent cb4e9b3 commit fcdb043

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

hal/mbed_sleep_manager.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,25 @@ void sleep_manager_sleep_auto(void)
6868
core_util_critical_section_exit();
6969
}
7070

71+
#else
72+
73+
// locking is valid only if DEVICE_SLEEP is defined
74+
// we provide empty implementation
75+
76+
void sleep_manager_lock_deep_sleep(void)
77+
{
78+
79+
}
80+
81+
void sleep_manager_unlock_deep_sleep(void)
82+
{
83+
84+
}
85+
86+
bool sleep_manager_can_deep_sleep(void)
87+
{
88+
// no sleep implemented
89+
return false;
90+
}
91+
7192
#endif

0 commit comments

Comments
 (0)