-
-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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 missing rgb matrix default parameters #22281
Conversation
Consider
The desire to have this happen on EEPROM reset and the desire to avoid EEPROM writes seems to be at odds, but avoiding writes is why the All that aside:
|
@lesshonor Thank you for your suggestion. Using void eeconfig_init_user(void) {
// Use non noeeprom versions to write to EEPROM as well
rgb_matrix_set_flags(LED_FLAG_NONE); // Select the default RGB matrix flag (disable RGB effect by default)
} It just does not work: all the default parameters set by void eeconfig_update_rgb_matrix_default(void) {
dprintf("eeconfig_update_rgb_matrix_default\n");
rgb_matrix_config.enable = 1;
rgb_matrix_config.mode = RGB_MATRIX_DEFAULT_MODE;
rgb_matrix_config.hsv = (HSV){RGB_MATRIX_DEFAULT_HUE, RGB_MATRIX_DEFAULT_SAT, RGB_MATRIX_DEFAULT_VAL};
rgb_matrix_config.speed = RGB_MATRIX_DEFAULT_SPD;
rgb_matrix_config.flags = LED_FLAG_ALL;
eeconfig_flush_rgb_matrix(true);
} seems to override what I do in However, if you have ideas of why Finally, what I meant by avoiding multiple write to the EEPROM is that, by using the proposed new preprocessor #define directive, the rgb matrix defaults are only written once to the EEPROM by Can you confirm that void eeconfig_init_user(void) {
// Use non noeeprom versions to write to EEPROM as well
rgb_matrix_set_flags(LED_FLAG_NONE); // Select the default RGB matrix flag (disable RGB effect by default)
} has no effect? Or am I missing something? It does have an effect in (sorry for the |
OK: on the |
Note that the example regarding |
Truthfully, I'm not sure you actually need this function if all you want to do is make sure the lights are off when you reset the EEPROM. Have you tried setting I wasn't aware of (...or perhaps had just forgotten about) zvecr's PR when I left that comment, so you probably want to review that. My point was that new configuration settings require additions to QMK's data-driven JSON schema—they cannot exist in C alone. |
I am customizing a keychron q6 keyboard based on what Keychron released here: You can look at what they did in |
bd815f0
to
df3c412
Compare
I resolved the conflicts that occurred by changing the target branch. In short:
|
df3c412
to
5e88a74
Compare
I just tested this on a quite recent state of the It would allow one to now put the following in a #pragma once
#define RGB_MATRIX_DEFAULT_ON true // Sets the default enabled state, if none has been set
#define RGB_MATRIX_DEFAULT_FLAG LED_FLAG_NONE // Sets the default LED flags, if none has been set which is useful to initially (after a EEPROM reset only) power off the rgb effect while preserving the host indicators LEDs (caps lock, num lock) when using a Keychron q6 keyboard (see |
Thank you for your contribution! |
Hello guys, the github-actions bot wants to close this PR as there has been no feedback for 45 days, apparently. As a reminder, this PR is ready, and its status should be |
Co-authored-by: Ryan <fauxpark@gmail.com>
Thank you for your review, the suggestions have been applied. |
This PR proposes to add the missing configurable rgb matrix default parameters in
quantum/rgb_matrix/rgb_matrix.c
.Description
quantum/rgb_matrix/rgb_matrix.c
offers the possibility of configuring the following rgb matrix parameters in aconfig.h
file:RGB_MATRIX_DEFAULT_MODE
RGB_MATRIX_DEFAULT_HUE
RGB_MATRIX_DEFAULT_SAT
RGB_MATRIX_DEFAULT_VAL
RGB_MATRIX_DEFAULT_SPD
However, there is no way of configuring the default
rgb_matrix_config
flags nor the defaultrgb_matrix_config
enable-disable status. Therefore, the followingconfig.h
options have been added:RGB_MATRIX_DEFAULT_STATUS
RGB_MATRIX_DEFAULT_FLAG
For example, this will allow to directly configure the following default rgb matrix option (after an EEPROM reset) in a
config.h
file:Currently, I have to rely on the use of
keyboard_post_init_user()
in akeymap.c
file:However, this applies at each boot (and not only at each EEPROM reset, as wished). Additionally, it unnecessarily causes multiple write to the EEPROM. This could be avoided by directly specifying the desired (not supported yet) default options in a
config.h
. Then,eeconfig_update_rgb_matrix_default()
will directly take care of them.Types of Changes
Issues Fixed or Closed by This PR
I am not aware of an issue opened for that.
Checklist