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/mechlovin/hannah910/hannah910.c | 6 ++--- keyboards/mechlovin/hex4b/keymaps/nazzer/keymap.c | 28 +++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'keyboards/mechlovin') diff --git a/keyboards/mechlovin/hannah910/hannah910.c b/keyboards/mechlovin/hannah910/hannah910.c index 3237636be2..70c1a7b8e3 100644 --- a/keyboards/mechlovin/hannah910/hannah910.c +++ b/keyboards/mechlovin/hannah910/hannah910.c @@ -34,20 +34,20 @@ void led_set_kb(uint8_t usb_led) { layer_state_t layer_state_set_user(layer_state_t state) { // if on layer 1, turn on D2 LED, otherwise off. - if (biton32(state) == 1) { + if (get_highest_layer(state) == 1) { writePinHigh(D2); } else { writePinLow(D2); } // if on layer 2, turn on D1 LED, otherwise off. - if (biton32(state) == 2) { + if (get_highest_layer(state) == 2) { writePinHigh(D1); } else { writePinLow(D1); } // if on layer 3, turn on D0 LED, otherwise off. - if (biton32(state) == 3) { + if (get_highest_layer(state) == 3) { writePinHigh(D0); } else { writePinLow(D0); diff --git a/keyboards/mechlovin/hex4b/keymaps/nazzer/keymap.c b/keyboards/mechlovin/hex4b/keymaps/nazzer/keymap.c index 437233be52..e0634d85dc 100644 --- a/keyboards/mechlovin/hex4b/keymaps/nazzer/keymap.c +++ b/keyboards/mechlovin/hex4b/keymaps/nazzer/keymap.c @@ -53,9 +53,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; bool led_update_user(led_t led_state) { - + // Toggle CAPS_LOCK LED normally - + # if LED_PIN_ON_STATE == 0 // invert the whole thing to avoid having to conditionally !led_state.x later led_state.raw = ~led_state.raw; @@ -69,30 +69,30 @@ bool led_update_user(led_t led_state) { } layer_state_t layer_state_set_user(layer_state_t state) { - - uint8_t layer = biton32(state); - + + uint8_t layer = get_highest_layer(state); + #if defined(LED_NUM_LOCK_PIN) && defined(LED_SCROLL_LOCK_PIN) switch (layer) { case 0: - writePin(LED_SCROLL_LOCK_PIN, !LED_PIN_ON_STATE); - writePin(LED_NUM_LOCK_PIN, !LED_PIN_ON_STATE); + writePin(LED_SCROLL_LOCK_PIN, !LED_PIN_ON_STATE); + writePin(LED_NUM_LOCK_PIN, !LED_PIN_ON_STATE); break; case 1: - writePin(LED_SCROLL_LOCK_PIN, LED_PIN_ON_STATE); - writePin(LED_NUM_LOCK_PIN, !LED_PIN_ON_STATE); + writePin(LED_SCROLL_LOCK_PIN, LED_PIN_ON_STATE); + writePin(LED_NUM_LOCK_PIN, !LED_PIN_ON_STATE); break; case 2: - writePin(LED_SCROLL_LOCK_PIN, !LED_PIN_ON_STATE); - writePin(LED_NUM_LOCK_PIN, LED_PIN_ON_STATE); + writePin(LED_SCROLL_LOCK_PIN, !LED_PIN_ON_STATE); + writePin(LED_NUM_LOCK_PIN, LED_PIN_ON_STATE); break; case 3: - writePin(LED_SCROLL_LOCK_PIN, LED_PIN_ON_STATE); - writePin(LED_NUM_LOCK_PIN, LED_PIN_ON_STATE); + writePin(LED_SCROLL_LOCK_PIN, LED_PIN_ON_STATE); + writePin(LED_NUM_LOCK_PIN, LED_PIN_ON_STATE); break; } #endif - return state; + return state; } -- cgit v1.2.3