Skip to content

Commit 7c24ef4

Browse files
tmediccixiaoxiang781216
authored andcommitted
risc-v/qemu-rv: Initialize the userleds without late initialization
If CONFIG_BOARD_LATE_INITIALIZE is not selected, the userleds will not be initialized. The userled initialization is not required to be done within board_late_initialize(), thus this commit enables initializing it in board_app_initialize() too.
1 parent 2c5d849 commit 7c24ef4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ int board_app_initialize(uintptr_t arg)
146146
qemu_rptun_init();
147147
#endif
148148

149+
#ifdef CONFIG_USERLED
150+
/* Register the LED driver */
151+
152+
int ret = userled_lower_initialize("/dev/userleds");
153+
if (ret < 0)
154+
{
155+
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
156+
}
157+
#endif
158+
149159
return OK;
150160
#endif
151161
}

0 commit comments

Comments
 (0)