rtos test

Dependencies:   mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
ohira
Date:
Sat Jan 26 12:26:19 2013 +0000
Commit message:
first.

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
diff -r 000000000000 -r caffc01f54aa main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jan 26 12:26:19 2013 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "cmsis_os.h"
+
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+Serial pc(USBTX , USBRX);
+    
+void led2_thread(void const *args){
+    while (true) {
+        led2 = !led2;
+        osDelay(1000);
+    }
+}
+
+void serial_thread(const void *args){
+    pc.baud(115200);
+    while(true){
+        pc.putc(pc.getc());
+    }
+}
+
+osThreadDef(serial_thread, osPriorityNormal, DEFAULT_STACK_SIZE);
+osThreadDef(led2_thread, osPriorityNormal, DEFAULT_STACK_SIZE);
+
+int main() {
+    osThreadCreate(osThread(led2_thread), NULL);
+    osThreadCreate(osThread(serial_thread), NULL);
+    while(true);
+}
diff -r 000000000000 -r caffc01f54aa mbed-rtos.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Sat Jan 26 12:26:19 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#88a1a9c26ae3
diff -r 000000000000 -r caffc01f54aa mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Jan 26 12:26:19 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0954ebd79f59
\ No newline at end of file