This is a sample to make sleep using OS.

Files at this revision

API Documentation at this revision

Comitter:
dkato
Date:
Fri Nov 18 10:39:33 2016 +0000
Parent:
1:8ba32924482c
Commit message:
update

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 8ba32924482c -r 22bc64c6ee90 main.cpp
--- a/main.cpp	Fri Nov 18 09:42:04 2016 +0000
+++ b/main.cpp	Fri Nov 18 10:39:33 2016 +0000
@@ -4,12 +4,9 @@
 InterruptIn button(USER_BUTTON0);
 DigitalOut led1(LED1);
 Thread * pTestTask = NULL;
-static int debug_cnt = 0;  // for debug
 
 static void idle_hook(void) {
-    __SEV();
-    __WFE();
-    __WFE();
+    __WFI();  // Do not set when using SoftwareStandby.
 }
 
 static void interrupt_button(void) {