Skip to content

Commit

Permalink
Remove keyboard use of eeconfig_read_default_layer (#24635)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Nov 23, 2024
1 parent 1f7d109 commit 859dab8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 29 deletions.
21 changes: 8 additions & 13 deletions keyboards/satt/comet46/keymaps/default-rgbled/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ void matrix_init_user(void) {
}

void matrix_scan_user(void) {
uint8_t layer = get_highest_layer(layer_state);
uint8_t default_layer = biton32(eeconfig_read_default_layer());
uint8_t layer = get_highest_layer(layer_state | default_layer_state);
switch (layer) {
case _LOWER:
set_led_red;
Expand All @@ -183,18 +182,14 @@ void matrix_scan_user(void) {
case _ADJUST:
set_led_magenta;
break;
case _COLEMAK:
set_led_white;
break;
case _DVORAK:
set_led_yellow;
break;
default:
switch (default_layer) {
case _COLEMAK:
set_led_white;
break;
case _DVORAK:
set_led_yellow;
break;
default:
set_led_green;
break;
}
set_led_green;
break;
}
};
24 changes: 8 additions & 16 deletions keyboards/satt/comet46/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,24 +153,16 @@ bool oled_task_user(void) {
// Layer state
char layer_str[22];
oled_write_P(PSTR("Layer: "), false);
uint8_t layer = get_highest_layer(layer_state);
uint8_t default_layer = get_highest_layer(eeconfig_read_default_layer());
uint8_t layer = get_highest_layer(layer_state | default_layer_state);
switch (layer) {
case _QWERTY:
switch (default_layer) {
case _QWERTY:
snprintf(layer_str, sizeof(layer_str), "Qwerty");
break;
case _COLEMAK:
snprintf(layer_str, sizeof(layer_str), "Colemak");
break;
case _DVORAK:
snprintf(layer_str, sizeof(layer_str), "Dvorak");
break;
default:
snprintf(layer_str, sizeof(layer_str), "Undef-%d", default_layer);
break;
}
snprintf(layer_str, sizeof(layer_str), "Qwerty");
break;
case _COLEMAK:
snprintf(layer_str, sizeof(layer_str), "Colemak");
break;
case _DVORAK:
snprintf(layer_str, sizeof(layer_str), "Dvorak");
break;
case _RAISE:
snprintf(layer_str, sizeof(layer_str), "Raise");
Expand Down

0 comments on commit 859dab8

Please sign in to comment.