Skip to content

Put system to sleep when going idle #3566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/build_profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ the the profile.

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

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

## Small profile
* Smallest profile and still fast
* Minimal error information
* Hard to follow code flow when using a debugger
* Chip is put to sleep when going idle:
* debugger is likely to drop connection
* 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)
7 changes: 4 additions & 3 deletions rtos/rtos_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
*/

#include "rtos/rtos_idle.h"
#include "platform/sleep.h"

static void default_idle_hook(void)
{
/* Sleep: ideally, we should put the chip to sleep.
Unfortunately, this usually requires disconnecting the interface chip (debugger).
This can be done, but it would break the local file system.
Unfortunately, this usually requires disconnecting the interface chip (debugger).
This can be done, but it would break the local file system.
*/
// sleep();
sleep();
}
static void (*idle_hook_fptr)(void) = &default_idle_hook;

Expand Down