Commit Graph

5 Commits (abcaf39e6c399f77a846e627324d4b9d9d79fe5f)

Author SHA1 Message Date
Ryan 0c160e1fba
Separate 6KRO and NKRO report structs (#22267) 2023-10-23 15:43:46 +11:00
Ryan 1bff37781b
Prep work for NKRO report separation (#22268)
* Clean up some keyboard/userspace code

* Rename `KEYBOARD_REPORT_BITS` -> `NKRO_REPORT_BITS`

* Add some missing includes

* Use `PACKED` define for report types

* Fix incorrect function signatures for FlexRAM EEPROM driver
2023-10-14 13:21:20 +02:00
Stefan Kerkmann b2d068d1aa
Fix mouse-key spamming empty reports (#21663)
Problem:

`mousekey_task` spams empty hid reports with when a mouse key is
pressed, causing resource exhaustion in the USB mouse endpoint.

Cause:

The check whether or not to send a new mouse report would always
evaluate to true if a mouse key is pressed:

1. `mouse_report` has non-zero fields and `tmpmr` is a copy of this
   fields.
2. `mouse_report` is set to zero, `tmpmr` has now non-zero fields.
3. `has_mouse_report_changed` compares the two and evaluates to true
4. a mouse report is sent.

Fix:

The check condition of `has_mouse_report_changed` will evaluate any
empty record as unchanged, as mouse report data is relative and doesn't
need to return to zero. An empty report will still be send by
`register_mouse` on release of all mouse buttons.
2023-08-02 13:47:25 +02:00
Drashna Jaelre 921b9dad6c
[Core] Move `has_mouse_report_changed` function to `report.c` (#16543)
* Move 'has_mouse_report_changed' checkto report.c

* change mousekeys to use memcpy

* fix linting issues
2022-03-14 00:01:47 +00:00
Joel Challis dcfffa7b67
Relocate protocol files within tmk_core/common/ (#14972)
* Relocate non platform files within tmk_core/common/

* clang
2021-10-28 22:31:59 +01:00