Skip to content

drivers/usbhost_hidmouse: fix button detection in touchscreen example#18933

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
ldube:master
May 22, 2026
Merged

drivers/usbhost_hidmouse: fix button detection in touchscreen example#18933
xiaoxiang781216 merged 1 commit into
apache:masterfrom
ldube:master

Conversation

@ldube
Copy link
Copy Markdown
Contributor

@ldube ldube commented May 21, 2026

Summary

Fix an issue where button presses were missed in the touchscreen example due to incorrect packet processing.

Previously, the driver waited to accumulate a batch of packets but only processed the first one, effectively discarding the rest. The driver now reads and processes packets one at a time to ensure no input events are lost.

Impact

Testing

Before this change nothing happened when buttons were pressed.

To test, I ran tc and:
Pressed and released left button
Pressed and released middle button
Pressed and released right button

nsh> tc
tc [8:100]
nsh> tc_main: nsamples: 0
tc_main: Opening /dev/mouse0

nsh> Sample :
buttons : 01
x : 3
y : 134
Sample :
buttons : 00
x : 3
y : 134
Sample :
buttons : 04
x : 3
y : 134
Sample :
buttons : 00
x : 3
y : 134
Sample :
buttons : 02
x : 2
y : 139
Sample :
buttons : 00
x : 1
y : 140

Fix an issue where button presses were missed in the touchscreen
example due to incorrect packet processing.

Previously, the driver waited to accumulate a batch of packets but only
processed the first one, effectively discarding the rest. The driver
now reads and processes packets one at a time to ensure no input
events are lost.

Also fixed typo: usbhost_xythreshold does not exist.

Signed-off-by: Lwazi Dube <lwazeh@gmail.com>
@github-actions github-actions Bot added Size: XS The size of the change in this PR is very small Area: USB labels May 21, 2026
@xiaoxiang781216 xiaoxiang781216 merged commit 2b0c59b into apache:master May 22, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: USB Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants