Make default layer size 16-bit (#15286)

Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
This commit is contained in:
Drashna Jaelre
2022-06-18 14:37:51 -07:00
committed by GitHub
parent cfcd647b2e
commit 0da6562c4d
293 changed files with 1249 additions and 1309 deletions

View File

@@ -91,7 +91,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
#ifdef RGBLIGHT_ENABLE
layer_state_set_rgb(state);
#endif
uint8_t layer = biton32(state);
uint8_t layer = get_highest_layer(state);
combo_enable(); // by default, enable combos.
switch (layer) {
case 0:

View File

@@ -45,7 +45,7 @@ void matrix_scan_rgb(void) {
}
void set_rgb_indicators(uint8_t this_mod, uint8_t this_osm) {
if (biton32(layer_state) == _QWERTY) {
if (get_highest_layer(layer_state) == _QWERTY) {
if ((this_mod | this_osm) & MOD_MASK_SHIFT) {
rgblight_setrgb_gold_at(SHFT_LED1);
} else {

View File

@@ -6,7 +6,7 @@
void keyboard_post_init_rgb(void);
// If rgb enabled, set underglow for layer
uint32_t layer_state_set_rgb(uint32_t state);
layer_state_t layer_state_set_rgb(layer_state_t state);
// Enhance matrix scan code. Note: keep this light, since it runs every 100ms
void matrix_scan_rgb(void);

View File

@@ -182,7 +182,7 @@ void rgbflag(uint8_t r, uint8_t g, uint8_t b, uint8_t rr, uint8_t gg, uint8_t bb
void set_state_leds(void) {
if (rgblight_get_mode() == 1) {
switch (biton32(layer_state)) {
switch (get_highest_layer(layer_state)) {
case _RAISE:
rgbflag(C_BLU, C_GRN);
break;