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

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


The following commit(s) were added to refs/heads/master by this push:
     new 7c24ef438e risc-v/qemu-rv: Initialize the userleds without late 
initialization
7c24ef438e is described below

commit 7c24ef438e85b50ae0e287afae6203f57a9a5f6f
Author: Tiago Medicci Serrano <tiago.medi...@espressif.com>
AuthorDate: Fri Jan 3 11:45:42 2025 -0300

    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.
---
 boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c 
b/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c
index d86ed5764b..36af65dcf7 100644
--- a/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c
+++ b/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_appinit.c
@@ -146,6 +146,16 @@ int board_app_initialize(uintptr_t arg)
   qemu_rptun_init();
 #endif
 
+#ifdef CONFIG_USERLED
+  /* Register the LED driver */
+
+  int ret = userled_lower_initialize("/dev/userleds");
+  if (ret < 0)
+    {
+      syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
+    }
+#endif
+
   return OK;
 #endif
 }

Reply via email to