Simple LED blinking RTOS application with 3 threads
Fork of rtos_basic by
Revision 7:84b7291a746d, committed 2016-01-28
- Comitter:
- icserny
- Date:
- Thu Jan 28 15:24:41 2016 +0000
- Parent:
- 6:209f4db62daf
- Commit message:
- Firts version
Changed in this revision
diff -r 209f4db62daf -r 84b7291a746d main.cpp --- a/main.cpp Tue Jun 04 16:01:32 2013 +0100 +++ b/main.cpp Thu Jan 28 15:24:41 2016 +0000 @@ -1,21 +1,38 @@ +/** 09_rtos_basic + * RTOS LED blinking example running 3 threads + * (main and two additional threads) + * + * Hardware requirement: + * - FRDM-KL25Z board + */ + #include "mbed.h" #include "rtos.h" DigitalOut led1(LED1); DigitalOut led2(LED2); +DigitalOut led3(LED3); void led2_thread(void const *args) { while (true) { led2 = !led2; - Thread::wait(1000); + Thread::wait(2000); + } +} + +void led3_thread(void const *args) { + while (true) { + led3 = !led3; + Thread::wait(4000); } } int main() { - Thread thread(led2_thread); - + Thread thread2(led2_thread); + Thread thread3(led3_thread); + while (true) { led1 = !led1; - Thread::wait(500); + Thread::wait(1000); } }
diff -r 209f4db62daf -r 84b7291a746d mbed-rtos.lib --- a/mbed-rtos.lib Tue Jun 04 16:01:32 2013 +0100 +++ b/mbed-rtos.lib Thu Jan 28 15:24:41 2016 +0000 @@ -1,1 +1,1 @@ -https://mbed.org/users/mbed_official/code/mbed-rtos/ \ No newline at end of file +https://mbed.org/users/mbed_official/code/mbed-rtos/#4e0e79c9b976
diff -r 209f4db62daf -r 84b7291a746d mbed.bld --- a/mbed.bld Tue Jun 04 16:01:32 2013 +0100 +++ b/mbed.bld Thu Jan 28 15:24:41 2016 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/ \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/7d30d6019079 \ No newline at end of file