drivers: console: uart_mcumgr: Skip reading FIFO during setup

Drops calling the UART FIFO read function during the setup
function (when not in async mode) which could cause issues on
some devices since this function is not called in an ISR.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
Jamie McCrae 2023-11-22 12:21:30 +00:00 committed by Fabio Baltieri
parent 9f1b1bbba4
commit 1b364c1422

View file

@ -228,16 +228,9 @@ static void uart_mcumgr_setup(const struct device *uart)
#else
static void uart_mcumgr_setup(const struct device *uart)
{
uint8_t c;
uart_irq_rx_disable(uart);
uart_irq_tx_disable(uart);
/* Drain the fifo */
while (uart_fifo_read(uart, &c, 1)) {
continue;
}
uart_irq_callback_set(uart, uart_mcumgr_isr);
uart_irq_rx_enable(uart);