Remove keyboard use of eeconfig_read_default_layer (#24635)

This commit is contained in:
Joel Challis 2024-11-23 17:43:45 +00:00 committed by GitHub
parent 1f7d10902a
commit 859dab864a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 29 deletions

View File

@ -171,8 +171,7 @@ void matrix_init_user(void) {
} }
void matrix_scan_user(void) { void matrix_scan_user(void) {
uint8_t layer = get_highest_layer(layer_state); uint8_t layer = get_highest_layer(layer_state | default_layer_state);
uint8_t default_layer = biton32(eeconfig_read_default_layer());
switch (layer) { switch (layer) {
case _LOWER: case _LOWER:
set_led_red; set_led_red;
@ -183,18 +182,14 @@ void matrix_scan_user(void) {
case _ADJUST: case _ADJUST:
set_led_magenta; set_led_magenta;
break; break;
case _COLEMAK:
set_led_white;
break;
case _DVORAK:
set_led_yellow;
break;
default: default:
switch (default_layer) { set_led_green;
case _COLEMAK:
set_led_white;
break;
case _DVORAK:
set_led_yellow;
break;
default:
set_led_green;
break;
}
break; break;
} }
}; };

View File

@ -153,24 +153,16 @@ bool oled_task_user(void) {
// Layer state // Layer state
char layer_str[22]; char layer_str[22];
oled_write_P(PSTR("Layer: "), false); oled_write_P(PSTR("Layer: "), false);
uint8_t layer = get_highest_layer(layer_state); uint8_t layer = get_highest_layer(layer_state | default_layer_state);
uint8_t default_layer = get_highest_layer(eeconfig_read_default_layer());
switch (layer) { switch (layer) {
case _QWERTY: case _QWERTY:
switch (default_layer) { snprintf(layer_str, sizeof(layer_str), "Qwerty");
case _QWERTY: break;
snprintf(layer_str, sizeof(layer_str), "Qwerty"); case _COLEMAK:
break; snprintf(layer_str, sizeof(layer_str), "Colemak");
case _COLEMAK: break;
snprintf(layer_str, sizeof(layer_str), "Colemak"); case _DVORAK:
break; snprintf(layer_str, sizeof(layer_str), "Dvorak");
case _DVORAK:
snprintf(layer_str, sizeof(layer_str), "Dvorak");
break;
default:
snprintf(layer_str, sizeof(layer_str), "Undef-%d", default_layer);
break;
}
break; break;
case _RAISE: case _RAISE:
snprintf(layer_str, sizeof(layer_str), "Raise"); snprintf(layer_str, sizeof(layer_str), "Raise");