Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of rtos_signals by
main.cpp@4:ad6be128bc77, 2013-09-28 (annotated)
- Committer:
- khayakawa
- Date:
- Sat Sep 28 06:38:42 2013 +0000
- Revision:
- 4:ad6be128bc77
- Parent:
- 1:6a8fcc666593
KEIS
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| emilmont | 1:6a8fcc666593 | 1 | #include "mbed.h" |
| emilmont | 1:6a8fcc666593 | 2 | #include "rtos.h" |
| emilmont | 1:6a8fcc666593 | 3 | |
| emilmont | 1:6a8fcc666593 | 4 | DigitalOut led(LED1); |
| emilmont | 1:6a8fcc666593 | 5 | |
| emilmont | 1:6a8fcc666593 | 6 | void led_thread(void const *argument) { |
| emilmont | 1:6a8fcc666593 | 7 | while (true) { |
| emilmont | 1:6a8fcc666593 | 8 | Thread::signal_wait(0x1); |
| emilmont | 1:6a8fcc666593 | 9 | led = !led; |
| emilmont | 1:6a8fcc666593 | 10 | } |
| emilmont | 1:6a8fcc666593 | 11 | } |
| emilmont | 1:6a8fcc666593 | 12 | |
| emilmont | 1:6a8fcc666593 | 13 | int main (void) { |
| emilmont | 1:6a8fcc666593 | 14 | Thread thread(led_thread); |
| emilmont | 1:6a8fcc666593 | 15 | |
| emilmont | 1:6a8fcc666593 | 16 | while (true) { |
| emilmont | 1:6a8fcc666593 | 17 | Thread::wait(1000); |
| emilmont | 1:6a8fcc666593 | 18 | thread.signal_set(0x1); |
| emilmont | 1:6a8fcc666593 | 19 | } |
| emilmont | 1:6a8fcc666593 | 20 | } |
