Commit Graph

117 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
6fa11bf219
Separate RGBLight/RGB Matrix keycode handling (#23679)
* Separate RGBLight/RGB Matrix keycode handling

* Remove `_DISABLE_KEYCODES` handling

* Update RGB Matrix keycode docs

* Update underglow keycodes for previously migrated boards

* Update keycodes for boards with custom handling

* Fix typos

* Fix bad merge
2024-10-12 18:43:50 +02:00
Ryan
208ebf54a9
WS2812 API rework (#24364)
* Begin WS2812 API rework

* Move RGBW conversion, clean up color.h, fix RGBW for AVR bitbang

* Formatting & update PS2AVRGB I2C driver (untested)

* Tested ARM bitbang RGB+RGBW

* Tested ARM SPI RGB - RGBW not working

* Tested ARM PWM RGB+RGBW

* Tested RP2040 PIO driver RGB+RGBW

* Update RGBLight

* Formatting

* Fix BM60HSRGB rev2

* Fix oddforge/vea

* Fix 1k and XD002 RGBLite

* Fix model_m/mschwingen

* Fix handwired/promethium

* Rename `WS2812_LED_TOTAL` for BM60HSRGB

* Fix work_louder boards

* Fix dawn60

* Fix rgbkb/pan

* Fix neson_design/700e and n6

* Fix ergodox_ez/shine

* ergodox_ez/shine: invert indices for left half

* Fix matrix/abelx

* Fix matrix/m20add

* Remove custom rgblight driver for matrix/noah - should be done with lighting layers

* Fix LED indexes for RGBLight split

* Rename `convert_rgb_to_rgbw()` to `ws2812_rgb_to_rgbw()`

* Update WS2812 API docs

* `ergodox_ez/shine`: simplify LED index calculation

* LED/RGB Matrix: Add weak function for LED index resolution

* Bandaid fix for RGB Matrix splits not using WS2812

* `steelseries/prime_plus`: redo custom RGBLight driver

* Update keyboards/steelseries/prime_plus/rgblight_custom.c

Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>

---------

Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
2024-10-06 21:01:07 +13:00
Nick Brassel
45dc2499dc
Remove all via-enabled keymaps, including via. (#24322) 2024-08-26 07:51:22 +10:00
Ryan
275e9de350
Remove pointless RGB_MATRIX_LED_COUNTs (#24133) 2024-07-17 16:13:40 +01:00
Ryan
1552cf2ddc
Update atomic GPIO macros in keyboard custom matrix (#23796) 2024-07-13 18:41:05 +10:00
Joel Challis
07253bfe4a
Relocate work_louder VIA logic (#24011) 2024-06-29 09:33:20 +01:00
Ryan
e96d6d9bd4
Migrate RGB Matrix layout for two boards (#23963) 2024-06-23 04:08:57 +01:00
Ryan
b8f29c3865
Update GPIO macros in keymaps (#23792) 2024-05-24 19:38:57 +01:00
Ryan
5c592ab0c0
Delete trivial keymap readmes (#23714) 2024-05-17 23:49:29 +01:00
Ryan
1184e0d9be
Adjust keycode alignment around QK_BOOT (#23697) 2024-05-11 16:50:48 +01:00
Ryan
d09a06a1b3
Update GPIO API usage in keyboard code (#23361) 2024-05-03 15:21:29 +10:00
Joel Challis
e9b8929357
Migrate build target markers to keyboard.json - Misc (#23612) 2024-04-25 10:37:44 -07:00
Joel Challis
43a122e050
Migrate build target markers to keyboard.json - W (#23511) 2024-04-13 06:31:34 +01:00
Ryan
c635733a7f
Remove quantum.h includes from keyboard code (#23394) 2024-04-03 10:44:25 +11:00
Joel Challis
831deac212
Migrate build target markers to keyboard.json (#23293) 2024-03-30 11:31:50 +00:00
Ryan
f7cf40fa77
Add init function to RGBLight driver struct (#23076) 2024-03-18 22:03:27 +11:00
jack
aa33d8ba8e
Fixup work_board (#23266)
* initial

* Update keyboards/work_louder/work_board/keymaps/default/keymap.c

Co-authored-by: Drashna Jaelre <drashna@live.com>

---------

Co-authored-by: Drashna Jaelre <drashna@live.com>
2024-03-12 16:31:51 -06:00
Joel Challis
2f37a7854d
Migrate lighting defaults to info.json (#22920) 2024-02-01 18:10:14 +00:00
Joel Challis
e1f59a6efc
Migrate RGB Matrix config to info.json - TUVW (#22910) 2024-01-16 01:16:31 +00:00
Ryan
8812a09581
Rename RGB_DISABLE_WHEN_USB_SUSPENDED -> RGB_MATRIX_SLEEP (#22682) 2023-12-20 13:31:50 +11:00
Ryan
17f36a21bf
Rework RGBLight driver system (#22529) 2023-12-05 22:49:14 +11:00
Joel Challis
1ed03f498f
Remove userspace keymaps (#22544) 2023-11-27 05:36:45 +11:00
Ryan
41bd4e35a0
Clean up RGB LED type (#21859) 2023-09-04 01:19:59 +01:00
Ryan
023d644bb6
Move RGBLight animations to data driven (#21635)
* Move RGBLight animations to data driven, 0-9

* Move RGBLight animations to data driven, A

* Move RGBLight animations to data driven, B

* Move RGBLight animations to data driven, C

* Move RGBLight animations to data driven, D

* Move RGBLight animations to data driven, E

* Move RGBLight animations to data driven, F

* Move RGBLight animations to data driven, G

* Move RGBLight animations to data driven, H

* Move RGBLight animations to data driven, handwired

* Move RGBLight animations to data driven, I

* Move RGBLight animations to data driven, J

* Move RGBLight animations to data driven, K

* Move RGBLight animations to data driven, L

* Move RGBLight animations to data driven, M

* Move RGBLight animations to data driven, N

* Move RGBLight animations to data driven, O

* Move RGBLight animations to data driven, P

* Move RGBLight animations to data driven, Q

* Move RGBLight animations to data driven, R

* Move RGBLight animations to data driven, S

* Move RGBLight animations to data driven, T

* Move RGBLight animations to data driven, U

* Move RGBLight animations to data driven, V

* Move RGBLight animations to data driven, W

* Move RGBLight animations to data driven, X

* Move RGBLight animations to data driven, Y

* Move RGBLight animations to data driven, Z

* Fix incorrect placement

* Fix build failures and mismatches
2023-08-23 22:11:39 +01:00
Ryan
37bc949945
RGB Matrix: driver naming cleanups (#21594) 2023-08-23 01:00:03 +01:00
Joel Challis
dfb6d38f08
Simplfy RGB/LED matrix effect logic (#21703) 2023-08-23 00:03:01 +01:00
Ryan
87b11345a5
Get rid of USB_LED_CAPS_LOCK (#21436) 2023-07-06 09:48:02 +01:00
Ryan
4ae9bfd17a
Move RGBLIGHT_HUE/SAT/VAL_STEP to data driven (#21292)
Co-authored-by: Nick Brassel <nick@tzarc.org>
2023-06-24 17:37:54 +10:00
Ryan
b1783db4ea
Move RGBLED_NUM to data driven (#21278) 2023-06-18 14:39:07 +10:00
Ryan
2367d8129c
Move RGBLIGHT_SLEEP to data driven (#21072) 2023-06-16 14:04:45 +10:00
Drashna Jaelre
3a3e5abac9
[Keymap] Drashna Keymap updates for 0.21.0 (#21073) 2023-05-31 11:44:06 -07:00
Ryan
363bfdbfda
Move RGBLIGHT_LIMIT_VAL to data driven (#20974)
Co-authored-by: Nick Brassel <nick@tzarc.org>
2023-05-27 12:27:44 +10:00
Ryan
ef6a712899
Even more info.json whitespace cleanups (#20703) 2023-05-04 19:09:59 +10:00
Ryan
2944e93870
Move USB_MAX_POWER_CONSUMPTION to data driven (#20648) 2023-05-01 17:37:12 +10:00
Nick Brassel
c9f619124d
Encodermap direction define. (#20454) 2023-04-15 16:18:44 +01:00
Ryan
a84528f853
Move remaining LAYOUTs to data driven (#20422) 2023-04-15 21:07:32 +10:00
Ryan
522048725f
Move RGB_MATRIX_DRIVER to data driven (#20350) 2023-04-08 18:08:08 +10:00
Ryan
47966dc2a6
Migrate rgblight.pin and RGB_DI_PIN to ws2812.pin (#20303) 2023-04-06 18:00:54 +10:00
QMK Bot
89713112cd Merge remote-tracking branch 'origin/master' into develop 2023-04-05 18:36:25 +00:00
Luis Garcia
d058091d0b
Add peterfalken userspace & keymaps (#19897)
Co-authored-by: Peter.Falken <luis.garcia@bitjester.com>
2023-04-05 12:35:34 -06:00
Ryan
364c06d939
Move small macropad-ish layouts to data driven (#20341) 2023-04-05 15:46:59 +10:00
jack
36ab0c0aaa
Add core/fallback encoder behaviour (#20320) 2023-04-03 10:18:17 -06:00
Ryan
647c2835e6
WS2812 driver improvements (#20262) 2023-03-30 12:21:02 +11:00
Ryan
1e07ff1fb1
Fix some more missing #pragma onces (#20241) 2023-03-23 17:21:37 +00:00
Ryan
3c144fac5e
Clean up usage of QMK_KEYBOARD_H (#20167) 2023-03-20 08:12:05 +11:00
Ryan
e933e0411f
Move matrix config to info.json, part 5 (#20003)
Co-authored-by: Nick Brassel <nick@tzarc.org>
2023-03-11 05:41:58 +11:00
Ryan
7e0299117b
Move encoder config to data driven (#19923)
Co-authored-by: Nick Brassel <nick@tzarc.org>
2023-02-26 09:45:12 +11:00
Ryan
ea77246865
Migrate some more layouts to data driven (#19889) 2023-02-23 09:32:18 +11:00
Nick Brassel
7f805cc779
VIA Protocol 12 + fixes (#19916)
Co-authored-by: Wilba <wilba@wilba.tech>
Co-authored-by: zvecr <git@zvecr.com>
2023-02-23 09:19:00 +11:00