Make default layer size 16-bit (#15286)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
// thanks to atlacat, hailbreno, itsaferbie and weeheavy...
|
||||
|
||||
// and special thanks to AGausmann and drashna for the layer-activated RGB underglow
|
||||
// https://www.reddit.com/r/olkb/comments/6t1vdu/update_layeractivated_rgb_underglow/
|
||||
// https://www.reddit.com/r/olkb/comments/6t1vdu/update_layeractivated_rgb_underglow/
|
||||
// https://github.com/AGausmann/qmk_firmware/blob/agausmann-v3.x/keyboards/nyquist/keymaps/agausmann/keymap.c
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
/*
|
||||
/*
|
||||
* Each layer gets a name for readability.
|
||||
* The underscores don't mean anything - you can
|
||||
* have a layer called STUFF or any other name.
|
||||
@@ -23,8 +23,8 @@
|
||||
#define NL 2 // Numpad Layer
|
||||
#define RL 3 // RGB Layer
|
||||
|
||||
/*
|
||||
* Let's give an easier name to the RGB modes
|
||||
/*
|
||||
* Let's give an easier name to the RGB modes
|
||||
* and assign the ones we want to the different layer
|
||||
* these will then be used by the function below
|
||||
*
|
||||
@@ -49,10 +49,10 @@
|
||||
//
|
||||
#define RGB_RL_MODE rgblight_mode_noeeprom(22) //rgb mode for RL layer
|
||||
#define RGB_RL_LIGHT rgblight_sethsv_noeeprom_red() //rgb light for RL layer
|
||||
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
|
||||
/* Keymap BL: Base Layer (Default Layer)
|
||||
*
|
||||
* ,-----------------------------------------------------------.
|
||||
@@ -140,7 +140,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, RGB_STA, RGB_BRE, RGB_RAI, RGB_SWI, _______, _______, RGB_SNA, RGB_KNI, RGB_GRA, RGB_XMS, _______, _______, _______,
|
||||
_______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, MO(FL), _______, _______, _______, TO(BL), _______),
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -175,25 +175,25 @@ void matrix_scan_user(void) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
|
||||
static uint8_t old_layer = 1;
|
||||
uint8_t new_layer = biton32(layer_state);
|
||||
uint8_t new_layer = get_highest_layer(layer_state);
|
||||
|
||||
if (old_layer != new_layer) {
|
||||
switch (new_layer) {
|
||||
case BL:
|
||||
RGB_BL_MODE;
|
||||
RGB_BL_LIGHT;
|
||||
RGB_BL_LIGHT;
|
||||
break;
|
||||
case FL:
|
||||
RGB_FL_MODE;
|
||||
RGB_FL_LIGHT;
|
||||
RGB_FL_LIGHT;
|
||||
break;
|
||||
case NL:
|
||||
RGB_NL_MODE;
|
||||
RGB_NL_LIGHT;
|
||||
RGB_NL_MODE;
|
||||
RGB_NL_LIGHT;
|
||||
break;
|
||||
case RL:
|
||||
RGB_RL_MODE;
|
||||
RGB_RL_LIGHT;
|
||||
RGB_RL_MODE;
|
||||
RGB_RL_LIGHT;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,7 @@ static int16_t fnTimer = 0;
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state)
|
||||
{
|
||||
switch (biton32(state))
|
||||
switch (get_highest_layer(state))
|
||||
{
|
||||
case QWERTY:
|
||||
rgblight_mode(9);
|
||||
|
@@ -73,7 +73,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
static uint32_t last_state = 0;
|
||||
|
||||
if(last_state != state) {
|
||||
switch (biton32(state)) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case _CMD:
|
||||
user_led_on();
|
||||
break;
|
||||
@@ -85,5 +85,3 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user