yg lim
/
Nucleo_rtos_basic
.
Revision 0:ccbe90e047dd, committed 2016-11-04
- Comitter:
- yglim
- Date:
- Fri Nov 04 00:42:11 2016 +0000
- Commit message:
- .
Changed in this revision
diff -r 000000000000 -r ccbe90e047dd main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Nov 04 00:42:11 2016 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" +#include "rtos.h" + +void print_char(char c = '*') +{ + printf("%c", c); + fflush(stdout); +} + +DigitalOut led1(LED1); + +void print_thread(void const *argument) +{ + while (true) { + Thread::wait(1000); + print_char(); + } +} + +int main() +{ + printf("\n\n*** RTOS basic example ***\n"); + Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE); + while (true) { + led1 = !led1; + Thread::wait(500); + } +}
diff -r 000000000000 -r ccbe90e047dd mbed-rtos.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-rtos.lib Fri Nov 04 00:42:11 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed-rtos/#3da5f554d8bf
diff -r 000000000000 -r ccbe90e047dd mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Nov 04 00:42:11 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9bcdf88f62b0 \ No newline at end of file