This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch releases/12.13
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/releases/12.13 by this push:
     new 57f73616db5 nucleo-l476rg: register userleds device driver if 
CONFIG_USERLED is set
57f73616db5 is described below

commit 57f73616db5a7e0da05afc37139064a8dc7e9de2
Author: Michal Lenc <[email protected]>
AuthorDate: Sun Mar 22 22:55:01 2026 +0100

    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 <[email protected]>
---
 boards/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 <nuttx/leds/userled.h>
+#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. */
 

Reply via email to