Merge pull request #3566 from betzw/betzw_wb_sleep

Put system to sleep when going idle
pull/3692/head
Sam Grove 2017-02-07 10:30:33 -06:00 committed by GitHub
commit e852d7fecf
2 changed files with 9 additions and 6 deletions

View File

@ -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)

View File

@ -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;