Commit Graph

10 Commits

Author SHA1 Message Date
Stefan Kerkmann
3f9d464412
[Core] usb_device_state: consolidate usb state handling across 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>
2024-10-18 09:57:08 +02:00
Ryan
2d1aed78a6
Update GPIO macro usages in core (#23093) 2024-02-18 17:08:27 +11:00
jacob-w-gable
99290b4c7e
Add full solenoid support on split keyboards (#21583)
Co-authored-by: Jacob Gable <jacob.gable@statheros.tech>
2023-09-25 12:23:31 +10:00
Ryan
0b802defd4
haptic: further naming cleanups (#21682) 2023-08-04 01:16:16 +01:00
Ryan
b090354143
haptic: naming cleanups (#21551) 2023-07-21 09:17:39 +10:00
Drashna Jaelre
b585ece5ef
Add Split support for Haptic feedback (#19203) 2023-01-01 11:56:32 +11:00
Drashna Jaelre
f090881aeb
[Feature] Add support for multiple switchs/solenoids to Haptic Feedback engine (#15657) 2022-05-15 21:24:35 +10:00
QMK Bot
63646e8906
Format code according to conventions (#16322) 2022-02-12 18:29:31 +00:00
Purdea Andrei
76fb54403c
haptic: Feature to disable it when usb port is not configured or suspended. (#12692)
This also add support for specifying a LED pin to indicate haptic status,
and also adds support for a haptic-enable pin, which is useful to turn off
the boost converter on the solenoid driver.
2021-11-02 16:54:29 +11:00
Joel Challis
f945c352e7
Haptic: driver-> feature (#13713) 2021-07-25 19:14:58 -07:00