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

[Bug] RGB matrix lighting broken on K-type due to incorrect LED_FLAGS #15273

Closed
Andrew-Fahmy opened this issue Nov 23, 2021 · 3 comments
Closed

Comments

@Andrew-Fahmy
Copy link

On my K-type the rgb matrix lighting stops working if I unplug it or reflash it. I have to manually set the led flags like this:

void keyboard_post_init_user(void) {
    rgb_matrix_set_flags(0xFF);
}

It looks like the rgb_matrix_config.flags defaults to 0 and then overwrite the rgb_effect_params.flags here

    if (rgb_effect_params.flags != rgb_matrix_config.flags) {
        rgb_effect_params.flags = rgb_matrix_config.flags;
        rgb_matrix_set_color_all(0, 0, 0);
    }

I updated my keyboard for the first time in a while and when I did this was the issue that I was getting. Could this be something specific to my keyboard or my config?

@filterpaper
Copy link
Contributor

You can try clearing the EEPROM, rgb_matrix_config.flags should use LED_FLAG_ALL as default:
https://github.com/qmk/qmk_firmware/blob/master/quantum/rgb_matrix/rgb_matrix.c#L152

@Andrew-Fahmy
Copy link
Author

It seems like that function is not being called. If I call it manually from keyboard_post_init_user it works. When looking into the the rgb_matrix_config there is a comment before the flags that says EECONFIG needs to be increased to support this here. My guess is that the first three variables are stored in EEPROM so they are correctly loaded, but the flags and speed are not so they default to 0.

If that is the case it could be solved by defaulting the flags to LED_FLAG_ALL statically:

rgb_config_t rgb_matrix_config = { .flags = LED_FLAG_ALL };

This is a bit of a hack but fixed my keyboard for now.

@Andrew-Fahmy Andrew-Fahmy mentioned this issue Dec 5, 2021
14 tasks
@Andrew-Fahmy
Copy link
Author

It looks like this is a known issue. #13164 talks about it more. For now I will implement a similar solution to the one on the whitefox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants