summaryrefslogtreecommitdiffstats
path: root/quantum/led_matrix
diff options
context:
space:
mode:
authorlokher <lokher@gmail.com>2022-09-13 11:13:00 +0800
committerlokher <lokher@gmail.com>2022-09-13 11:13:00 +0800
commitfe13cedf8c09fa34d5cec4e4c624738095176625 (patch)
tree818436626d49c7f22f325632b2053edba10d4358 /quantum/led_matrix
parentfa207545a9759c50b9f230eb608d86a9085801d4 (diff)
parentf46379f308783994b8178f95adc686f4b4c3ebd8 (diff)
merge upstream master
Diffstat (limited to 'quantum/led_matrix')
-rw-r--r--quantum/led_matrix/led_matrix.c12
-rw-r--r--quantum/led_matrix/led_matrix.h3
-rw-r--r--quantum/led_matrix/led_matrix_drivers.c7
3 files changed, 15 insertions, 7 deletions
diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c
index e79138132b..67898d5f18 100644
--- a/quantum/led_matrix/led_matrix.c
+++ b/quantum/led_matrix/led_matrix.c
@@ -676,12 +676,22 @@ 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_eeconfig.flags = flags;
+ eeconfig_flag_led_matrix(write_to_eeprom);
+ dprintf("led matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.flags);
+}
+
led_flags_t led_matrix_get_flags(void) {
return led_matrix_eeconfig.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);
}
#if LED_DISABLE_TIMEOUT > 0
diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h
index 963992fb55..936083c259 100644
--- a/quantum/led_matrix/led_matrix.h
+++ b/quantum/led_matrix/led_matrix.h
@@ -167,6 +167,8 @@ 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);
+
#ifdef LED_DISABLE_TIMEOUT
# if LED_DISABLE_TIMEOUT > 0
void led_matrix_disable_timeout_set(uint32_t timeout);
@@ -180,7 +182,6 @@ bool led_matrix_is_driver_shutdown(void);
bool led_matrix_driver_allow_shutdown(void);
#endif
-
typedef struct {
/* Perform any initialisation required for the other driver functions to work. */
void (*init)(void);
diff --git a/quantum/led_matrix/led_matrix_drivers.c b/quantum/led_matrix/led_matrix_drivers.c
index 7a6f3c5767..f437b3ede2 100644
--- a/quantum/led_matrix/led_matrix_drivers.c
+++ b/quantum/led_matrix/led_matrix_drivers.c
@@ -78,7 +78,6 @@ static void init(void) {
# endif
# endif
# endif
-
# elif defined(CKLED2001)
# if defined(LED_DRIVER_SHUTDOWN_PIN)
setPinOutput(LED_DRIVER_SHUTDOWN_PIN);
@@ -148,7 +147,6 @@ static void init(void) {
# endif
# endif
# endif
-
# elif defined(CKLED2001)
CKLED2001_update_led_control_registers(DRIVER_ADDR_1, 0);
# if defined(DRIVER_ADDR_2)
@@ -225,7 +223,6 @@ const led_matrix_driver_t led_matrix_driver = {
.set_value = IS31FL_simple_set_brightness,
.set_value_all = IS31FL_simple_set_brigntness_all,
};
-
# elif defined(CKLED2001)
static void flush(void) {
CKLED2001_update_pwm_buffers(DRIVER_ADDR_1, 0);
@@ -255,7 +252,7 @@ static void shutdown(void) {
# endif
# endif
# endif
-# endif
+# endif
}
static void exit_shutdown(void) {
@@ -272,7 +269,7 @@ static void exit_shutdown(void) {
# endif
# endif
# endif
-# endif
+# endif
}
# endif