Skip to content

Commit

Permalink
Merge pull request #1 from dhalbert/circuitpython-i2c-cmd_mux-fix
Browse files Browse the repository at this point in the history
Delete i2c cmd_mux semaphore more cleanly
  • Loading branch information
dhalbert authored Mar 12, 2021
2 parents ebe7784 + 8dd3ea8 commit f30a865
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/driver/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ esp_err_t i2c_driver_delete(i2c_port_t i2c_num)
p_i2c->intr_handle = NULL;

if (p_i2c->cmd_mux) {
// Let any command in progress finish.
xSemaphoreTake(p_i2c->cmd_mux, portMAX_DELAY);
xSemaphoreGive(p_i2c->cmd_mux);
vSemaphoreDelete(p_i2c->cmd_mux);
}
if (p_i2c_obj[i2c_num]->cmd_evt_queue) {
Expand Down

0 comments on commit f30a865

Please sign in to comment.