mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 20:41:14 +00:00
feat(uart): change fifo.byte to fifo.val when uart_ll_write_txfifo
This commit is contained in:
@@ -540,8 +540,11 @@ FORCE_INLINE_ATTR void uart_ll_read_rxfifo(uart_dev_t *hw, uint8_t *buf, uint32_
|
||||
*/
|
||||
FORCE_INLINE_ATTR void uart_ll_write_txfifo(uart_dev_t *hw, const uint8_t *buf, uint32_t wr_len)
|
||||
{
|
||||
// Write to the FIFO should make sure only involve write operation, any read operation would cause data lost.
|
||||
// Non-32-bit access would lead to a read-modify-write operation to the register, which is undesired.
|
||||
// Therefore, use 32-bit access to avoid any potential problem.
|
||||
for (int i = 0; i < (int)wr_len; i++) {
|
||||
hw->fifo.rxfifo_rd_byte = buf[i];
|
||||
hw->fifo.val = (int)buf[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user