diff options
author | Drashna Jaelre <drashna@live.com> | 2022-07-12 22:18:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 22:18:02 -0700 |
commit | 1dfe2bb49ab9cae1450697bf95d7a4c7bfc18bab (patch) | |
tree | 6804cb3119b6d2a78cc86fb2428d780daba15196 /quantum/rgb_matrix | |
parent | 34fec2c07d8ac8129be06cd31d69aa98b21e64dd (diff) | |
download | qmk_firmware-1dfe2bb49ab9cae1450697bf95d7a4c7bfc18bab.tar.gz qmk_firmware-1dfe2bb49ab9cae1450697bf95d7a4c7bfc18bab.zip |
Update LED/RGB Matrix flag function behavior (#17651)
Diffstat (limited to 'quantum/rgb_matrix')
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix.c | 12 | ||||
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix.h | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/quantum/rgb_matrix/rgb_matrix.c b/quantum/rgb_matrix/rgb_matrix.c index a51e379025..2730686839 100644 --- a/quantum/rgb_matrix/rgb_matrix.c +++ b/quantum/rgb_matrix/rgb_matrix.c @@ -731,10 +731,20 @@ void rgb_matrix_decrease_speed(void) { rgb_matrix_decrease_speed_helper(true); } +void rgb_matrix_set_flags_eeprom_helper(led_flags_t flags, bool write_to_eeprom) { + rgb_matrix_config.flags = flags; + eeconfig_flag_rgb_matrix(write_to_eeprom); + dprintf("rgb matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.flags); +} + led_flags_t rgb_matrix_get_flags(void) { return rgb_matrix_config.flags; } void rgb_matrix_set_flags(led_flags_t flags) { - rgb_matrix_config.flags = flags; + rgb_matrix_set_flags_eeprom_helper(flags, true); +} + +void rgb_matrix_set_flags_noeeprom(led_flags_t flags) { + rgb_matrix_set_flags_eeprom_helper(flags, false); } diff --git a/quantum/rgb_matrix/rgb_matrix.h b/quantum/rgb_matrix/rgb_matrix.h index 359d507a4d..fc9fc3e020 100644 --- a/quantum/rgb_matrix/rgb_matrix.h +++ b/quantum/rgb_matrix/rgb_matrix.h @@ -182,6 +182,7 @@ void rgb_matrix_increase_speed_noeeprom(void); void rgb_matrix_decrease_speed(void); void rgb_matrix_decrease_speed_noeeprom(void); led_flags_t rgb_matrix_get_flags(void); +led_flags_t rgb_matrix_get_flags_noeeprom(void); void rgb_matrix_set_flags(led_flags_t flags); #ifndef RGBLIGHT_ENABLE |