Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard.
Fork of mbed-rtos by
main.cpp@65:2a128fe03bfd, 2015-02-12 (annotated)
- Committer:
- tsillen
- Date:
- Thu Feb 12 09:54:57 2015 +0000
- Revision:
- 65:2a128fe03bfd
test;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| tsillen | 65:2a128fe03bfd | 1 | #include "mbed.h" |
| tsillen | 65:2a128fe03bfd | 2 | #include "cmsis_os.h" |
| tsillen | 65:2a128fe03bfd | 3 | |
| tsillen | 65:2a128fe03bfd | 4 | DigitalOut led1(LED1); |
| tsillen | 65:2a128fe03bfd | 5 | DigitalOut led2(LED2); |
| tsillen | 65:2a128fe03bfd | 6 | |
| tsillen | 65:2a128fe03bfd | 7 | void led2_thread(void const *args) { |
| tsillen | 65:2a128fe03bfd | 8 | while (true) { |
| tsillen | 65:2a128fe03bfd | 9 | led2 = !led2; |
| tsillen | 65:2a128fe03bfd | 10 | osDelay(1000); |
| tsillen | 65:2a128fe03bfd | 11 | } |
| tsillen | 65:2a128fe03bfd | 12 | } |
| tsillen | 65:2a128fe03bfd | 13 | osThreadDef(led2_thread, osPriorityNormal, DEFAULT_STACK_SIZE); |
| tsillen | 65:2a128fe03bfd | 14 | |
| tsillen | 65:2a128fe03bfd | 15 | int main() { |
| tsillen | 65:2a128fe03bfd | 16 | osThreadCreate(osThread(led2_thread), NULL); |
| tsillen | 65:2a128fe03bfd | 17 | |
| tsillen | 65:2a128fe03bfd | 18 | while (true) { |
| tsillen | 65:2a128fe03bfd | 19 | led1 = !led1; |
| tsillen | 65:2a128fe03bfd | 20 | osDelay(500); |
| tsillen | 65:2a128fe03bfd | 21 | } |
| tsillen | 65:2a128fe03bfd | 22 | } |
