Solution to 6.2.2 updated for mbed os 5.4

Fork of Task622Solution-mbedos54 by Stage-1 Students SoCEM

Revision:
9:c46e831f8e4a
Parent:
8:b28defacd894
--- a/main.cpp	Mon Mar 14 19:48:38 2016 +0000
+++ b/main.cpp	Mon Apr 03 14:02:26 2017 +0000
@@ -6,8 +6,8 @@
 
 #define SWITCH1_RELEASE 1
 
-void thread1( const void*  );
-void thread2( const void*  );
+void thread1();
+void thread2();
 void switchISR();
 
 //Digital outputs
@@ -40,7 +40,7 @@
 }
 
 //High priority thread
-void thread1( const void* arg ) 
+void thread1() 
 {
     redLED = 1;
     while (true) {
@@ -54,7 +54,7 @@
 }
 
 //This thread has normal priority
-void thread2( const void* arg ) 
+void thread2() 
 {
     greenLED = 1; 
     while (true) {
@@ -72,9 +72,12 @@
     greenLED  = 0;
            
     //Threads
-    t1 = new Thread(&thread1, NULL, osPriorityRealtime);
-    t2 = new Thread(&thread2, NULL, osPriorityNormal);              
-              
+    t1 = new Thread(osPriorityRealtime);
+    t2 = new Thread(osPriorityNormal);              
+       
+    t1->start(thread1);
+    t2->start(thread2);
+           
     // Thread IDs
     tidMain = Thread::gettid();  
     tid1    = t1->gettid();