diff --git a/cores/esp32/esp32-hal-i2c.c b/cores/esp32/esp32-hal-i2c.c index d310792c0dd..21dab48b817 100644 --- a/cores/esp32/esp32-hal-i2c.c +++ b/cores/esp32/esp32-hal-i2c.c @@ -1130,7 +1130,11 @@ if(i2c->intr_handle){ // log_e("released ISR=%d",error); i2c->intr_handle=NULL; } -return I2C_ERROR_OK; +if(i2c->i2c_event){ + xEventGroupDelete(i2c->i2c_event); + i2c->i2c_event = NULL; + } +return i2cFreeQueue(i2c); //release dynamic memory } /* todo