]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/tests/rtos/cmsis/basic/main.cpp
Merge commit '657d9f23fe47fb88cf221adb23095082f191ba6a'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / tests / rtos / cmsis / basic / main.cpp
1 #include "mbed.h"
2 #include "cmsis_os.h"
3
4 DigitalOut led1(LED1);
5 DigitalOut led2(LED2);
6
7 void led2_thread(void const *argument) {
8 while (true) {
9 led2 = !led2;
10 osDelay(1000);
11 }
12 }
13 osThreadDef(led2_thread, osPriorityNormal, DEFAULT_STACK_SIZE);
14
15 int main() {
16 osThreadCreate(osThread(led2_thread), NULL);
17
18 while (true) {
19 led1 = !led1;
20 osDelay(500);
21 }
22 }
Imprint / Impressum