This is a sample to make Software Standby using OS.
Revision 4:272e885e36a9, committed 2019-10-08
- Comitter:
- dkato
- Date:
- Tue Oct 08 06:57:01 2019 +0000
- Parent:
- 3:64e8fa1b8787
- Child:
- 5:70870890e359
- Commit message:
- Supports OS sleep
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Oct 08 06:36:44 2019 +0000
+++ b/main.cpp Tue Oct 08 06:57:01 2019 +0000
@@ -5,9 +5,10 @@
Thread * pTestTask = NULL;
static void idle_hook(void) {
- // interim measures
- // "__WFI()" doesn't work after SoftwareStandby.
- // do nothing
+ // Do the following instead of "__WFI()"
+ __SEV();
+ __WFE();
+ __WFE();
}
void SoftwareStandby(void) {
@@ -60,7 +61,7 @@
}
int main() {
- Thread::attach_idle_hook(idle_hook); // interim measures
+ Thread::attach_idle_hook(idle_hook);
pTestTask = new Thread();
pTestTask->start(test_task);
}