acassis opened a new pull request, #20967:
URL: https://github.com/apache/nuttx/pull/20967
## Summary
Fixes found while using a wireless keyboard + touchpad receiver (1611:2800),
whose keyboard and mouse interfaces must work at the same time.
MAX3421E:
- Release the host lock while waiting for the next polling interval of an
interrupt endpoint. An idle endpoint held it until the 5s NAK timeout,
blocking the transfers of the other interfaces.
- Account for the data received before a NAK. A full packet (e.g. an 8-byte
keyboard report) is followed by another IN token; when it was NAKed the
received data was discarded, so no key was ever reported.
- Return when the transfer completes. A short packet did not end the
transfer and the next report overwrote the buffer while the returned length
kept growing.
- Do not retry control transfers that STALL: it is the final answer of the
device and the retries took 25s and flooded the console.
HID keyboard:
- If the device stalls GET_REPORT, read the reports from the interrupt IN
endpoint instead.
- Send SET_PROTOCOL to the keyboard interface instead of interface 0.
- Fix the nxstyle issues of the file.
HID mouse:
- Some devices ignore SET_PROTOCOL(boot) and send report protocol reports
with a report ID. Read the report descriptor; if the mouse report has a report
ID and 8-bit X/Y, select the report protocol, skip the report ID and ignore the
other reports of the interface.
- Do not log a NAK (no data) as an error.
## Impact
User will be able to use mini keyboards with mouse/touchpad integrated.
## Testing
Using the new hidcombo which test mouse and keyboard at the same time:
```
nsh> hidcombo
hidcombo: waiting for 40 events from /dev/kbda and /dev/mouse0
MOUSE buttons=00 x=140 y=120
MOUSE buttons=00 x=120 y=122
MOUSE buttons=00 x=98 y=125
MOUSE buttons=00 x=70 y=141
MOUSE buttons=00 x=43 y=165
MOUSE buttons=00 x=14 y=189
MOUSE buttons=00 x=0 y=212
MOUSE buttons=00 x=0 y=233
MOUSE buttons=00 x=13 y=240
MOUSE buttons=00 x=34 y=240
MOUSE buttons=00 x=57 y=240
MOUSE buttons=00 x=89 y=238
MOUSE buttons=00 x=120 y=223
MOUSE buttons=00 x=146 y=198
MOUSE buttons=00 x=168 y=168
MOUSE buttons=00 x=182 y=138
MOUSE buttons=00 x=185 y=101
MOUSE buttons=00 x=181 y=66
MOUSE buttons=00 x=172 y=42
MOUSE buttons=00 x=161 y=24
MOUSE buttons=00 x=148 y=13
MOUSE buttons=00 x=135 y=5
MOUSE buttons=00 x=123 y=0
MOUSE buttons=00 x=105 y=0
KEY press code=0x61 'a'
KEY release code=0x61 'a'
KEY press code=0x69 'i'
KEY release code=0x69 'i'
KEY press code=0x73 's'
KEY release code=0x73 's'
KEY press code=0x6a 'j'
KEY press code=0x6b 'k'
KEY release code=0x6a 'j'
KEY release code=0x6b 'k'
KEY press code=0x6c 'l'
KEY release code=0x6c 'l'
KEY press code=0x49 'I'
KEY release code=0x49 'I'
KEY press code=0x5a 'Z'
KEY release code=0x5a 'Z'
hidcombo: 16 key events, 24 mouse events
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]