Basic example showing the Signals API
mbed 2 and mbed OS 5
This is an mbed 2 example. mbed OS 5 has intergrated the mbed library with mbed-rtos. For an mbed-os example, please see:
Import programrtos_signals
signals example
Revision 6:8359b29626dc, committed 2017-02-15
- Comitter:
- mbed_official
- Date:
- Wed Feb 15 13:51:51 2017 -0600
- Parent:
- 5:476186ff82cf
- Commit message:
- Revert update to mbed-os.
Changed in this revision
--- a/main.cpp Fri Jan 13 19:50:30 2017 +0000 +++ b/main.cpp Wed Feb 15 13:51:51 2017 -0600 @@ -1,6 +1,6 @@ #include "mbed.h" +#include "rtos.h" -Thread thread; DigitalOut led(LED1); void led_thread() { @@ -12,10 +12,12 @@ } int main (void) { + Thread thread; + thread.start(callback(led_thread)); while (true) { - wait(1); + Thread::wait(1000); thread.signal_set(0x1); } }
--- a/mbed-os.lib Fri Jan 13 19:50:30 2017 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://github.com/ARMmbed/mbed-os/#2885c1b41e63158cb6faf5f107cd821ae06ef26c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Wed Feb 15 13:51:51 2017 -0600 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/ \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Feb 15 13:51:51 2017 -0600 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/ \ No newline at end of file