This commit is contained in:
2025-08-05 04:21:48 -04:00
parent a3e49273c1
commit a0869118c1

View File

@@ -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);