FreeRTOS
Operating system for microcontrollers.
Getting Started
- Download the source code from the FreeRTOS website
- Create a
FreeRTOSConfig.hfile for your project - Include the following header directories
- FreeRTOS/Source/include
- FreeRTOS/Source/portable/<compiler>/<architecture>
Example
void vTask1(void *pvParameters) {
while (1) {}
}
void vTask2(void *pvParameters) {
char *pcVariable = (char*) pvParameters;
while (1) {}
}
int main() {
xTaskCreate(vTask1, "Task 1", 1000, NULL, 1, NULL);
// 1 .. Task Priority from 0 - configMAX_PRIORITIES - 1
// 1000 .. Stack Depth
const char* paramForTask2 = "Some text";
xTaskCreate(vTask2, "Task 2", 1000, (void*) paramForTask2, 1, NULL);
vTaskStartScheduler();
while (1);
}