mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-10 07:43:26 +00:00
FreeRTOS
This commit is contained in:
@@ -108,6 +108,16 @@ void task2(void *pvParameters) {
|
||||
while (1) {
|
||||
if (xSemaphoreTake(xMutex, 1500)) {
|
||||
printf("Task 2 is running\n");
|
||||
|
||||
data data = {
|
||||
.num1 = x,
|
||||
.num2 = 0,
|
||||
.num3 = 0,
|
||||
};
|
||||
|
||||
xQueueSend(xQueue1, &data, 0);
|
||||
printf("Task 1 sent: id=%d, message=%s\n", data.id, data.message);
|
||||
|
||||
printf("This is Task #2\n\n");
|
||||
vTaskDelay((2000)); // Delay for 2 seconds
|
||||
xSemaphoreGive(xMutex);
|
||||
|
Reference in New Issue
Block a user