shell: uart: Fix init function
Init function can be called multiple times (after each shell reinitialization). It was missing reseting ring buffers and tx_busy flag. When called once proper state of those variable where handled by ram sections initialization. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
0225ea7ab0
commit
265e9dbb1b
1 changed files with 3 additions and 0 deletions
|
@ -144,6 +144,9 @@ static void uart_irq_init(const struct shell_uart *sh_uart)
|
|||
#ifdef CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN
|
||||
const struct device *dev = sh_uart->ctrl_blk->dev;
|
||||
|
||||
ring_buf_reset(sh_uart->tx_ringbuf);
|
||||
ring_buf_reset(sh_uart->rx_ringbuf);
|
||||
sh_uart->ctrl_blk->tx_busy = 0;
|
||||
uart_irq_callback_user_data_set(dev, uart_callback, (void *)sh_uart);
|
||||
uart_irq_rx_enable(dev);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue