diff --git a/ESP32-IDF_FreeRTOS/I2C_MultiDevice/main/hello_world_main.c b/ESP32-IDF_FreeRTOS/I2C_MultiDevice/main/hello_world_main.c index 0aa3d4d64..a878be0ee 100644 --- a/ESP32-IDF_FreeRTOS/I2C_MultiDevice/main/hello_world_main.c +++ b/ESP32-IDF_FreeRTOS/I2C_MultiDevice/main/hello_world_main.c @@ -53,6 +53,13 @@ void app_main(void) printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size()); + + xMutex = xSemaphoreCreateMutex(); + if (xMutex == NULL) { + printf("Failed to create mutex\n"); + return; + } + xTaskCreate(task1, "Task1", 2048, NULL, 5, NULL); xTaskCreate(task2, "Task2", 2048, NULL, 5, NULL);