This is a sample to make Software Standby using OS.

Revision:
4:272e885e36a9
Parent:
3:64e8fa1b8787
Child:
5:70870890e359
--- 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);
 }