Skip to content

Commit 2243081

Browse files
lienbacher0xDEADBEEF
and
0xDEADBEEF
authored
add I2C_RX_FIFO_OVF_INT_ST handling to i2c_isr_handler_default (#4342)
Fixes crash on ESP32 when I2C FiFo overflows and interrupt function is unable to handle crash and throws this error: [E][esp32-hal-i2c.c:1013] i2c_isr_handler_default(): unknown int=4 Co-authored-by: 0xDEADBEEF <[email protected]>
1 parent 1f4491f commit 2243081

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: cores/esp32/esp32-hal-i2c.c

+8
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,14 @@ static void IRAM_ATTR i2c_isr_handler_default(void* arg)
945945
activeInt &=~I2C_RXFIFO_FULL_INT_ST;
946946
}
947947

948+
if(activeInt & I2C_RXFIFO_OVF_INT_ST) {
949+
emptyRxFifo(p_i2c);
950+
p_i2c->dev->int_clr.rx_fifo_full=1;
951+
p_i2c->dev->int_ena.rx_fifo_full=1; //why?
952+
953+
activeInt &=~I2C_RXFIFO_OVF_INT_ST;
954+
}
955+
948956
if (activeInt & I2C_ACK_ERR_INT_ST_M) {//fatal error, abort i2c service
949957
if (p_i2c->mode == I2C_MASTER) {
950958
i2c_update_error_byte_cnt(p_i2c); // calc which byte caused ack Error, check if address or data

0 commit comments

Comments
 (0)