mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 04:25:32 +00:00
bugfix: fix uart fifo lost data issue
This commit is contained in:
@@ -271,7 +271,7 @@ static inline uint32_t uart_ll_get_intr_ena_status(uart_dev_t *hw)
|
|||||||
static inline void uart_ll_read_rxfifo(uart_dev_t *hw, uint8_t *buf, uint32_t rd_len)
|
static inline void uart_ll_read_rxfifo(uart_dev_t *hw, uint8_t *buf, uint32_t rd_len)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < (int)rd_len; i++) {
|
for (int i = 0; i < (int)rd_len; i++) {
|
||||||
buf[i] = HAL_FORCE_READ_U32_REG_FIELD(hw->fifo, rxfifo_rd_byte);
|
buf[i] = hw->fifo.rxfifo_rd_byte;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -287,7 +287,7 @@ static inline void uart_ll_read_rxfifo(uart_dev_t *hw, uint8_t *buf, uint32_t rd
|
|||||||
static inline void uart_ll_write_txfifo(uart_dev_t *hw, const uint8_t *buf, uint32_t wr_len)
|
static inline void uart_ll_write_txfifo(uart_dev_t *hw, const uint8_t *buf, uint32_t wr_len)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < (int)wr_len; i++) {
|
for (int i = 0; i < (int)wr_len; i++) {
|
||||||
HAL_FORCE_MODIFY_U32_REG_FIELD(hw->fifo, rxfifo_rd_byte, buf[i]);
|
hw->fifo.rxfifo_rd_byte = buf[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,8 +19,7 @@ typedef union {
|
|||||||
/** rxfifo_rd_byte : RO; bitpos: [7:0]; default: 0;
|
/** rxfifo_rd_byte : RO; bitpos: [7:0]; default: 0;
|
||||||
* UART $n accesses FIFO via this register.
|
* UART $n accesses FIFO via this register.
|
||||||
*/
|
*/
|
||||||
uint32_t rxfifo_rd_byte:8;
|
uint32_t rxfifo_rd_byte:32;
|
||||||
uint32_t reserved_8:24;
|
|
||||||
};
|
};
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
} uart_fifo_reg_t;
|
} uart_fifo_reg_t;
|
||||||
|
Reference in New Issue
Block a user