Fix RGB matrix

This commit is contained in:
Jeremy Soller 2020-10-21 20:44:15 -06:00
parent 0d55d047e3
commit 677de37754
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
3 changed files with 35 additions and 18 deletions

View File

@ -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

View File

@ -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 &&

View File

@ -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