mbed-rtos support for nucleo f401re
Dependencies: mbed-rtos_F401 mbed-src
Fork of rtos_basic by
main.cpp@12:f57ce5b102d3, 2014-06-25 (annotated)
- Committer:
- abdess
- Date:
- Wed Jun 25 14:49:21 2014 +0000
- Revision:
- 12:f57ce5b102d3
- Parent:
- 8:88582a97af69
updated mbed-src
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
emilmont | 1:491820ee784d | 1 | #include "mbed.h" |
emilmont | 1:491820ee784d | 2 | #include "rtos.h" |
emilmont | 1:491820ee784d | 3 | |
abdess | 7:ae8015ac5102 | 4 | Serial pc(SERIAL_TX, SERIAL_RX); |
emilmont | 1:491820ee784d | 5 | DigitalOut led2(LED2); |
emilmont | 1:491820ee784d | 6 | |
emilmont | 3:c92e21f305d8 | 7 | void led2_thread(void const *args) { |
emilmont | 1:491820ee784d | 8 | while (true) { |
emilmont | 1:491820ee784d | 9 | led2 = !led2; |
emilmont | 1:491820ee784d | 10 | Thread::wait(1000); |
emilmont | 1:491820ee784d | 11 | } |
emilmont | 1:491820ee784d | 12 | } |
emilmont | 1:491820ee784d | 13 | |
emilmont | 1:491820ee784d | 14 | int main() { |
emilmont | 1:491820ee784d | 15 | Thread thread(led2_thread); |
abdess | 7:ae8015ac5102 | 16 | int i = 1; |
abdess | 7:ae8015ac5102 | 17 | |
abdess | 7:ae8015ac5102 | 18 | while(1) { |
abdess | 7:ae8015ac5102 | 19 | wait(1); |
abdess | 7:ae8015ac5102 | 20 | pc.printf("main thread running !\n"); |
abdess | 7:ae8015ac5102 | 21 | Thread::wait(1000); |
abdess | 7:ae8015ac5102 | 22 | } |
abdess | 8:88582a97af69 | 23 | } |