Same as freertos_bluetooth but now with FreeRTOS v_8.2.1
Dependencies: mbed m3pi FreeRTOS_V8_2_1_LPC1768
main.cpp
- Committer:
- chalikias
- Date:
- 2015-09-13
- Revision:
- 3:d577dbef65a2
- Parent:
- 2:7a112956091c
- Child:
- 4:33929b1afb80
File content as of revision 3:d577dbef65a2:
// N.C. Freertos mbed minimal example based on below: // https://developer.mbed.org/users/rgrover1/code/FreeRTOS/ // http://www.radekdostal.com/content/freertos-610-minimal-example #include "mbed.h" #include "FreeRTOS.h" #include "task.h" DigitalOut led1(LED1); DigitalOut led2(LED2); void Task1 (void* pvParameters) { (void) pvParameters; // Just to stop compiler warnings. for (;;) { led1 = !led1; printf("Task1\n"); vTaskDelay(500); } } void Task2 (void* pvParameters) { (void) pvParameters; // Just to stop compiler warnings. for (;;) { led2= !led2; printf("Task2\n"); vTaskDelay(5000); } } int main (void) { xTaskCreate( Task1, ( signed char * ) "Task1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL ); xTaskCreate( Task2, ( signed char * ) "Task2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL ); vTaskStartScheduler(); //should never get here printf("ERORR: vTaskStartScheduler returned!"); for (;;); }