aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol/report.c
Commit message (Collapse)AuthorAgeFilesLines
* [Core] `usb_device_state`: consolidate usb state handling across ↵Stefan Kerkmann2024-10-181-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implementations (#24258) * usb_device_state: add idle_rate, led and protocol Previously all usb drivers and platform implementations (expect for our oddball atsam) tracked the same two global variables: - keyboard_protocol: to indicate if we are in report or boot protocol - keyboard_idle: for the idle_rate of the keyboard endpoint And a local variable that was exposed trough some indirection: - keyboard_led_state: for the currently set indicator leds (caps lock etc.) These have all been moved into the usb_device_state struct wich is accessible by getters and setters. This reduces code duplication and centralizes the state management across platforms and drivers. Signed-off-by: Stefan Kerkmann <karlk90@pm.me> * usb_device_state: reset protocol on reset The usb hid specification section 7.2.6 states: When initialized, all devices default to report protocol. However the host should not make any assumptions about the device’s state and should set the desired protocol whenever initializing a device. Thus on reset we should always do exactly that. Signed-off-by: Stefan Kerkmann <karlk90@pm.me> * keyboards: fix oversize warnings Signed-off-by: Stefan Kerkmann <karlk90@pm.me> --------- Signed-off-by: Stefan Kerkmann <karlk90@pm.me>
* Remove `RING_BUFFERED_6KRO_REPORT_ENABLE` due to disuse. (#24433)Nick Brassel2024-09-241-93/+0
|
* Separate 6KRO and NKRO report structs (#22267)Ryan2023-10-231-18/+19
|
* Prep work for NKRO report separation (#22268)Ryan2023-10-141-4/+4
| | | | | | | | | | | * 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
* Fix mouse-key spamming empty reports (#21663)Stefan Kerkmann2023-08-021-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* [Core] Move `has_mouse_report_changed` function to `report.c` (#16543)Drashna Jaelre2022-03-141-0/+13
| | | | | | | * Move 'has_mouse_report_changed' checkto report.c * change mousekeys to use memcpy * fix linting issues
* Relocate protocol files within tmk_core/common/ (#14972)Joel Challis2021-10-281-0/+280
* Relocate non platform files within tmk_core/common/ * clang