Added RGBLight configs

master
Mark 2022-06-16 12:32:42 -07:00
parent 9e8d57849a
commit 3024a46dd9
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
3 changed files with 122 additions and 50 deletions

View File

@ -238,6 +238,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
led_config_t g_led_config = { { led_config_t g_led_config = { {
// Key matrix to LED index
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },
{ 28, 33, 38, 43, 47, NO_LED }, { 28, 33, 38, 43, 47, NO_LED },
{ 27, 32, 37, 42, 46, NO_LED }, { 27, 32, 37, 42, 46, NO_LED },
@ -253,6 +254,7 @@ led_config_t g_led_config = { {
{ 4, 9, 14, 19, 23, NO_LED }, { 4, 9, 14, 19, 23, NO_LED },
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED } { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }
}, { }, {
// LED index to physical position
{ 137, 0 }, { 154, 0 }, { 172, 0 }, { 189, 0 }, { 206, 0 }, { 137, 12 }, { 137, 0 }, { 154, 0 }, { 172, 0 }, { 189, 0 }, { 206, 0 }, { 137, 12 },
{ 154, 12 }, { 172, 12 }, { 189, 12 }, { 206, 12 }, { 137, 25 }, { 154, 25 }, { 154, 12 }, { 172, 12 }, { 189, 12 }, { 206, 12 }, { 137, 25 }, { 154, 25 },
{ 172, 25 }, { 189, 25 }, { 206, 25 }, { 137, 38 }, { 154, 38 }, { 172, 38 }, { 172, 25 }, { 189, 25 }, { 206, 25 }, { 137, 38 }, { 154, 38 }, { 172, 38 },
@ -262,6 +264,7 @@ led_config_t g_led_config = { {
{ 51, 25 }, { 34, 25 }, { 17, 25 }, { 86, 38 }, { 68, 38 }, { 51, 38 }, { 51, 25 }, { 34, 25 }, { 17, 25 }, { 86, 38 }, { 68, 38 }, { 51, 38 },
{ 34, 38 }, { 17, 38 }, { 68, 51 }, { 51, 51 }, { 34, 51 }, { 17, 51 } { 34, 38 }, { 17, 38 }, { 68, 51 }, { 51, 51 }, { 34, 51 }, { 17, 51 }
}, { }, {
// LED index to flag
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
@ -276,14 +279,17 @@ led_config_t g_led_config = { {
void keyboard_post_init_kb(void) { void keyboard_post_init_kb(void) {
// Start with matrix enabled // Start with matrix enabled
// (We enable RGB effects and layer colors seperately)
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
rgb_matrix_enable_noeeprom(); rgb_matrix_enable_noeeprom();
#endif #endif
// Start with backlight disabled // Start with backlight disabled
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
#ifdef RGBLIGHT_OFF_AT_START
rgblight_disable_noeeprom(); rgblight_disable_noeeprom();
#endif #endif
#endif
keyboard_post_init_user(); keyboard_post_init_user();
} }

View File

@ -81,6 +81,9 @@
// Max brightness // Max brightness
#define RGBLIGHT_LIMIT_VAL 200 #define RGBLIGHT_LIMIT_VAL 200
//#define RGBLIGHT_OFF_AT_START
//#define RGBLIGHT_NO_EEPROM
// Prevents RGB keycodes from affecting underglow. // Prevents RGB keycodes from affecting underglow.
// This allows us to control RGBMatrix and RGBLight seperately. // This allows us to control RGBMatrix and RGBLight seperately.
#define RGBLIGHT_DISABLE_KEYCODES #define RGBLIGHT_DISABLE_KEYCODES

View File

@ -221,6 +221,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break; break;
// Custom RGBLIGHT macros // Custom RGBLIGHT macros
#ifdef RGBLIGHT_NO_EEPROM
case LIGHT_TOG: case LIGHT_TOG:
if (record->event.pressed) { if (record->event.pressed) {
rgblight_toggle_noeeprom(); rgblight_toggle_noeeprom();
@ -280,6 +282,67 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
rgblight_decrease_speed_noeeprom(); rgblight_decrease_speed_noeeprom();
} }
break; break;
#else
case LIGHT_TOG:
if (record->event.pressed) {
rgblight_toggle();
}
break;
case LIGHT_MOD:
if (record->event.pressed) {
rgblight_step();
}
break;
case LIGHT_HUI:
if (record->event.pressed) {
rgblight_increase_hue();
}
break;
case LIGHT_HUD:
if (record->event.pressed) {
rgblight_decrease_hue();
}
break;
case LIGHT_SAI:
if (record->event.pressed) {
rgblight_increase_sat();
}
break;
case LIGHT_SAD:
if (record->event.pressed) {
rgblight_decrease_sat();
}
break;
case LIGHT_VAI:
if (record->event.pressed) {
rgblight_increase_val();
}
break;
case LIGHT_VAD:
if (record->event.pressed) {
rgblight_decrease_val();
}
break;
case LIGHT_SPI:
if (record->event.pressed) {
rgblight_increase_speed();
}
break;
case LIGHT_SPD:
if (record->event.pressed) {
rgblight_decrease_speed();
}
break;
#endif
} }
return true; return true;
} }