This program does *not* run correctly if declarations are left in.

Dependencies:   mbed-rtos mbed

Files at this revision

API Documentation at this revision

Comitter:
justgary
Date:
Thu Feb 02 23:36:37 2017 +0000
Commit message:
This program does *not* run properly if declarations are left in.

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 e4945b97d9aa main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Feb 02 23:36:37 2017 +0000
@@ -0,0 +1,41 @@
+#include "mbed.h"
+#include "rtos.h"
+
+Serial      pc(USBTX, USBRX);
+
+DigitalOut redled(LED_RED);
+DigitalOut greled(LED_GREEN);
+DigitalOut bluled(LED_BLUE);
+DigitalOut useled(LED_USER);
+
+InterruptIn irq_data(P2_14);                                      // <--- Leave this line, blink_thread() won't run
+
+SPI         spi_data(P10_14, P10_15, P10_12, P10_13);   // SPI0   // <--- Leave these two lines, nothing runs
+RawSerial   uart_data(P8_14, P8_15);                    // UART4  // <-'
+
+
+Thread h_task1_thread (osPriorityRealtime, 20480L, NULL);
+Thread h_task2_thread (osPriorityHigh, 20480L, NULL);
+Thread h_task3_thread (osPriorityNormal, 20480L, NULL);
+Thread h_task4_thread (osPriorityLow, 20480L, NULL);
+Thread h_blink_thread (osPriorityNormal, 20480L, NULL);
+
+void blink_thread () {
+    useled = 1;
+    while (true) {
+        Thread::signal_wait(0x1);
+        useled = !useled;
+    }
+}
+
+int main() {
+    h_blink_thread.start(blink_thread);
+    
+    while(1) {
+        bluled = 1;
+        wait(0.2);
+        bluled = 0;
+        wait(0.2);
+        h_blink_thread.signal_set(0x1);
+    }
+}
diff -r 000000000000 -r e4945b97d9aa mbed-rtos.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Thu Feb 02 23:36:37 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#58563e6cba1e
diff -r 000000000000 -r e4945b97d9aa mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Feb 02 23:36:37 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/ad3be0349dc5
\ No newline at end of file