From 677de37754d3264305613ac30ae932727da6d90d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 21 Oct 2020 20:44:15 -0600 Subject: [PATCH] Fix RGB matrix --- keyboards/system76/launch_beta_1/config.h | 29 ++++++++++++++----- .../system76/launch_beta_1/launch_beta_1.c | 22 +++++++------- keyboards/system76/launch_beta_1/rules.mk | 2 +- 3 files changed, 35 insertions(+), 18 deletions(-) diff --git a/keyboards/system76/launch_beta_1/config.h b/keyboards/system76/launch_beta_1/config.h index 25387774123..3df1fac3a5e 100644 --- a/keyboards/system76/launch_beta_1/config.h +++ b/keyboards/system76/launch_beta_1/config.h @@ -26,13 +26,28 @@ /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 -#define RGB_DI_PIN E2 -#define RGBLED_NUM 84 -#define DRIVER_LED_TOTAL RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -// Limit brightness to support USB-A at 0.5A -//TODO: do this dynamically based on power source -#define RGBLIGHT_LIMIT_VAL 176 +#if RGBLIGHT_ENABLE + #define RGB_DI_PIN E2 + #define RGBLED_NUM 84 + #define RGBLIGHT_ANIMATIONS + // Limit brightness to support USB-A at 0.5A + //TODO: do this dynamically based on power source + #define RGBLIGHT_LIMIT_VAL 176 +#endif + +#if RGB_MATRIX_ENABLE + #define RGB_DI_PIN E2 + #define DRIVER_LED_TOTAL 84 + #define RGB_MATRIX_KEYPRESSES // reacts to keypresses + //#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) + //#define RGB_MATRIX_FRAMEBUFFER_EFFECTS + #define RGB_DISABLE_TIMEOUT 0 // number of milliseconds to wait until rgb automatically turns off + #define RGB_DISABLE_AFTER_TIMEOUT 0 // OBSOLETE: number of ticks to wait until disabling effects + #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 176 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_MULTISPLASH // Sets the default mode, if none has been set + #define RGB_MATRIX_DISABLE_KEYCODES // disables control of rgb matrix by keycodes (must use code functions to control the feature) +#endif /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE diff --git a/keyboards/system76/launch_beta_1/launch_beta_1.c b/keyboards/system76/launch_beta_1/launch_beta_1.c index 51f2999cc07..751a3d742a1 100644 --- a/keyboards/system76/launch_beta_1/launch_beta_1.c +++ b/keyboards/system76/launch_beta_1/launch_beta_1.c @@ -4,6 +4,7 @@ #include "launch_beta_1.h" #include "usb_mux.h" +#if RGB_MATRIX_ENABLE // LEDs by index // 0 1 2 3 4 5 6 7 8 9 // 00 LM4 LL4 LK4 LJ4 LI4 LH4 LG4 LF4 LE4 LD4 @@ -36,18 +37,19 @@ led_config_t g_led_config = { LAYOUT( /* 70 */ {15, 0}, {30, 0}, {46, 0}, {61, 0}, {76, 0}, {91, 0}, {106, 0}, {121, 0}, {137, 0}, {152, 0}, /* 80 */ {167, 0}, {182, 0}, {201, 0}, {224, 0} }, { - // LED index to flags (not really used) + // LED index to flags (set all to LED_FLAG_KEYLIGHT) /* 0 1 2 3 4 5 6 7 8 9 */ -/* 00 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 10 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 20 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 30 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 40 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 50 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 60 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 70 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/* 80 */ 0, 0, 0, 0 +/* 00 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +/* 10 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +/* 20 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +/* 30 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +/* 40 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +/* 50 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +/* 60 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +/* 70 */ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, +/* 80 */ 4, 4, 4, 4 } }; +#endif // RGB_MATRIX_ENABLE bool eeprom_is_valid(void) { return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && diff --git a/keyboards/system76/launch_beta_1/rules.mk b/keyboards/system76/launch_beta_1/rules.mk index 7b492cfaaf5..9e8e1224bcf 100644 --- a/keyboards/system76/launch_beta_1/rules.mk +++ b/keyboards/system76/launch_beta_1/rules.mk @@ -28,7 +28,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration DYNAMIC_KEYMAP_ENABLE = yes # Reconfigurable keyboard without flashing firmware NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work RAW_ENABLE = yes # Enable RAW HID commands (used by keyboard configurator) -RGBLIGHT_ENABLE = yes # Support for RGB backlight +RGBLIGHT_ENABLE = no # Support for RGB backlight (conflicts with RGB_MATRIX) RGB_MATRIX_ENABLE = WS2812 # Support for RGB matrix # Add System76 EC command interface