Skip to content

Commit

Permalink
Remove redundant RGB/LED matrix eeconfig init (qmk#22673)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored and mechlovin committed Jan 17, 2024
1 parent 75c24fc commit 0d360b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 10 additions & 6 deletions quantum/led_matrix/led_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ void eeconfig_debug_led_matrix(void) {
dprintf("led_matrix_eeconfig.flags = %d\n", led_matrix_eeconfig.flags);
}

void led_matrix_reload_from_eeprom(void) {
led_matrix_disable_noeeprom();
/* Reset back to what we have in eeprom */
eeconfig_init_led_matrix();
eeconfig_debug_led_matrix(); // display current eeprom values
if (led_matrix_eeconfig.enable) {
led_matrix_mode_noeeprom(led_matrix_eeconfig.mode);
}
}

__attribute__((weak)) uint8_t led_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) {
return 0;
}
Expand Down Expand Up @@ -415,12 +425,6 @@ void led_matrix_init(void) {
}
#endif // LED_MATRIX_KEYREACTIVE_ENABLED

if (!eeconfig_is_enabled()) {
dprintf("led_matrix_init_drivers eeconfig is not enabled.\n");
eeconfig_init();
eeconfig_update_led_matrix_default();
}

eeconfig_init_led_matrix();
if (!led_matrix_eeconfig.mode) {
dprintf("led_matrix_init_drivers led_matrix_eeconfig.mode = 0. Write default values to EEPROM.\n");
Expand Down
2 changes: 2 additions & 0 deletions quantum/led_matrix/led_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ bool led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max);

void led_matrix_init(void);

void led_matrix_reload_from_eeprom(void);

void led_matrix_set_suspend_state(bool state);
bool led_matrix_get_suspend_state(void);
void led_matrix_toggle(void);
Expand Down
6 changes: 0 additions & 6 deletions quantum/rgb_matrix/rgb_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,6 @@ void rgb_matrix_init(void) {
}
#endif // RGB_MATRIX_KEYREACTIVE_ENABLED

if (!eeconfig_is_enabled()) {
dprintf("rgb_matrix_init_drivers eeconfig is not enabled.\n");
eeconfig_init();
eeconfig_update_rgb_matrix_default();
}

eeconfig_init_rgb_matrix();
if (!rgb_matrix_config.mode) {
dprintf("rgb_matrix_init_drivers rgb_matrix_config.mode = 0. Write default values to EEPROM.\n");
Expand Down

0 comments on commit 0d360b3

Please sign in to comment.