Updated for ELEC350
Fork of Task612-mbedos54 by
Revision 1:fdf9ceb4a107, committed 2017-03-30
- Comitter:
- noutram
- Date:
- Thu Mar 30 13:47:29 2017 +0000
- Parent:
- 0:69af4e3595b6
- Child:
- 2:410eacc3006a
- Commit message:
- updated for mbed 5.4
Changed in this revision
--- 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) {
--- /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
--- 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
--- 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
