Comparing a wait with yield vs a polling-busy-wait
Fork of Task621-mbedos54 by
Revision 8:2deeed44c6c3, committed 2017-04-03
- Comitter:
- noutram
- Date:
- Mon Apr 03 11:45:25 2017 +0000
- Parent:
- 7:cd015e83995a
- Commit message:
- updated for mbed os 54
Changed in this revision
diff -r cd015e83995a -r 2deeed44c6c3 main.cpp --- a/main.cpp Mon Mar 14 16:32:56 2016 +0000 +++ b/main.cpp Mon Apr 03 11:45:25 2017 +0000 @@ -23,7 +23,7 @@ //Thread ID for the Main function (CMSIS API) osThreadId tidMain; -void thread1( const void* arg ) +void thread1() { pc.printf("Entering thread 1\n"); while (true) { @@ -35,7 +35,7 @@ } //This thread has higher priority -void thread2( const void* arg ) +void thread2() { pc.printf("Entering thread 2\n"); while (true) { @@ -64,12 +64,14 @@ //Main thread ID tidMain = Thread::gettid(); - Thread t1(thread1, NULL, osPriorityNormal); + Thread t1(osPriorityNormal); + t1.start(thread1); // 2) Select the Thread Priority //Thread t2(thread2, NULL, osPriorityNormal); - Thread t2(thread2, NULL, osPriorityAboveNormal); + Thread t2(osPriorityAboveNormal); + t2.start(thread2); pc.printf("Main Thread\n"); while (true) {
diff -r cd015e83995a -r 2deeed44c6c3 mbed-os.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Mon Apr 03 11:45:25 2017 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#50b3418e45484ebf442b88cd935a2d5355402d7d
diff -r cd015e83995a -r 2deeed44c6c3 mbed-rtos.lib --- a/mbed-rtos.lib Mon Mar 14 16:32:56 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 cd015e83995a -r 2deeed44c6c3 mbed.bld --- a/mbed.bld Mon Mar 14 16:32:56 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