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

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

commit e73dd2a9a912677ebb49bcfdd92d7429ae495ccd
Author: Alan Carvalho de Assis <[email protected]>
AuthorDate: Thu Sep 24 09:43:51 2026 -0300

    boards/sim: register /dev/mouse0 when CONFIG_SIM_MOUSE is enabled
    
    The X11 mouse emulation driver (arch/sim/src/sim/sim_mouse.c) is built
    and fed by the X11 event loop whenever CONFIG_SIM_MOUSE=y, but nothing
    ever called sim_mouse_initialize(), so /dev/mouse0 was never registered
    and applications could not read any mouse reports.  Since nothing
    referenced sim_mouse.o, the linker did not even pull it in and the
    build failed with "undefined reference to `sim_mouseevent'".
    
    Call sim_mouse_initialize(0) from sim_bringup(), next to the existing
    touchscreen and keyboard initialization.
    
    Tested with sim:nsh + CONFIG_SIM_X11FB, CONFIG_SIM_MOUSE and
    CONFIG_SIM_KEYBOARD: /dev/mouse0 is now listed and reports left, middle
    and right button state plus pointer motion.
    
    Signed-off-by: Alan C. Assis <[email protected]>
    Assisted-by: Claude Opus 5.5 (1M context)
---
 boards/sim/sim/sim/src/sim_bringup.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/boards/sim/sim/sim/src/sim_bringup.c 
b/boards/sim/sim/sim/src/sim_bringup.c
index 3064b1e1a39..278ab4c698c 100644
--- a/boards/sim/sim/sim/src/sim_bringup.c
+++ b/boards/sim/sim/sim/src/sim_bringup.c
@@ -369,6 +369,16 @@ int sim_bringup(void)
     }
 #endif
 
+#ifdef CONFIG_SIM_MOUSE
+  /* Initialize the mouse */
+
+  ret = sim_mouse_initialize(0);
+  if (ret < 0)
+    {
+      syslog(LOG_ERR, "ERROR: sim_mouse_initialize failed: %d\n", ret);
+    }
+#endif
+
 #ifdef CONFIG_SIM_KEYBOARD
   /* Initialize the keyboard */
 

Reply via email to