Skip to content

Commit 57f7361

Browse files
michallencxiaoxiang781216
authored andcommitted
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 <michallenc@seznam.cz>
1 parent bd69071 commit 57f7361

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

boards/arm/stm32l4/nucleo-l476rg/src/stm32_bringup.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
#include "stm32_bmp280.h"
5858
#endif
5959

60+
#ifdef CONFIG_USERLED
61+
# include <nuttx/leds/userled.h>
62+
#endif
63+
6064
#ifdef CONFIG_SENSORS_MPU9250
6165
#include "stm32_mpu9250.h"
6266
#endif
@@ -247,6 +251,16 @@ int stm32_bringup(void)
247251
}
248252
#endif
249253

254+
#ifdef CONFIG_USERLED
255+
/* Register the LED driver */
256+
257+
ret = userled_lower_initialize("/dev/userleds");
258+
if (ret < 0)
259+
{
260+
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
261+
}
262+
#endif
263+
250264
#ifdef CONFIG_PWM
251265
/* Initialize PWM and register the PWM device. */
252266

0 commit comments

Comments
 (0)