From f07e4e690b16bb91a5951bffc16b38facd0b2e57 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Sun, 22 Mar 2026 22:55:01 +0100 Subject: [PATCH] nucleo-l476rg: register userleds device driver if CONFIG_USERLED is set This enhances the bringup file with /dev/userleds registration if CONFIG_USERLED option is set. Signed-off-by: Michal Lenc --- .../arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c index 0f565664c16..01fd1b277c4 100644 --- a/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c +++ b/boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c @@ -57,6 +57,10 @@ #include "stm32_bmp280.h" #endif +#ifdef CONFIG_USERLED +# include +#endif + #ifdef CONFIG_SENSORS_MPU9250 #include "stm32_mpu9250.h" #endif @@ -247,6 +251,16 @@ int stm32_bringup(void) } #endif +#ifdef CONFIG_USERLED + /* Register the LED driver */ + + ret = userled_lower_initialize("/dev/userleds"); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret); + } +#endif + #ifdef CONFIG_PWM /* Initialize PWM and register the PWM device. */