Skip to content

Commit 543660f

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 b75c51a commit 543660f

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
@@ -78,4 +78,25 @@ void sleep_manager_sleep_auto(void)
7878
core_util_critical_section_exit();
7979
}
8080

81+
#else
82+
83+
// locking is valid only if DEVICE_SLEEP is defined
84+
// we provide empty implementation
85+
86+
void sleep_manager_lock_deep_sleep(void)
87+
{
88+
89+
}
90+
91+
void sleep_manager_unlock_deep_sleep(void)
92+
{
93+
94+
}
95+
96+
bool sleep_manager_can_deep_sleep(void)
97+
{
98+
// no sleep implemented
99+
return false;
100+
}
101+
81102
#endif

0 commit comments

Comments
 (0)