Open-source keyboard firmware for Atmel AVR and Arm USB families
Go to file
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
.github
.vscode
builddefs Separate RGBLight/RGB Matrix keycode handling (#23679) 2024-10-12 18:43:50 +02:00
data Add svlinky converter (#24449) 2024-10-12 00:16:25 +01:00
docs Rename RGB/HSV structs: keyboard-level code (#24476) 2024-10-12 19:00:56 +01:00
drivers [Core] usb_device_state: consolidate usb state handling across implementations (#24258) 2024-10-18 09:57:08 +02:00
keyboards [Core] usb_device_state: consolidate usb state handling across implementations (#24258) 2024-10-18 09:57:08 +02:00
layouts
lib
platforms Add svlinky converter (#24449) 2024-10-12 00:16:25 +01:00
quantum [Core] usb_device_state: consolidate usb state handling across implementations (#24258) 2024-10-18 09:57:08 +02:00
tests
tmk_core [Core] usb_device_state: consolidate usb state handling across implementations (#24258) 2024-10-18 09:57:08 +02:00
users
util
.clang-format
.clangd
.editorconfig
.gitattributes
.gitignore
.gitmodules
Doxyfile
doxygen-todo
LICENSE
license_GPLv2.md
license_GPLv3.md
license_Modified_BSD.md
Makefile
nose2.cfg
paths.mk
readme.md
requirements-dev.txt
requirements.txt
setup.cfg
shell.nix

THIS IS THE DEVELOP BRANCH

Warning- This is the develop branch of QMK Firmware. You may encounter broken code here. Please see Breaking Changes for more information.

Quantum Mechanical Keyboard Firmware

Current Version Discord Docs Status GitHub contributors GitHub forks

This is a keyboard firmware based on the tmk_keyboard firmware with some useful features for Atmel AVR and ARM controllers, and more specifically, the OLKB product line, the ErgoDox EZ keyboard, and the Clueboard product line.

Documentation

The docs are powered by VitePress. They are also viewable offline; see Previewing the Documentation for more details.

You can request changes by making a fork and opening a pull request.

Supported Keyboards

The project also includes community support for lots of other keyboards.

Maintainers

QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, Hasu. The OLKB product firmwares are maintained by Jack Humbert, the Ergodox EZ by ZSA Technology Labs, the Clueboard by Zach White, and the Atreus by Phil Hagelberg.

Official Website

qmk.fm is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK.