#include <stdio.
h>
#include "FreeRTOS.h"
#include "task.h"
// Task 1 function
void vTask1(void *pvParameters) {
while (1) {
printf("This is task 1\n");
fflush(stdout);
vTaskDelay(pdMS_TO_TICKS(100)); // 100 ms delay
// Task 2 function
void vTask2(void *pvParameters) {
while (1) {
printf("This is task 2\n");
fflush(stdout);
vTaskDelay(pdMS_TO_TICKS(500)); // 500 ms delay
int main(void) {
// Create Task 1
xTaskCreate(
vTask1, // Function that implements the task
"Task1", // Text name for the task
1000, // Stack size in words
NULL, // Parameter passed into the task
3, // Priority
NULL); // Task handle
// Create Task 2
xTaskCreate(
vTask2,
"Task2",
100,
NULL,
1,
NULL);
// Start the scheduler
vTaskStartScheduler();
// The program should never reach here
for (;;);
return 0;