From 2bcba4d85e44d8b83e32e19e0e0ffdace70efe4a Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Thu, 25 Jul 2024 14:39:11 +0200 Subject: [PATCH] drivers/drivers_initialize.c: check if only one console is selected Check if only one driver is used as console to avoid a non-working console because a different one is selected and has higher priority than the one we wanted --- drivers/drivers_initialize.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/drivers_initialize.c b/drivers/drivers_initialize.c index 8a52b47c3d2..36b59b4c1f2 100644 --- a/drivers/drivers_initialize.c +++ b/drivers/drivers_initialize.c @@ -49,6 +49,21 @@ #include #include +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Check if only one console device is selected. + * If you get this errro, search your .config file for CONSOLE_XXX_CONSOLE + * options and remove what is not needed. + */ + +#if (defined(CONFIG_LWL_CONSOLE) + defined(CONFIG_SERIAL_CONSOLE) + \ + defined(CONFIG_CDCACM_CONSOLE) + defined(CONFIG_PL2303_CONSOLE) + \ + defined(CONFIG_SERIAL_RTT_CONSOLE) + defined(CONFIG_RPMSG_UART_CONSOLE)) > 1 +# error More than one console driver selected. Check your configuration ! +#endif + /**************************************************************************** * Public Functions ****************************************************************************/