Skip to content

Commit 4c98293

Browse files
committed
Sleep: add time requirements for sleep
Sleep - within 10us Deepsleep - within 10ms Note about mbed boards with interface, moved to lpc176x, as they are target related, should be documented in the target documentation. The tests will come as separate PR, to conform to this updates to sleep API.
1 parent af9e073 commit 4c98293

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

hal/sleep_api.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,27 @@ extern "C" {
2929

3030
/** Send the microcontroller to sleep
3131
*
32-
* The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the
32+
* The processor is setup ready for sleep, and sent to sleep. In this mode, the
3333
* system clock to the core is stopped until a reset or an interrupt occurs. This eliminates
3434
* dynamic power used by the processor, memory systems and buses. The processor, peripheral and
3535
* memory state are maintained, and the peripherals continue to work and can generate interrupts.
3636
*
3737
* The processor can be woken up by any internal peripheral interrupt or external pin interrupt.
3838
*
39-
* @note
40-
* The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
41-
* Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
42-
* able to access the LocalFileSystem
39+
* The wake-up time shall be less than 10 us.
40+
*
4341
*/
4442
void hal_sleep(void);
4543

4644
/** Send the microcontroller to deep sleep
4745
*
4846
* This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode
49-
* has the same sleep features as sleep plus it powers down peripherals and clocks. All state
50-
* is still maintained.
47+
* has the same sleep features as sleep plus it powers down peripherals and high frequency clocks.
48+
* All state is still maintained.
5149
*
52-
* The processor can only be woken up by an external interrupt on a pin or a watchdog timer.
50+
* The processor can only be woken up by low power ticker, RTC, an external interrupt on a pin or a watchdog timer.
5351
*
54-
* @note
55-
* The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
56-
* Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
57-
* able to access the LocalFileSystem
52+
* The wake-up time shall be less than 10 ms.
5853
*/
5954
void hal_deepsleep(void);
6055

platform/mbed_sleep.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,7 @@ void sleep_manager_sleep_auto(void);
123123
*
124124
* The processor can be woken up by any internal peripheral interrupt or external pin interrupt.
125125
*
126-
* @note
127-
* The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
128-
* Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
129-
* able to access the LocalFileSystem
126+
* The wake-up time shall be less than 10 us.
130127
*/
131128
__INLINE static void sleep(void)
132129
{
@@ -149,12 +146,9 @@ __INLINE static void sleep(void)
149146
* has the same sleep features as sleep plus it powers down peripherals and clocks. All state
150147
* is still maintained.
151148
*
152-
* The processor can only be woken up by an external interrupt on a pin or a watchdog timer.
149+
* The processor can only be woken up by low power ticker, RTC, an external interrupt on a pin or a watchdog timer.
153150
*
154-
* @note
155-
* The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
156-
* Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
157-
* able to access the LocalFileSystem
151+
* The wake-up time shall be less than 10 ms.
158152
*/
159153

160154
MBED_DEPRECATED_SINCE("mbed-os-5.6", "One entry point for an application, use sleep()")

targets/TARGET_NXP/TARGET_LPC176X/sleep.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
#include "cmsis.h"
1818
#include "mbed_interface.h"
1919

20+
/*
21+
* @note
22+
* The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored.
23+
* Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be
24+
* able to access the LocalFileSystem
25+
*/
26+
2027
void hal_sleep(void) {
2128

2229
#if (DEVICE_SEMIHOST == 1)

0 commit comments

Comments
 (0)