From 8e1698aa05c858e4c7c03f781755a32375041b10 Mon Sep 17 00:00:00 2001 From: "C.S.M" Date: Tue, 18 Jun 2024 15:01:18 +0800 Subject: [PATCH] fix(i2c): Fix i2c not release semaphore in command send loop --- components/esp_driver_i2c/i2c_master.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/esp_driver_i2c/i2c_master.c b/components/esp_driver_i2c/i2c_master.c index afed2c9be4..66d2454a0d 100644 --- a/components/esp_driver_i2c/i2c_master.c +++ b/components/esp_driver_i2c/i2c_master.c @@ -441,6 +441,8 @@ static void s_i2c_send_commands(i2c_master_bus_handle_t i2c_master, TickType_t t i2c_master->cmd_idx = 0; i2c_master->trans_idx = 0; atomic_store(&i2c_master->status, I2C_STATUS_TIMEOUT); + ESP_LOGE(TAG, "I2C software timeout"); + xSemaphoreGive(i2c_master->cmd_semphr); return; }