mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
dreiver/i2c: delete i2c cmd_mux semaphore more cleanly
Merges https://github.com/espressif/esp-idf/pull/6847
This commit is contained in:
committed by
laokaiyao
parent
4663d3ec11
commit
59d08d4467
@@ -367,7 +367,9 @@ esp_err_t i2c_driver_delete(i2c_port_t i2c_num)
|
|||||||
p_i2c->intr_handle = NULL;
|
p_i2c->intr_handle = NULL;
|
||||||
|
|
||||||
if (p_i2c->cmd_mux) {
|
if (p_i2c->cmd_mux) {
|
||||||
|
// Let any command in progress finish.
|
||||||
xSemaphoreTake(p_i2c->cmd_mux, portMAX_DELAY);
|
xSemaphoreTake(p_i2c->cmd_mux, portMAX_DELAY);
|
||||||
|
xSemaphoreGive(p_i2c->cmd_mux);
|
||||||
vSemaphoreDelete(p_i2c->cmd_mux);
|
vSemaphoreDelete(p_i2c->cmd_mux);
|
||||||
}
|
}
|
||||||
if (p_i2c_obj[i2c_num]->cmd_evt_queue) {
|
if (p_i2c_obj[i2c_num]->cmd_evt_queue) {
|
||||||
|
Reference in New Issue
Block a user