From 5e0a68d3ab6bedb16e465267310c59c25803b783 Mon Sep 17 00:00:00 2001 From: Matteo Concas Date: Wed, 18 Jun 2025 10:12:02 +0200 Subject: [PATCH] bsps/noelv: Fix using console in polled mode Before, the console driver needed `BSP_CONSOLE_USE_INTERRUPTS` to be defined or it would not build. The intent was to use polled mode if the macro was equal to zero. This change makes it so interrupt mode is used if the macro is defined and polled mode is used if the macro is not defined. --- bsps/riscv/noel/console/console-config.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bsps/riscv/noel/console/console-config.c b/bsps/riscv/noel/console/console-config.c index c2f8aaa8b3..7e7cd06a2b 100644 --- a/bsps/riscv/noel/console/console-config.c +++ b/bsps/riscv/noel/console/console-config.c @@ -181,11 +181,14 @@ rtems_status_code console_initialize( rtems_termios_initialize(); - const rtems_termios_device_handler *handler = &apbuart_handler_polled; + const rtems_termios_device_handler *handler; - if (BSP_CONSOLE_USE_INTERRUPTS) { +#ifdef BSP_CONSOLE_USE_INTERRUPTS handler = &apbuart_handler_interrupt; - } +#else + handler = &apbuart_handler_polled; +#endif + for (size_t i = 0; i < apbuart_devices; ++i) { struct apbuart_context *ctx;