diff options
author | Paul Selkirk <paul@psgd.org> | 2016-04-14 18:50:38 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2016-04-14 18:50:38 -0400 |
commit | 4a38cf6f44d1c013cbe794093ea6c5b50337431a (patch) | |
tree | 148201449b481794ff839cd15d335f40e0f91c9d /projects/rtos-test/thread-test.c | |
parent | 79b1ba7104dba52dbfacf11a07305702889f440b (diff) |
import mbed rtos library
Diffstat (limited to 'projects/rtos-test/thread-test.c')
-rw-r--r-- | projects/rtos-test/thread-test.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/projects/rtos-test/thread-test.c b/projects/rtos-test/thread-test.c new file mode 100644 index 0000000..8b31a26 --- /dev/null +++ b/projects/rtos-test/thread-test.c @@ -0,0 +1,24 @@ +#include "cmsis_os.h" + +#include "stm-init.h" +#include "stm-led.h" + +void led2_thread(void const *args) +{ + while (1) { + led_toggle(LED_BLUE); + osDelay(1000); + } +} +osThreadDef(led2_thread, osPriorityNormal, DEFAULT_STACK_SIZE); + +int main() +{ + stm_init(); + osThreadCreate(osThread(led2_thread), NULL); + + while (1) { + led_toggle(LED_GREEN); + osDelay(500); + } +} |