cambios led
This commit is contained in:
parent
2e8d171f39
commit
cf77c945ea
64
config.h
64
config.h
@ -28,11 +28,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define TAPPING_TERM 200
|
||||
#define TAPPING_TOGGLE 2
|
||||
|
||||
// #define RGBLIGHT_LAYERS
|
||||
// #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF
|
||||
// #define SPLIT_LAYER_STATE_ENABLE
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
// #define RGBLIGHT_LAYERS
|
||||
// #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF
|
||||
// #define RGBLIGHT_EFFECT_BREATHING
|
||||
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
@ -50,7 +48,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endif
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
#define SPLIT_USB_DETECT
|
||||
# define SPLIT_LED_STATE_ENABLE
|
||||
# define SPLIT_LAYER_STATE_ENABLE
|
||||
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
|
||||
// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
@ -63,10 +62,59 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# define RGB_MATRIX_SAT_STEP 8
|
||||
# define RGB_MATRIX_VAL_STEP 8
|
||||
# define RGB_MATRIX_SPD_STEP 10
|
||||
|
||||
/* Enable the animations you want/need. You may need to enable only a small number of these because *
|
||||
* they take up a lot of space. Enable and confirm that you can still successfully compile your firmware. */
|
||||
// RGB Matrix Animation modes. Explicitly enabled
|
||||
// For full list of effects, see:
|
||||
// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects
|
||||
// # define ENABLE_RGB_MATRIX_ALPHAS_MODS
|
||||
// # define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
// # define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
|
||||
// # define ENABLE_RGB_MATRIX_BREATHING
|
||||
// # define ENABLE_RGB_MATRIX_BAND_SAT
|
||||
// # define ENABLE_RGB_MATRIX_BAND_VAL
|
||||
// # define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
|
||||
// # define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
|
||||
// # define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
|
||||
// # define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
|
||||
// # define ENABLE_RGB_MATRIX_CYCLE_ALL
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
|
||||
// # define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
|
||||
# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
|
||||
// # define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
|
||||
// # define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
|
||||
// # define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
|
||||
// # define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
|
||||
// # define ENABLE_RGB_MATRIX_DUAL_BEACON
|
||||
# define ENABLE_RGB_MATRIX_RAINBOW_BEACON
|
||||
# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
|
||||
# define ENABLE_RGB_MATRIX_RAINDROPS
|
||||
// # define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
|
||||
// # define ENABLE_RGB_MATRIX_HUE_BREATHING
|
||||
// # define ENABLE_RGB_MATRIX_HUE_PENDULUM
|
||||
// # define ENABLE_RGB_MATRIX_HUE_WAVE
|
||||
//// # define ENABLE_RGB_MATRIX_PIXEL_RAIN
|
||||
//// # define ENABLE_RGB_MATRIX_PIXEL_FLOW
|
||||
//// # define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
|
||||
// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined
|
||||
# define ENABLE_RGB_MATRIX_TYPING_HEATMAP
|
||||
// # define ENABLE_RGB_MATRIX_DIGITAL_RAIN
|
||||
// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
|
||||
// # define ENABLE_RGB_MATRIX_SPLASH
|
||||
// # define ENABLE_RGB_MATRIX_MULTISPLASH
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_SPLASH
|
||||
// # define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
||||
#endif
|
||||
|
||||
#define SPLIT_LAYER_STATE_ENABLE
|
||||
|
||||
#define LAYER_STATE_16BIT
|
||||
// #define LAYER_STATE_16BIT
|
||||
|
||||
#define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c"
|
||||
|
86
keymap.c
86
keymap.c
@ -161,7 +161,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUD, RGB_HUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD, RGB_VAD, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_SW,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_RMOD, RGB_MOD, RGB_VAD, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_R,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SAD, RGB_SAI, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_P,
|
||||
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
||||
@ -280,93 +280,31 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
// RGB LAYER CONFIGURATION
|
||||
// LENGHTH OF LEDS
|
||||
const int firstLed = 1;
|
||||
const int lastLed = 53;
|
||||
|
||||
// uint8_t rgbmode;
|
||||
// bool rgbStatus = true;
|
||||
const int firstLedLeft = 1;
|
||||
const int lastLedLeft = 26;
|
||||
const int firstLedRight = 27;
|
||||
const int lastLedRight = 53;
|
||||
|
||||
void rgb_matrix_indicators_user(void) {
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
switch (biton32(layer_state)) {
|
||||
case 1:
|
||||
/* for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||
rgb_matrix_set_color(i, 255, 0, 0);
|
||||
} */
|
||||
rgb_matrix_set_color_all(255, 0, 0);
|
||||
rgb_matrix_set_color_all(RGB_AZURE);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
/* for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||
rgb_matrix_set_color(i, 0, 0, 255);
|
||||
} */
|
||||
rgb_matrix_set_color_all(0, 0, 255);
|
||||
rgb_matrix_set_color_all(RGB_YELLOW);
|
||||
break;
|
||||
|
||||
//case 3:
|
||||
//rgb_matrix_set_color_all(29, 241, 161);
|
||||
//break;
|
||||
default:
|
||||
if (isWindows == false){
|
||||
rgb_matrix_set_color(8, 0, 255, 0);
|
||||
rgb_matrix_set_color(lastLedLeft, 255, 166, 1);
|
||||
}
|
||||
if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
|
||||
rgb_matrix_set_color(10, 0, 255, 0);
|
||||
rgb_matrix_set_color(lastLedRight, 255, 166, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Light LEDs when caps lock is active. Hard to ignore!
|
||||
/* const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{ lastLed, 1, HSV_RED } // Light last LEDs only
|
||||
);
|
||||
const rgblight_segment_t PROGMEM isWindos_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{ firstLed, 1, HSV_RED } // Light first LEDs only
|
||||
);
|
||||
// Light LEDs layer 1 is active
|
||||
const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{firstLed, lastLed, HSV_CYAN }
|
||||
);
|
||||
// Light LEDs layer 2 is active
|
||||
const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{firstLed, lastLed, HSV_YELLOW }
|
||||
);
|
||||
// Light LEDs layer 3 is active
|
||||
const rgblight_segment_t PROGMEM my_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
||||
{firstLed, lastLed, HSV_SPRINGGREEN}
|
||||
);
|
||||
|
||||
// Now define the array of layers. Later layers take precedence
|
||||
const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
|
||||
my_capslock_layer, // Overrides caps lock and Windos layer,
|
||||
isWindos_layer,
|
||||
my_layer1_layer, // Overrides other layers
|
||||
my_layer2_layer, // Overrides other layers
|
||||
my_layer3_layer // Overrides other layers
|
||||
);
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
// Enable the LED layers
|
||||
rgblight_layers = my_rgb_layers;
|
||||
}
|
||||
|
||||
// enabling disabling layers
|
||||
bool led_update_user(led_t led_state) {
|
||||
rgblight_set_layer_state(0, led_state.caps_lock);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
layer_state_t default_layer_state_set_user(layer_state_t state) {
|
||||
rgblight_set_layer_state(0, layer_state_cmp(state, 0));
|
||||
return state;
|
||||
} */
|
||||
|
||||
/* layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
if(isWindows == false){
|
||||
rgblight_set_layer_state(1, layer_state_cmp(state, 0));
|
||||
}
|
||||
rgblight_set_layer_state(2, layer_state_cmp(state, 1));
|
||||
rgblight_set_layer_state(3, layer_state_cmp(state, 2));
|
||||
rgblight_set_layer_state(4, layer_state_cmp(state, 3));
|
||||
return state;
|
||||
} */
|
Loading…
Reference in New Issue
Block a user