Skip to content

Commit

Permalink
Flush UART RX queue too (#3009)
Browse files Browse the repository at this point in the history
  • Loading branch information
romansavrulin authored and me-no-dev committed Aug 20, 2019
1 parent cd5257a commit 03066e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cores/esp32/esp32-hal-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ void uartFlush(uart_t* uart)
READ_PERI_REG(UART_FIFO_REG(uart->num));
}

xQueueReset(uart->queue);

UART_MUTEX_UNLOCK();
}

Expand Down

1 comment on commit 03066e4

@kbickham
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, someone already mentioned in #3095 , while(uart->dev->status.rxfifo_cnt != 0 || (uart->dev->mem_rx_status.wr_addr != uart->dev->mem_rx_status.rd_addr)) { READ_PERI_REG(UART_FIFO_REG(uart->num)); is this clearing the input buffer as well? I believe this may be effecting something I'm working on. May the force be with you.

Please sign in to comment.