From 0da6562c4df570729889690e21061229c5648b73 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 18 Jun 2022 14:37:51 -0700 Subject: Make default layer size 16-bit (#15286) Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> --- keyboards/rgbkb/pan/keymaps/default/keymap.c | 2 +- keyboards/rgbkb/sol/keymaps/default/keymap.c | 4 ++-- keyboards/rgbkb/sol/keymaps/xyverz/keymap.c | 4 ++-- keyboards/rgbkb/zen/rev2/rev2.c | 2 +- keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'keyboards/rgbkb') diff --git a/keyboards/rgbkb/pan/keymaps/default/keymap.c b/keyboards/rgbkb/pan/keymaps/default/keymap.c index dbc127616a..dcafeec765 100644 --- a/keyboards/rgbkb/pan/keymaps/default/keymap.c +++ b/keyboards/rgbkb/pan/keymaps/default/keymap.c @@ -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); diff --git a/keyboards/rgbkb/sol/keymaps/default/keymap.c b/keyboards/rgbkb/sol/keymaps/default/keymap.c index c82259f5ee..1ce18bc1ab 100644 --- a/keyboards/rgbkb/sol/keymaps/default/keymap.c +++ b/keyboards/rgbkb/sol/keymaps/default/keymap.c @@ -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); diff --git a/keyboards/rgbkb/sol/keymaps/xyverz/keymap.c b/keyboards/rgbkb/sol/keymaps/xyverz/keymap.c index bdcfbb1b93..bc0884c8e4 100644 --- a/keyboards/rgbkb/sol/keymaps/xyverz/keymap.c +++ b/keyboards/rgbkb/sol/keymaps/xyverz/keymap.c @@ -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); diff --git a/keyboards/rgbkb/zen/rev2/rev2.c b/keyboards/rgbkb/zen/rev2/rev2.c index 5461890272..70e5531673 100644 --- a/keyboards/rgbkb/zen/rev2/rev2.c +++ b/keyboards/rgbkb/zen/rev2/rev2.c @@ -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(); diff --git a/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c b/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c index 48bd1a33f7..f4d5c82a71 100644 --- a/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c +++ b/keyboards/rgbkb/zygomorph/keymaps/default_oled/keymap.c @@ -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; -- cgit v1.2.3