Thread example using mbed 5.7

Files at this revision

API Documentation at this revision

Comitter:
WilliamMarshQMUL
Date:
Thu Jan 23 13:05:26 2020 +0000
Parent:
1:bbbe0fae16f3
Commit message:
Change wait (depreciated) to sleep_for

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
diff -r bbbe0fae16f3 -r b13b343de0f5 main.cpp
--- a/main.cpp	Wed Jan 09 22:58:08 2019 +0000
+++ b/main.cpp	Thu Jan 23 13:05:26 2020 +0000
@@ -1,5 +1,5 @@
-// Simple Example fo use of Threads on mbed OS 5
-//   Only need to include mbed.h
+// Simple Example of use of Threads on mbed OS 5
+//   Depreciated use of wait replaced by 'sleep_for'
 
 #include "mbed.h"
 
@@ -12,7 +12,8 @@
 // This method is run in the second thread
 void ledB_thread() {
     while (true) {
-        wait(0.25);
+        //wait(0.25); -- depreciated call
+        ThisThread::sleep_for(250) ;
         ledB = !ledB;
     }
 }
@@ -26,7 +27,8 @@
     thread.start(callback(ledB_thread));
 
     while (true) {
-        wait(0.4);
+        // wait(0.4); - depreciated call 
+        ThisThread::sleep_for(400) ;
         ledA = !ledA;
     }
 }
diff -r bbbe0fae16f3 -r b13b343de0f5 mbed-os.lib
--- a/mbed-os.lib	Wed Jan 09 22:58:08 2019 +0000
+++ b/mbed-os.lib	Thu Jan 23 13:05:26 2020 +0000
@@ -1,1 +1,1 @@
-https://github.com/ARMmbed/mbed-os/#c966348d3f9ca80843be7cdc9b748f06ea73ced0
+https://github.com/ARMmbed/mbed-os/#430e64fce8098fd5e54f6de32f3f029f35dc705f