Skip to content

Commit e852d7f

Browse files
authored
Merge pull request #3566 from betzw/betzw_wb_sleep
Put system to sleep when going idle
2 parents 65956d1 + 2a585ea commit e852d7f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/build_profiles.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ the the profile.
77

88
## Default profile
99
* Small and fast code
10-
* Full error information - e.x. asserts have filename and line number
10+
* Full error information - e.g. asserts have filename and line number
1111
* Hard to follow code flow when using a debugger
1212

1313
## Debug profile
1414
* Easy to step through code with a debugger
15-
* Full error information - e.x. asserts have filename and line number
15+
* Full error information - e.g. asserts have filename and line number
1616
* Largest and slowest profile
1717

1818
## Small profile
1919
* Smallest profile and still fast
2020
* Minimal error information
21-
* Hard to follow code flow when using a debugger
21+
* Chip is put to sleep when going idle:
22+
* debugger is likely to drop connection
23+
* breaks the [local file system](https://developer.mbed.org/handbook/LocalFileSystem) on the [mbed interface](https://developer.mbed.org/handbook/mbed-interface) (only for few NXP boards & if used)

rtos/rtos_idle.c

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

2323
#include "rtos/rtos_idle.h"
24+
#include "platform/sleep.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+
sleep();
3233
}
3334
static void (*idle_hook_fptr)(void) = &default_idle_hook;
3435

0 commit comments

Comments
 (0)