Test
Dependencies: X_NUCLEO_IHM01A1
Diff: main.cpp
- Revision:
- 2:35f13b7f3659
- Parent:
- 0:5701b41769fd
- Child:
- 3:24ab1c8fefef
--- a/main.cpp Wed Jun 07 13:55:59 2017 +0000 +++ b/main.cpp Thu Nov 23 13:09:25 2017 +0000 @@ -1,5 +1,4 @@ #include "mbed.h" -#include "rtos.h" void print_char(char c = '*') { @@ -7,12 +6,14 @@ fflush(stdout); } +Thread thread; + DigitalOut led1(LED1); -void print_thread(void const *argument) +void print_thread() { while (true) { - Thread::wait(1000); + wait(1); print_char(); } } @@ -20,9 +21,11 @@ int main() { printf("\n\n*** RTOS basic example ***\n"); - Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE); + + thread.start(print_thread); + while (true) { led1 = !led1; - Thread::wait(500); + wait(0.5); } }