ARM Shanghai IoT Team (Internal) / Mbed 2 deprecated threadbaseapp_JacobShi

Dependencies:   mbed-rtos mbed

Fork of rtos_basic by mbed official

Files at this revision

API Documentation at this revision

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

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- 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