Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 2:91200df5ccd6, committed 2017-03-30
- Comitter:
- noutram
- Date:
- Thu Mar 30 14:24:24 2017 +0000
- Parent:
- 1:4fb27aea76b2
- Commit message:
- updated for mbed 5.4
Changed in this revision
diff -r 4fb27aea76b2 -r 91200df5ccd6 main.cpp --- a/main.cpp Tue Mar 08 12:26:28 2016 +0000 +++ b/main.cpp Thu Mar 30 14:24:24 2017 +0000 @@ -1,13 +1,12 @@ #include "mbed.h" -#include "rtos.h" #define RED_DONE 1 #define YELLOW_DONE 2 //Function declarations -void countUP(void const *args); -void countDOWN(void const *args); +void countUP(); +void countDOWN(); //Digital outputs DigitalOut onBoardLED(LED1); @@ -30,7 +29,7 @@ volatile long long count = 0; //Threads -void countUP(void const *args) +void countUP() { redLED = 1; @@ -58,7 +57,7 @@ osSignalSet(tidMain, RED_DONE); //Signal main thread we are done } -void countDOWN(void const *args) +void countDOWN() { yellowLED = 1; @@ -89,6 +88,9 @@ //Main thread int main() { + Thread t1; + Thread t2; + redLED = 0; yellowLED = 0; greenLED = 1; @@ -102,12 +104,12 @@ //Press the switch to run concurrently if (onBoardSwitch == 1) { printf("Running sequntially\n"); - countUP(NULL); - countDOWN(NULL); + countUP(); + countDOWN(); } else { printf("Running concurrently\n"); - Thread t1(countUP); - Thread t2(countDOWN); + t1.start(countUP); + t2.start(countDOWN); //Wait for the ALL_ON signal Thread::signal_wait(RED_DONE,osWaitForever);
diff -r 4fb27aea76b2 -r 91200df5ccd6 mbed-os.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Thu Mar 30 14:24:24 2017 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#50b3418e45484ebf442b88cd935a2d5355402d7d
diff -r 4fb27aea76b2 -r 91200df5ccd6 mbed-rtos.lib --- a/mbed-rtos.lib Tue Mar 08 12:26:28 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 4fb27aea76b2 -r 91200df5ccd6 mbed.bld --- a/mbed.bld Tue Mar 08 12:26:28 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