mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-07 09:48:47 +00:00
FreeRTOS
This commit is contained in:
@@ -103,11 +103,10 @@ void task1(void *pvParameters) {
|
||||
|
||||
while (1) {
|
||||
if (xSemaphoreTake(xMutex, 1500)) {
|
||||
printf("Task 1 is running\n");
|
||||
task_data.num1 = x;
|
||||
s_data.num1 = x;
|
||||
xQueueSend(xQueue1, &task_data, 0);
|
||||
printf("Task 1 sent x=%" PRIu32 "\n", x);
|
||||
printf("\nTask 1 sent x=%" PRIu32 "\n", x);
|
||||
x+=2;
|
||||
vTaskDelay(500);
|
||||
xSemaphoreGive(xMutex);
|
||||
@@ -130,11 +129,10 @@ void task2(void *pvParameters) {
|
||||
|
||||
while (1) {
|
||||
if (xSemaphoreTake(xMutex, 1500)) {
|
||||
printf("Task 2 is running\n");
|
||||
task_data.num2 = y;
|
||||
s_data.num2 = y;
|
||||
xQueueSend(xQueue2, &task_data, 0);
|
||||
printf("Task 2 sent y=%" PRIu32 "\n", y);
|
||||
printf("\nTask 2 sent y=%" PRIu32 "\n", y);
|
||||
y++;
|
||||
vTaskDelay(250);
|
||||
xSemaphoreGive(xMutex);
|
||||
|
Reference in New Issue
Block a user