Make default layer size 16-bit (#15286)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
This commit is contained in:
@@ -64,7 +64,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
flight_mode = false;
|
||||
rcs_mode = false;
|
||||
|
||||
switch (biton32(state)) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case _PANIC:
|
||||
panic_mode = true; // For use in encoder evaluation
|
||||
rgblight_sethsv_noeeprom(HSV_RED);
|
||||
|
||||
@@ -42,7 +42,7 @@ void matrix_post_init_user(void) {
|
||||
}
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (biton32(state)) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case _LIST:
|
||||
rgblight_sethsv_noeeprom(0,255,255);
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL);
|
||||
@@ -87,6 +87,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
void matrix_init_keymap() {}
|
||||
|
||||
#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
uint32_t layer_state_set_keymap(uint32_t state) {
|
||||
layer_state_t layer_state_set_keymap(layer_state_t state) {
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||
switch (biton32(state)) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case L_EDVORAKJP_LOWER:
|
||||
rgblight_sethsv_noeeprom_red();
|
||||
break;
|
||||
|
||||
@@ -11,7 +11,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {[0] = LAYOUT(KC_GE
|
||||
#ifdef ENCODER_ENABLE
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) {
|
||||
switch (biton32(layer_state)) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _LOWER:
|
||||
clockwise ? tap_code(KC_MS_WH_UP) : tap_code(KC_MS_WH_DOWN);
|
||||
break;
|
||||
@@ -23,7 +23,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
break;
|
||||
}
|
||||
} else if (index == 1) {
|
||||
switch (biton32(layer_state)) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _LOWER:
|
||||
clockwise ? tap_code(KC_UP) : tap_code(KC_DOWN);
|
||||
break;
|
||||
|
||||
@@ -134,7 +134,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
}
|
||||
// tmux screen
|
||||
else if (index == 1) {
|
||||
switch(biton32(layer_state)){
|
||||
switch(get_highest_layer(layer_state)){
|
||||
case 0:
|
||||
if (clockwise) {
|
||||
send_string(SS_LCTL("B")"p");
|
||||
@@ -182,4 +182,3 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
rgblight_set_layer_state(2, layer_state_cmp(state, 4));
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -143,7 +143,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
uint8_t default_layer = eeconfig_read_default_layer();
|
||||
if (rgb_layer_change) {
|
||||
switch (biton32(state)) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case _LOWER:
|
||||
rgblight_set_purple;
|
||||
rgblight_mode(5);
|
||||
|
||||
@@ -64,7 +64,7 @@ void keyboard_post_init_user(void) {
|
||||
}
|
||||
|
||||
void update_led(void) {
|
||||
switch (biton32(layer_state)) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _BASE:
|
||||
rgblight_sethsv_noeeprom(HSV_BLUE);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user