]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/tests/rtos/cmsis/signals/main.cpp
Merge commit '657d9f23fe47fb88cf221adb23095082f191ba6a'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / tests / rtos / cmsis / signals / main.cpp
1 #include "mbed.h"
2 #include "cmsis_os.h"
3
4 DigitalOut led(LED1);
5
6 void led_thread(void const *argument) {
7 while (true) {
8 // Signal flags that are reported as event are automatically cleared.
9 osSignalWait(0x1, osWaitForever);
10 led = !led;
11 }
12 }
13
14 osThreadDef(led_thread, osPriorityNormal, DEFAULT_STACK_SIZE);
15
16 int main (void) {
17 osThreadId tid = osThreadCreate(osThread(led_thread), NULL);
18
19 while (true) {
20 osDelay(1000);
21 osSignalSet(tid, 0x1);
22 }
23 }
Imprint / Impressum