Make default layer size 16-bit (#15286)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
This commit is contained in:
@@ -75,7 +75,7 @@ bool oled_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
oled_write_P(PSTR("RGBKB Pan\n"), false);
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
uint8_t layer = layer_state ? biton(layer_state) : biton32(default_layer_state);
|
||||
uint8_t layer = get_highest_layer(layer_state|default_layer_state);
|
||||
switch (layer) {
|
||||
case _QWERTY:
|
||||
oled_write_P(PSTR("Default\n"), false);
|
||||
|
@@ -233,7 +233,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
uint8_t layer = biton32(layer_state);
|
||||
uint8_t layer = get_highest_layer(layer_state);
|
||||
uint16_t keycode = pgm_read_word(&encoders[layer][index][clockwise]);
|
||||
while (keycode == KC_TRANSPARENT && layer > 0)
|
||||
{
|
||||
@@ -325,7 +325,7 @@ static void render_status(void) {
|
||||
|
||||
// Define layers here
|
||||
oled_write_P(PSTR("Layer"), false);
|
||||
uint8_t layer = layer_state ? biton(layer_state) : biton32(default_layer_state);
|
||||
uint8_t layer = get_highest_layer(layer_state|default_layer_state);
|
||||
switch (layer) {
|
||||
case _QWERTY:
|
||||
oled_write_P(PSTR("BASE "), false);
|
||||
|
@@ -263,7 +263,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
uint8_t layer = biton32(layer_state);
|
||||
uint8_t layer = get_highest_layer(layer_state);
|
||||
uint16_t keycode = encoders[layer][index][clockwise];
|
||||
while (keycode == KC_TRANSPARENT && layer > 0)
|
||||
{
|
||||
@@ -306,7 +306,7 @@ static void render_status(void) {
|
||||
|
||||
// Define layers here
|
||||
oled_write_P(PSTR(" Layer-----"), false);
|
||||
uint8_t layer = layer_state ? biton(layer_state) : biton32(default_layer_state);
|
||||
uint8_t layer = layer_state ? get_highest_layer(layer_state) : get_highest_layer(default_layer_state);
|
||||
switch (layer) {
|
||||
case _DVORAK:
|
||||
oled_write_P(PSTR("DVRAK"), false);
|
||||
|
@@ -37,7 +37,7 @@ void render_status(void) {
|
||||
// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
|
||||
oled_set_cursor(0, 3); // Line 3
|
||||
oled_write_P(PSTR("Layer"), false); // Line 4
|
||||
oled_write_P(layer_name_user(biton32(layer_state)), false);
|
||||
oled_write_P(layer_name_user(get_highest_layer(layer_state)), false);
|
||||
|
||||
// Host Keyboard LED Status
|
||||
uint8_t led_usb_state = host_keyboard_leds();
|
||||
|
@@ -198,7 +198,7 @@ static void render_status(void) {
|
||||
|
||||
// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
switch (biton32(layer_state)) {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _QWERTY:
|
||||
oled_write_ln_P(PSTR("QWERTY"), false);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user