I2C: Fix i2c write fake timeout and WDT triggered
void i2c_hal_master_handle_tx_event(i2c_hal_context_t *hal, i2c_intr_event_t *event)
{
+ if (i2c_ll_get_intsts_mask(hal->dev) != 0) {
+ // If intr status is 0, no need to handle it.
i2c_ll_master_get_event(hal->dev, event);
if ((*event < I2C_INTR_EVENT_END_DET) ||
(*event == I2C_INTR_EVENT_TRANS_DONE)) {
@@ -25,9 +27,11 @@ void i2c_hal_master_handle_tx_event(i2c_hal_context_t *hal, i2c_intr_event_t *ev
i2c_ll_master_clr_tx_it(hal->dev);
}
}
+}
void i2c_hal_master_handle_rx_event(i2c_hal_context_t *hal, i2c_intr_event_t *event)
{
+ if (i2c_ll_get_intsts_mask(hal->dev) != 0) {
i2c_ll_master_get_event(hal->dev, event);
if ((*event < I2C_INTR_EVENT_END_DET) ||
(*event == I2C_INTR_EVENT_TRANS_DONE)) {
@@ -37,6 +41,7 @@ void i2c_hal_master_handle_rx_event(i2c_hal_context_t *hal, i2c_intr_event_t *ev
i2c_ll_master_clr_rx_it(hal->dev);
}
}
+}
void i2c_hal_slave_handle_event(i2c_hal_context_t *hal, i2c_intr_event_t *event)
{
