|
|
@ -209,14 +209,31 @@ void led_initialize_hardware(void) {
|
|
|
|
void keyboard_pre_init_kb(void) {
|
|
|
|
void keyboard_pre_init_kb(void) {
|
|
|
|
// read kb settings from eeprom
|
|
|
|
// read kb settings from eeprom
|
|
|
|
keyboard_config.raw = eeconfig_read_kb();
|
|
|
|
keyboard_config.raw = eeconfig_read_kb();
|
|
|
|
|
|
|
|
#ifdef RGB_MATRIX_ENABLE
|
|
|
|
|
|
|
|
if (keyboard_config.rgb_matrix_enable) {
|
|
|
|
|
|
|
|
rgb_matrix_set_flags(LED_FLAG_ALL);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
rgb_matrix_set_flags(LED_FLAG_NONE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// initialize settings for front LEDs
|
|
|
|
// initialize settings for front LEDs
|
|
|
|
led_initialize_hardware();
|
|
|
|
led_initialize_hardware();
|
|
|
|
|
|
|
|
keyboard_pre_init_user();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef RGB_MATRIX_ENABLE
|
|
|
|
|
|
|
|
void keyboard_post_init_kb(void) {
|
|
|
|
|
|
|
|
rgb_matrix_enable_noeeprom();
|
|
|
|
|
|
|
|
keyboard_post_init_user();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void eeconfig_init_kb(void) { // EEPROM is getting reset!
|
|
|
|
void eeconfig_init_kb(void) { // EEPROM is getting reset!
|
|
|
|
keyboard_config.raw = 0;
|
|
|
|
keyboard_config.raw = 0;
|
|
|
|
|
|
|
|
keyboard_config.rgb_matrix_enable = true;
|
|
|
|
keyboard_config.led_level = 4;
|
|
|
|
keyboard_config.led_level = 4;
|
|
|
|
|
|
|
|
|
|
|
|
eeconfig_update_kb(keyboard_config.raw);
|
|
|
|
eeconfig_update_kb(keyboard_config.raw);
|
|
|
|
eeconfig_init_user();
|
|
|
|
eeconfig_init_user();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -258,6 +275,31 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
layer_state_set_kb(layer_state);
|
|
|
|
layer_state_set_kb(layer_state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef RGB_MATRIX_ENABLE
|
|
|
|
|
|
|
|
case TOGGLE_LAYER_COLOR:
|
|
|
|
|
|
|
|
if (record->event.pressed) {
|
|
|
|
|
|
|
|
keyboard_config.disable_layer_led ^= 1;
|
|
|
|
|
|
|
|
eeconfig_update_kb(keyboard_config.raw);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RGB_TOG:
|
|
|
|
|
|
|
|
if (record->event.pressed) {
|
|
|
|
|
|
|
|
switch (rgb_matrix_get_flags()) {
|
|
|
|
|
|
|
|
case LED_FLAG_ALL: {
|
|
|
|
|
|
|
|
rgb_matrix_set_flags(LED_FLAG_NONE);
|
|
|
|
|
|
|
|
keyboard_config.rgb_matrix_enable = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: {
|
|
|
|
|
|
|
|
rgb_matrix_set_flags(LED_FLAG_ALL);
|
|
|
|
|
|
|
|
keyboard_config.rgb_matrix_enable = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
eeconfig_update_kb(keyboard_config.raw);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return process_record_user(keycode, record);
|
|
|
|
return process_record_user(keycode, record);
|
|
|
|
}
|
|
|
|
}
|
|
|
|