added the ability to override the base layer behavior, added LTO_ENABLE for reduced firmware size, and implemented a split color scheme for the minidox
This commit is contained in:
parent
9222dec123
commit
298284fe99
|
|
@ -11,5 +11,6 @@
|
|||
# define RGBLED_SPLIT \
|
||||
{ 9, 9 }
|
||||
# define RGBLIGHT_SPLIT
|
||||
# define RGBLIGHT_LED_MAP {6,7,8,0,1,2,3,4,5,14,13,12,11,10,9,17,16,15}
|
||||
# define SPLIT_LAYER_STATE_ENABLE
|
||||
//# define RGBLIGHT_LED_MAP {6,7,8,0,1,2,3,4,5,14,13,12,11,10,9,17,16,15}
|
||||
#endif
|
||||
|
|
@ -108,3 +108,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
)
|
||||
|
||||
};
|
||||
|
||||
|
||||
bool rgb_base_layer_keymap(layer_state_t state) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_sethsv_range(HSV_PURPLE, 0, 9);
|
||||
rgblight_sethsv_range(16, 255, 255, 9, RGBLED_NUM);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1 +1,3 @@
|
|||
RGBLIGHT_ENABLE = yes
|
||||
RGBLIGHT_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = no
|
||||
COMMAND_ENABLE = no
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
# define RGBLIGHT_SLEEP
|
||||
# define RGBLIGHT_LAYERS
|
||||
# define RGBLIGHT_MAX_LAYERS 16
|
||||
# define RGBLIGHT_STARTUP_ANIMATION true
|
||||
//# define RGBLIGHT_STARTUP_ANIMATION true
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
|
|
|||
|
|
@ -85,6 +85,9 @@ void rgb_set_user_config_from_current_values() {
|
|||
#endif
|
||||
}
|
||||
|
||||
// return false if you want the parent logic to run
|
||||
__attribute__((weak)) bool rgb_base_layer_keymap(layer_state_t state) { return false; }
|
||||
|
||||
layer_state_t layer_state_set_rgb_light(layer_state_t state) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
if (userspace_config.rgb_layer_change) {
|
||||
|
|
@ -114,18 +117,21 @@ layer_state_t layer_state_set_rgb_light(layer_state_t state) {
|
|||
trackball_set_hsv(userspace_config.hue, userspace_config.sat, userspace_config.val);
|
||||
#endif
|
||||
} else { // if base layer override is disabled, always show the base setting
|
||||
uint8_t base_layer_rgb_hue = 167; // BLUE
|
||||
uint8_t base_layer_rgb_mode = mode;
|
||||
#ifdef BASE_LAYER_RGB_HUE
|
||||
base_layer_rgb_hue = BASE_LAYER_RGB_HUE;
|
||||
#endif
|
||||
#ifdef BASE_LAYER_RGB_MODE
|
||||
base_layer_rgb_mode = BASE_LAYER_RGB_MODE;
|
||||
#endif
|
||||
rgblight_set_hsv_and_mode(base_layer_rgb_hue, 255, 255, base_layer_rgb_mode);
|
||||
#ifdef PIMORONI_TRACKBALL_ENABLE
|
||||
trackball_set_hsv(base_layer_rgb_hue, 255, 255);
|
||||
#endif
|
||||
// This allows you to override the base layer rgb behavior for a given keyboard by defining this function in the keymap.c
|
||||
if (!rgb_base_layer_keymap(state)) {
|
||||
uint8_t base_layer_rgb_hue = 167; // BLUE
|
||||
uint8_t base_layer_rgb_mode = mode;
|
||||
#ifdef BASE_LAYER_RGB_HUE
|
||||
base_layer_rgb_hue = BASE_LAYER_RGB_HUE;
|
||||
#endif
|
||||
#ifdef BASE_LAYER_RGB_MODE
|
||||
base_layer_rgb_mode = BASE_LAYER_RGB_MODE;
|
||||
#endif
|
||||
rgblight_set_hsv_and_mode(base_layer_rgb_hue, 255, 255, base_layer_rgb_mode);
|
||||
#ifdef PIMORONI_TRACKBALL_ENABLE
|
||||
trackball_set_hsv(base_layer_rgb_hue, 255, 255);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
case _QWERTY:
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
bool process_record_user_rgb_light(uint16_t keycode, keyrecord_t *record);
|
||||
void keyboard_post_init_rgb_light(void);
|
||||
void matrix_scan_rgb_light(void);
|
||||
bool rgb_base_layer_keymap(layer_state_t state);
|
||||
layer_state_t layer_state_set_rgb_light(layer_state_t state);
|
||||
layer_state_t default_layer_state_set_rgb_light(layer_state_t state);
|
||||
void rgblight_sethsv_default_helper(uint8_t index);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ NKRO_ENABLE = no
|
|||
RAW_ENABLE = no
|
||||
CASEMODES_ENABLE = yes
|
||||
COMBO_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
||||
|
||||
# UNCOMMENT TO DISABLE MACROS
|
||||
#EXTRAFLAGS += -flto
|
||||
|
|
|
|||
|
|
@ -268,4 +268,18 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
|
|||
default:
|
||||
return TAPPING_TERM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This was added to deal with this issue:
|
||||
// * https://www.reddit.com/r/olkb/comments/mwf5re/help_needed_controlling_individual_rgb_leds_on_a/
|
||||
// * https://github.com/qmk/qmk_firmware/issues/12037
|
||||
#ifdef SPLIT_KEYBOARD
|
||||
void housekeeping_task_user(void) {
|
||||
static layer_state_t old_layer_state = 0;
|
||||
if (!is_keyboard_master() && old_layer_state != layer_state) {
|
||||
old_layer_state = layer_state;
|
||||
layer_state_set_user(layer_state);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Reference in New Issue