mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 19:54:32 +02:00
I2C: Fix i2c write fake timeout and WDT triggered
This commit is contained in:
@@ -16,25 +16,30 @@
|
|||||||
|
|
||||||
void i2c_hal_master_handle_tx_event(i2c_hal_context_t *hal, i2c_intr_event_t *event)
|
void i2c_hal_master_handle_tx_event(i2c_hal_context_t *hal, i2c_intr_event_t *event)
|
||||||
{
|
{
|
||||||
i2c_ll_master_get_event(hal->dev, event);
|
if (i2c_ll_get_intsts_mask(hal->dev) != 0) {
|
||||||
if ((*event < I2C_INTR_EVENT_END_DET) ||
|
// If intr status is 0, no need to handle it.
|
||||||
(*event == I2C_INTR_EVENT_TRANS_DONE)) {
|
i2c_ll_master_get_event(hal->dev, event);
|
||||||
i2c_ll_master_disable_tx_it(hal->dev);
|
if ((*event < I2C_INTR_EVENT_END_DET) ||
|
||||||
i2c_ll_master_clr_tx_it(hal->dev);
|
(*event == I2C_INTR_EVENT_TRANS_DONE)) {
|
||||||
} else if (*event == I2C_INTR_EVENT_END_DET) {
|
i2c_ll_master_disable_tx_it(hal->dev);
|
||||||
i2c_ll_master_clr_tx_it(hal->dev);
|
i2c_ll_master_clr_tx_it(hal->dev);
|
||||||
|
} else if (*event == I2C_INTR_EVENT_END_DET) {
|
||||||
|
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)
|
void i2c_hal_master_handle_rx_event(i2c_hal_context_t *hal, i2c_intr_event_t *event)
|
||||||
{
|
{
|
||||||
i2c_ll_master_get_event(hal->dev, event);
|
if (i2c_ll_get_intsts_mask(hal->dev) != 0) {
|
||||||
if ((*event < I2C_INTR_EVENT_END_DET) ||
|
i2c_ll_master_get_event(hal->dev, event);
|
||||||
(*event == I2C_INTR_EVENT_TRANS_DONE)) {
|
if ((*event < I2C_INTR_EVENT_END_DET) ||
|
||||||
i2c_ll_master_disable_rx_it(hal->dev);
|
(*event == I2C_INTR_EVENT_TRANS_DONE)) {
|
||||||
i2c_ll_master_clr_rx_it(hal->dev);
|
i2c_ll_master_disable_rx_it(hal->dev);
|
||||||
} else if (*event == I2C_INTR_EVENT_END_DET) {
|
i2c_ll_master_clr_rx_it(hal->dev);
|
||||||
i2c_ll_master_clr_rx_it(hal->dev);
|
} else if (*event == I2C_INTR_EVENT_END_DET) {
|
||||||
|
i2c_ll_master_clr_rx_it(hal->dev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user