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.

(cherry picked from commit 5e0a68d3ab)

Close #5283
This commit is contained in:
Matteo Concas
2025-06-18 10:12:02 +02:00
parent d010f6ae8b
commit dd490c5c2d

View File

@@ -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;