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:c3d06470b694, committed 2014-10-27
- Comitter:
- shiyilei
- Date:
- Mon Oct 27 04:35:25 2014 +0000
- Parent:
- 6:209f4db62daf
- Commit message:
- use the thread the control 3 leds
Changed in this revision
--- a/main.cpp Tue Jun 04 16:01:32 2013 +0100
+++ b/main.cpp Mon Oct 27 04:35:25 2014 +0000
@@ -1,21 +1,55 @@
+/*********************************************
+*file name : the first thread app
+*Creator :JacobShi
+*Time:2014/10/27
+* Description :use the thread the control 3 leds
+ ******************************************/
#include "mbed.h"
#include "rtos.h"
-
DigitalOut led1(LED1);
DigitalOut led2(LED2);
-
-void led2_thread(void const *args) {
- while (true) {
- led2 = !led2;
- Thread::wait(1000);
+DigitalOut led3(LED3);
+void led1_task(void const* args)
+{
+ while(1)
+ {
+ led1=!led1;
+ Thread::wait(500);
+
}
}
-
-int main() {
- Thread thread(led2_thread);
-
- while (true) {
- led1 = !led1;
- Thread::wait(500);
- }
+
+void led2_task(void const* args)
+{
+ while(1)
+ {
+ led2=!led2;
+ Thread::wait(1000);
+ }
+
}
+
+void led3_task(void const*args)
+{
+ while(1)
+ {
+ led3=!led3;
+ Thread::wait(250);
+ }
+
+}
+
+
+int main(void)
+{
+
+ Thread led1_thread1(led1_task);
+ Thread led2_thread2(led2_task);
+ Thread led3_thread3(led3_task);
+
+ while(1)
+ {
+
+
+ }
+}
--- a/mbed-rtos.lib Tue Jun 04 16:01:32 2013 +0100 +++ b/mbed-rtos.lib Mon Oct 27 04:35:25 2014 +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/#e2da1b20a6d5
--- a/mbed.bld Tue Jun 04 16:01:32 2013 +0100 +++ b/mbed.bld Mon Oct 27 04:35:25 2014 +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/552587b429a1 \ No newline at end of file
