summaryrefslogtreecommitdiff
path: root/quantum/led_matrix
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2022-07-12 22:18:02 -0700
committerGitHub <noreply@github.com>2022-07-12 22:18:02 -0700
commit1dfe2bb49ab9cae1450697bf95d7a4c7bfc18bab (patch)
tree6804cb3119b6d2a78cc86fb2428d780daba15196 /quantum/led_matrix
parent34fec2c07d8ac8129be06cd31d69aa98b21e64dd (diff)
downloadqmk_firmware-1dfe2bb49ab9cae1450697bf95d7a4c7bfc18bab.tar.gz
qmk_firmware-1dfe2bb49ab9cae1450697bf95d7a4c7bfc18bab.zip
Update LED/RGB Matrix flag function behavior (#17651)
Diffstat (limited to 'quantum/led_matrix')
-rw-r--r--quantum/led_matrix/led_matrix.c14
-rw-r--r--quantum/led_matrix/led_matrix.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c
index 38ed79bed0..75a0aba5a0 100644
--- a/quantum/led_matrix/led_matrix.c
+++ b/quantum/led_matrix/led_matrix.c
@@ -618,10 +618,20 @@ void led_matrix_decrease_speed(void) {
led_matrix_decrease_speed_helper(true);
}
+void led_matrix_set_flags_eeprom_helper(led_flags_t flags, bool write_to_eeprom) {
+ led_matrix_config.flags = flags;
+ eeconfig_flag_led_matrix(write_to_eeprom);
+ dprintf("led matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_config.flags);
+}
+
led_flags_t led_matrix_get_flags(void) {
- return led_matrix_eeconfig.flags;
+ return led_matrix_config.flags;
}
void led_matrix_set_flags(led_flags_t flags) {
- led_matrix_eeconfig.flags = flags;
+ led_matrix_set_flags_eeprom_helper(flags, true);
+}
+
+void led_matrix_set_flags_noeeprom(led_flags_t flags) {
+ led_matrix_set_flags_eeprom_helper(flags, false);
}
diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h
index d21f36e295..b2abec7eb1 100644
--- a/quantum/led_matrix/led_matrix.h
+++ b/quantum/led_matrix/led_matrix.h
@@ -158,6 +158,7 @@ void led_matrix_decrease_speed(void);
void led_matrix_decrease_speed_noeeprom(void);
led_flags_t led_matrix_get_flags(void);
void led_matrix_set_flags(led_flags_t flags);
+void led_matrix_set_flags_noeeprom(led_flags_t flags);
typedef struct {
/* Perform any initialisation required for the other driver functions to work. */