From 13acc2713f4cd7128bd423b4225019b426a03566 Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 26 Jul 2020 17:48:51 +0700 Subject: [PATCH] bm40rgb: add RGB Matrix support --- keyboards/bm40rgb/bm40rgb.c | 22 ++++++++++++++++++++++ keyboards/bm40rgb/config.h | 20 ++------------------ keyboards/bm40rgb/rules.mk | 9 +++++---- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/keyboards/bm40rgb/bm40rgb.c b/keyboards/bm40rgb/bm40rgb.c index b7de67cd129..0e169bf56ba 100644 --- a/keyboards/bm40rgb/bm40rgb.c +++ b/keyboards/bm40rgb/bm40rgb.c @@ -16,3 +16,25 @@ along with this program. If not, see . */ #include "bm40rgb.h" + +led_config_t g_led_config = { { + // Key Matrix to LED Index + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, + { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, + { 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 }, + { 36, 37, 38, 39, 40, 41, NO_LED, 42, 43, 44, 45, 46}, +}, { + // LED Index to Physical Position + {0, 0}, {20, 0}, {40, 0}, {61, 0}, {81, 0}, {101, 0}, {122, 0}, {142, 0}, {162, 0}, {183, 0}, {203, 0}, {224, 0}, + {0, 21}, {20, 21}, {40, 21}, {61, 21}, {81, 21}, {101, 21}, {122, 21}, {142, 21}, {162, 21}, {183, 21}, {203, 21}, {224, 21}, + {0, 42}, {20, 42}, {40, 42}, {61, 42}, {81, 42}, {101, 42}, {122, 42}, {142, 42}, {162, 42}, {183, 42}, {203, 42}, {224, 42}, + {0, 64}, {20, 64}, {40, 64}, {61, 64}, {81, 64}, {111, 64}, {142, 64}, {162, 64}, {183, 64}, {203, 64}, {224, 64}, + {220, 32}, {176, 32}, {132, 32}, {88, 32}, {44, 32}, {0, 32} +}, { + // LED Index to Flag + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2 +} }; diff --git a/keyboards/bm40rgb/config.h b/keyboards/bm40rgb/config.h index 9ba7830d618..2578023e4d4 100644 --- a/keyboards/bm40rgb/config.h +++ b/keyboards/bm40rgb/config.h @@ -47,23 +47,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define RGB_DI_PIN E2 +#define DRIVER_LED_TOTAL 53 #ifdef RGB_DI_PIN - #define RGBLED_NUM 54 - #define RGBLIGHT_HUE_STEP 8 - #define RGBLIGHT_SAT_STEP 8 - #define RGBLIGHT_VAL_STEP 8 - #define RGBLIGHT_LIMIT_VAL 180 /* The maximum brightness level */ - #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ -/*== all animations enable ==*/ - #define RGBLIGHT_ANIMATIONS -// /*== or choose animations ==*/ -// #define RGBLIGHT_EFFECT_BREATHING -// #define RGBLIGHT_EFFECT_RAINBOW_MOOD -// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL -// #define RGBLIGHT_EFFECT_SNAKE -// #define RGBLIGHT_EFFECT_KNIGHT -// #define RGBLIGHT_EFFECT_CHRISTMAS -// #define RGBLIGHT_EFFECT_STATIC_GRADIENT -// #define RGBLIGHT_EFFECT_RGB_TEST -// #define RGBLIGHT_EFFECT_ALTERNATING + #define RGB_MATRIX_KEYPRESSES // reacts to keypresses #endif diff --git a/keyboards/bm40rgb/rules.mk b/keyboards/bm40rgb/rules.mk index 685e0dab93e..3358dfaf210 100644 --- a/keyboards/bm40rgb/rules.mk +++ b/keyboards/bm40rgb/rules.mk @@ -10,14 +10,13 @@ BOOTLOADER = atmel-dfu BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = no # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow MIDI_ENABLE = no # MIDI support UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID @@ -26,5 +25,7 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches KEY_LOCK_ENABLE = no # Enable KC_LOCK support +RGB_MATRIX_ENABLE = WS2812 + LAYOUTS = ortho_4x12 planck_mit LAYOUTS_HAS_RGB = yes