mbed official / Mbed 2 deprecated cmsis_rtos_signals

Dependencies:   mbed mbed-rtos

Files at this revision

API Documentation at this revision

Comitter:
emilmont
Date:
Fri Jul 13 14:49:40 2012 +0000
Parent:
0:9197b24e0e31
Child:
2:7dc6330b7848
Commit message:
First implementation

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
--- a/main.cpp	Fri Jul 13 14:47:16 2012 +0000
+++ b/main.cpp	Fri Jul 13 14:49:40 2012 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#include "cmsis_os.h"
+
+DigitalOut led(LED1);
+
+void led_thread(void const *argument) {
+    while (true) {
+        // Signal flags that are reported as event are automatically cleared.
+        osSignalWait(0x1, osWaitForever);
+        led = !led;
+    }
+}
+osThreadDef(led_thread, osPriorityNormal, DEFAULT_STACK_SIZE);
+
+int main (void) {
+    osThreadId tid = osThreadCreate(osThread(led_thread), NULL);
+    
+    while (true) {
+        osDelay(1000);
+        osSignalSet(tid, 0x1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Fri Jul 13 14:49:40 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#01158bb7600c