Browse Source

drivers: serial: Fix issue qemu rx cannot input console

The source code is missing the Receive enable in serial
poll-in function so the status flag will never become affect
and data will never be read
Add the RE write before checking for receive status flag

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
pull/92244/head
Duy Nguyen 4 weeks ago committed by Benjamin Cabé
parent
commit
5c293b9915
  1. 2
      drivers/serial/uart_renesas_rx_sci_qemu.c

2
drivers/serial/uart_renesas_rx_sci_qemu.c

@ -51,6 +51,7 @@ LOG_MODULE_REGISTER(renesas_rx_uart_sci_qemu, CONFIG_UART_LOG_LEVEL); @@ -51,6 +51,7 @@ LOG_MODULE_REGISTER(renesas_rx_uart_sci_qemu, CONFIG_UART_LOG_LEVEL);
#define SSR_RDRF_LEN (1)
#define SSR_TDRE_POS (7)
#define SSR_TDRE_LEN (1)
#define SCI_SCR_RE (1 << 4)
struct uart_renesas_rx_sci_qemu_cfg {
mem_addr_t regs;
@ -77,6 +78,7 @@ static void uart_renesas_rx_qemu_write_8(const struct device *dev, uint32_t offs @@ -77,6 +78,7 @@ static void uart_renesas_rx_qemu_write_8(const struct device *dev, uint32_t offs
static int uart_renesas_rx_sci_qemu_poll_in(const struct device *dev, unsigned char *c)
{
uart_renesas_rx_qemu_write_8(dev, SCR, SCI_SCR_RE);
if ((uart_renesas_rx_qemu_read_8(dev, SSR) & REG_MASK(SSR_RDRF)) == 0) {
/* There are no characters available to read. */
return -1;

Loading…
Cancel
Save