mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-09 17:35:28 +00:00
FreeRTOS
This commit is contained in:
@@ -14,11 +14,15 @@
|
|||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "freertos/semphr.h"
|
#include "freertos/semphr.h"
|
||||||
|
#include "freertos/queue.h"
|
||||||
#include "esp_chip_info.h"
|
#include "esp_chip_info.h"
|
||||||
#include "esp_flash.h"
|
#include "esp_flash.h"
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
|
|
||||||
SemaphoreHandle_t xMutex;
|
SemaphoreHandle_t xMutex;
|
||||||
|
QueueHandle_t xQueue1;
|
||||||
|
QueueHandle_t xQueue2
|
||||||
|
|
||||||
|
|
||||||
void task1(void *pvParameters);
|
void task1(void *pvParameters);
|
||||||
void task2(void *pvParameters);
|
void task2(void *pvParameters);
|
||||||
@@ -60,6 +64,15 @@ void app_main(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xQueue1 = xQueueCreate(10, sizeof(int));
|
||||||
|
xQueue2 = xQueueCreate(10, sizeof(int));
|
||||||
|
|
||||||
|
if (xQueue1 == NULL || xQueue2 == NULL) {
|
||||||
|
printf("Failed to create queues\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
xTaskCreate(task1, "Task1", 2048, NULL, 5, NULL);
|
xTaskCreate(task1, "Task1", 2048, NULL, 5, NULL);
|
||||||
xTaskCreate(task2, "Task2", 2048, NULL, 5, NULL);
|
xTaskCreate(task2, "Task2", 2048, NULL, 5, NULL);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user