mirror of
https://github.com/apache/nuttx.git
synced 2026-09-30 11:03:53 +00:00
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:
parent
843cf6d581
commit
e73dd2a9a9
1 changed files with 10 additions and 0 deletions
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue