LEDs working better now?

This commit is contained in:
Daniel Flanagan 2024-06-27 12:26:34 -05:00
parent 1c1f64192e
commit 7f46b4df9f
4 changed files with 38 additions and 33 deletions

View file

@ -1,3 +1,7 @@
#define TAPPING_TERM 150
// #define PERMISSIVE_HOLD
#define HOLD_ON_OTHER_KEY_PRESS
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_MOOD+1
#define SPLIT_LAYER_STATE_ENABLE
#define SPLIT_LED_STATE_ENABLE

View file

@ -32,6 +32,7 @@
nil,
alejandra,
udisks2,
clang,
qmk,
}: {
qmk = mkShell {
@ -40,6 +41,7 @@
alejandra
udisks2
qmk
clang
];
# inherit (self.outputs.checks.${system}.pre-commit-check) shellHook;

View file

@ -3,9 +3,9 @@
# TODO: cd dirname $0
cd "$(dirname "$0")" || exit 1
cp ./config.h ~/qmk_firmware/keyboards/keebio/iris_ce/keymaps/lytedev
cp ./rules.mk ~/qmk_firmware/keyboards/keebio/iris_ce/keymaps/lytedev
cp ./keymap.c ~/qmk_firmware/keyboards/keebio/iris_ce/keymaps/lytedev
rsync -hvrPt ./config.h ~/qmk_firmware/keyboards/keebio/iris_ce/keymaps/lytedev
rsync -hvrPt ./rules.mk ~/qmk_firmware/keyboards/keebio/iris_ce/keymaps/lytedev
rsync -hvrPt ./keymap.c ~/qmk_firmware/keyboards/keebio/iris_ce/keymaps/lytedev
(
while true; do

View file

@ -78,35 +78,34 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state | default_layer_state)) {
case LL:
rgblight_mode_noeeprom(1);
rgblight_sethsv(HSV_BLUE);
break;
case LR:
rgblight_mode_noeeprom(1);
rgblight_sethsv(HSV_GREEN);
break;
case LA:
rgblight_mode_noeeprom(1);
rgblight_sethsv(HSV_PURPLE);
break;
case LC:
rgblight_mode_noeeprom(1);
rgblight_sethsv(HSV_ORANGE);
break;
default:
if (IS_LAYER_ON_STATE(state | default_layer_state, LG)) {
rgblight_mode_noeeprom(1);
rgblight_sethsv(HSV_RED);
} else if (IS_LAYER_ON_STATE(state | default_layer_state, LRG)) {
rgblight_mode_noeeprom(1);
rgblight_sethsv(HSV_YELLOW);
} else {
rgblight_mode_noeeprom(RGB_MATRIX_DEFAULT_MODE + 1);
}
break;
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
uint8_t layer = get_highest_layer(layer_state | default_layer_state);
if (layer == LQ) {
return false;
}
return state;
HSV hsv = {0, 255, 255};
hsv.h = 40 * layer;
// switch (layer) {
// case(LG):
// hsv.h = 40;
// break;
// }
// hsv.h = 130;
// } else if {
// hsv.h = 30;
// }
if (hsv.v > rgb_matrix_get_val()) {
hsv.v = rgb_matrix_get_val();
}
RGB rgb = hsv_to_rgb(hsv);
for (uint8_t i = led_min; i <= led_max; i++) {
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
}
return true;
}