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.
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
--- 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); } }
--- 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
--- 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