-
-
Notifications
You must be signed in to change notification settings - Fork 38.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add VIA support for QMK backlight, QMK RGBLight #7911
Conversation
@fcoury Thank you for your work, I had to change how some of it worked as the mapping of RGBLight modes you did wasn't compatible with the enums being conditionally defined when keyboards disable some modes. |
@Wilba6582 really glad to see this closer to being released, thanks a lot for your (re)work and review here. |
The implentation for animation speed would only works for rgblight_matrix I believe, rgblight underglow still just uses mode - base_mode: qmk_firmware/quantum/rgblight.c Line 745 in 7ba6456
I'll test it later and post my results. |
Effect speed was added to the protocol in case this is used in future by RGBLight (i.e. it doesn't do anything at present with the "underglow" modes). It's also there in case someone wants to do a custom implementation at the keyboard level. As I mentioned already, this PR does not try to refactor the current system of embedding effect speeds into the mode enum, or do any mapping or subset of available modes, just connect the existing RGBLight to VIA's UI so end users can pick a mode and color. |
Tested this PR as working for rgblight in mxss with no config, and with custom backlighting enabled too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM =)
Looks like 667045b caused a conflict (clang-format do be like that). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some tiny clang-format related things. Worth running it on via.[ch] too.
* Add VIA support for QMK backlight, QMK RGBLight * clang-format changes
* Add VIA support for QMK backlight, QMK RGBLight * clang-format changes
* Add VIA support for QMK backlight, QMK RGBLight * clang-format changes
* Add VIA support for QMK backlight, QMK RGBLight * clang-format changes
* Add VIA support for QMK backlight, QMK RGBLight * clang-format changes
* Add VIA support for QMK backlight, QMK RGBLight * clang-format changes
This PR adds VIA support for QMK core's backlight and RGBLight (aka. RGB underglow).
Description
VIA developers are working on a fully generalized solution to the problem of keyboards having many different lighting implementations. This PR focusses on bringing VIA support to the many keyboards already in QMK which use QMK's backlight and/or RGBLight features. It is minimal and matches the current set of lighting parameters that exist now, in order to support keyboards already in QMK now, while we work on a more generalized solution that can handle keyboards that have specific differences to the majority, such as indicator LEDs.
By default, if a keyboard enables
BACKLIGHT_ENABLE
and/orRGBLIGHT_ENABLE
, and alsoVIA_ENABLE
, thenvia.c
will compile in the protocol handling for what VIA will require to connect the user interface controls to the lighting parameters. There is also a way of overriding the default behaviour and allowing keyboard-level code to handle the VIA protocol. Keyboards by wilba.tech, yiancardesigns and cannonkeys do this. For keyboards that disable some of the RGBLight modes, this will require overriding the default behaviour of VIA and explicitly defining the mode names in the .json file that VIA uses for that keyboard.There are some minor changes to QMK Core's backlight and RGBLight code to support how VIA will throttle the amount of EEPROM updates that occur by delaying the sending of a
id_lighting_save
until a timeout after the last send ofid_lighting_set_value
. This allows fast changing brightness and color changing (through sliders/color pickers) to not cause a lot of redundant EEPROM updates. This is whyeeconfig_update_backlight_current(void)
andeeconfig_update_rgblight_current(void)
were added, andvia.c
calls functions that change the lighting parameters without the EEPROM update.In the
<keyboard>.json
file that VIA uses:"lighting": "qmk_backlight"
- keyboard uses QMK backlight only (or a custom overide)"lighting": "qmk_rgblight"
- keyboard uses QMK RGBLight only (or a custom overide)"lighting": "qmk_backlight_rgblight"
- keyboard uses both QMK backlight and QMK RGBLight (or a custom overide)VIA developers are working hard on VIA and helping people to add keyboards, as well as designing a system to support QMK's greatest strength, the ability to customize firmware. We appreciate people's patience and understanding that we cannot support every keyboards's specific needs at this time.
Types of Changes
Core
Bugfix
New feature
Enhancement/optimization
Keyboard (addition or update)
Keymap/layout/userspace (addition or update)
Documentation
Checklist