updated for mbed 5.4

Fork of Task612-mbedos54 by Stage-1 Students SoCEM

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Thu Mar 30 13:47:29 2017 +0000
Parent:
0:69af4e3595b6
Commit message:
updated for mbed 5.4

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
mbed-rtos.lib Show diff for this revision Revisions of this file
mbed.bld Show diff for this revision Revisions of this file
diff -r 69af4e3595b6 -r fdf9ceb4a107 main.cpp
--- a/main.cpp	Tue Mar 08 11:46:22 2016 +0000
+++ b/main.cpp	Thu Mar 30 13:47:29 2017 +0000
@@ -1,14 +1,13 @@
 #include "mbed.h"
-#include "rtos.h"
 
 #define RED_TOGGLE    1
 #define YELLOW_TOGGLE 2
 #define GREEN_TOGGLE  4
 
 //Function declarations
-void FunctionRed(void const *args);
-void FunctionYellow(void const *args);
-void FunctionGreen(void const *args);
+void FunctionRed();
+void FunctionYellow();
+void FunctionGreen();
 
 //I/O
 DigitalOut onBoardLED(LED1);
@@ -22,7 +21,7 @@
 
 
 //Each of the following 3 functions is listening for a signal
-void FunctionRed(void const *args)
+void FunctionRed()
 {
     while (true) {
         Thread::signal_wait(RED_TOGGLE);  
@@ -30,7 +29,7 @@
     }
 }
 
-void FunctionYellow(void const *args)
+void FunctionYellow()
 {
     while (true) {
         Thread::signal_wait(YELLOW_TOGGLE);
@@ -38,7 +37,7 @@
     }
 }
 
-void FunctionGreen(void const *args)
+void FunctionGreen()
 {
     while (true) {
         Thread::signal_wait(GREEN_TOGGLE);
@@ -52,10 +51,15 @@
     yellowLED = 0;
     greenLED  = 0;
         
-    //Create and run threads
-    Thread t1(FunctionRed);           
-    Thread t2(FunctionYellow);    
-    Thread t3(FunctionGreen);   
+    //Create threads
+    Thread t1;           
+    Thread t2;    
+    Thread t3;   
+    
+    //Start threads
+    t1.start(FunctionRed);           
+    t2.start(FunctionYellow);    
+    t3.start(FunctionGreen);      
     
     //Main loop
     while(1) {
diff -r 69af4e3595b6 -r fdf9ceb4a107 mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Thu Mar 30 13:47:29 2017 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#50b3418e45484ebf442b88cd935a2d5355402d7d
diff -r 69af4e3595b6 -r fdf9ceb4a107 mbed-rtos.lib
--- a/mbed-rtos.lib	Tue Mar 08 11:46:22 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#b4c5542476ba
diff -r 69af4e3595b6 -r fdf9ceb4a107 mbed.bld
--- a/mbed.bld	Tue Mar 08 11:46:22 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3
\ No newline at end of file