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 <acassis@gmai.com>
Assisted-by: Claude Opus 5.5 (1M context)
This commit is contained in:
Alan Carvalho de Assis 2026-09-24 09:43:51 -03:00 • committed by Alin Jerpelea
parent 843cf6d581
commit e73dd2a9a9

View file

@ -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 */