mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 02:37:19 +02:00
fix(i2c): Fix lose byte during data reading in i2c master on esp32,
Closes https://github.com/espressif/esp-idf/issues/12860
This commit is contained in:
@ -575,7 +575,9 @@ __attribute__((always_inline))
|
||||
static inline void i2c_ll_read_rxfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len)
|
||||
{
|
||||
for(int i = 0; i < len; i++) {
|
||||
ptr[i] = HAL_FORCE_READ_U32_REG_FIELD(hw->fifo_data, data);
|
||||
// Known issue that hardware read fifo will cause data lose, (fifo pointer jump over a random address)
|
||||
// use `DPORT_REG_READ` can avoid this issue.
|
||||
ptr[i] = DPORT_REG_READ((uint32_t)&hw->fifo_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user