This commit is contained in:
2025-08-05 01:44:42 -04:00
parent 75308642f7
commit 728115670d
5 changed files with 10 additions and 6 deletions

View File

@@ -88,9 +88,13 @@ void task1(void *pvParameters) {
void task2(void *pvParameters) {
while (1) {
printf("Task 2 is running\n");
printf("This is Task #2\n\n");
vTaskDelay((2000)); // Delay for 2 seconds
if (xSemaphoreTake(xMutex, portMAX_DELAY)) {
printf("Task 2 is running\n");
printf("This is Task #2\n\n");
vTaskDelay((2000)); // Delay for 2 seconds
xSemaphoreGive(xMutex);
}
vTaskDelay((100));
}
}