.

Dependencies:   mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
yglim
Date:
Fri Nov 04 00:42:11 2016 +0000
Commit message:
.

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 ccbe90e047dd main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Nov 04 00:42:11 2016 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "rtos.h"
+
+void print_char(char c = '*')
+{
+    printf("%c", c);
+    fflush(stdout);
+}
+
+DigitalOut led1(LED1);
+
+void print_thread(void const *argument)
+{
+    while (true) {
+        Thread::wait(1000);
+        print_char();
+    }
+}
+
+int main()
+{
+    printf("\n\n*** RTOS basic example ***\n");
+    Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
+    while (true) {
+        led1 = !led1;
+        Thread::wait(500);
+    }
+}
diff -r 000000000000 -r ccbe90e047dd mbed-rtos.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Fri Nov 04 00:42:11 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#3da5f554d8bf
diff -r 000000000000 -r ccbe90e047dd mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Nov 04 00:42:11 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0
\ No newline at end of file