#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <stdio.h>
void task1(void *args){
while(true){
printf("Hello from task 1\n");
vTaskDelay(pdMS_TO_TICKS(500));
printf("task running on %d\n",xPortGetCoreID());
vTaskDelay(pdMS_TO_TICKS(1000));
}
}
void task2(void *args){
while(true){
printf("Hello from task 2\n");
vTaskDelay(pdMS_TO_TICKS(500));
printf("task running on %d\n",xPortGetCoreID());
vTaskDelay(pdMS_TO_TICKS(2000));
}
}
void app_main(void) {
xTaskCreate(task1, "task 1", 2048, NULL,5,NULL);
xTaskCreate(task2, "task 2", 2048, NULL,5,NULL);
}Loading
esp32-devkit-c-v4
esp32-devkit-c-v4