Skip to content
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

Fix missing define to map rgb_matrix function set to rgblight. #11084

Merged
merged 3 commits into from
Dec 5, 2020

Conversation

ruddy17
Copy link
Contributor

@ruddy17 ruddy17 commented Nov 30, 2020

Necessary fix for rgb_matrix to work with via configurator.

Description

VIA configurator, a well known and convenient tool for changing settings and binds via generic HID protocol, allows to control rgblight QMK module. However, there is rgb_matrix - a separate LED module with more features and fancy effects. Right now a developer has to choose between having rgb_matrix and having VIA support. This PR aims to fix this.

In the core of QMK there is a list of defines that directly map rgb_matrix functions to rgblight ones (see rgb_matrix.h lines 152:192). The control interfaces of both rgblight and rgb_matrix are practically the same. The only function VIA uses that is not mapped is eeconfig_update_rgblight_current , and this PR fixes this.

Now VIA does not have a template for rgb_matrix, but we can use it's ability to extend an existing config and define our own effect list that matches rgb_matrix effects. Another catch is that VIA effect speed slider range is 0..3, while qmk expects 0..255. For the sake of cleanness of the code base I suggest that effect speed setting is disabled in VIA config (it is still adjustable by keycodes RGB_SPI and RGB_SPD). If VIA devs find time to work on this, a new option of "lighting":"qmk_rgb_matrix" parameter may be added, that incorporates necessary changes.

As a result of this fix one can set VIA_ENABLE = yes and RGB_MATRIX_ENABLE = WS2812 and expect it to succesfully compile and work as expected. It was tested thoroughly on a live device (geekboards macropad v2) with no problems observed. I am willing to help test this with any other board that supports via+rgblight.

Example of VIA config

Demo video

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

This is necessary for rgb_matrix to work with via configurator.
@github-actions github-actions bot added the core label Nov 30, 2020
@tzarc tzarc requested a review from a team December 4, 2020 11:05
@fauxpark
Copy link
Member

fauxpark commented Dec 5, 2020

Thanks!

@fauxpark fauxpark closed this Dec 5, 2020
@fauxpark fauxpark reopened this Dec 5, 2020
@fauxpark fauxpark merged commit e388828 into qmk:master Dec 5, 2020
@fauxpark
Copy link
Member

fauxpark commented Dec 5, 2020

Wrong button...

xgnxs pushed a commit to xgnxs/qmk_firmware that referenced this pull request Jan 9, 2021
drashna pushed a commit to zsa/qmk_firmware that referenced this pull request Jan 13, 2021
mgmanzella pushed a commit to mgmanzella/qmk_firmware that referenced this pull request Feb 16, 2021
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants