From ea42b62fe58c8dcaed21f01ca173686fb41589ad Mon Sep 17 00:00:00 2001 From: peepeetee Date: Tue, 21 Feb 2023 11:14:42 -0600 Subject: [PATCH 1/3] implement rgb matrix for momokai keyboards --- keyboards/momokai/tap_duo/config.h | 168 +++++++++++++------------- keyboards/momokai/tap_duo/rules.mk | 5 +- keyboards/momokai/tap_duo/tap_duo.c | 24 ++-- keyboards/momokai/tap_trio/config.h | 148 +++++++++++------------ keyboards/momokai/tap_trio/rules.mk | 5 +- keyboards/momokai/tap_trio/tap_trio.c | 24 ++-- 6 files changed, 188 insertions(+), 186 deletions(-) diff --git a/keyboards/momokai/tap_duo/config.h b/keyboards/momokai/tap_duo/config.h index b470cfb6e5c5..202af4b26ee5 100644 --- a/keyboards/momokai/tap_duo/config.h +++ b/keyboards/momokai/tap_duo/config.h @@ -42,91 +42,91 @@ //TODO: implement RGB Matrix #define RGB_DI_PIN F0 -#define RGBLED_NUM 4 +#define RGB_MATRIX_LED_COUNT 4 #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL - - -/*== 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 -/*== customize breathing effect ==*/ - /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ - #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 - /*==== use exp() and sin() ====*/ - #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 - #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 - - -// #ifdef RGB_DI_PIN -// #define DRIVER_LED_TOTAL 5 - -// #define RGB_MATRIX_KEYPRESSES // reacts to keypresses -// // # define RGBLIGHT_LIMIT_VAL 180 // Limit to vendor-recommended value -// #endif -// #ifdef RGB_MATRIX_ENABLE -// // # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 180 // Limit to vendor-recommended value -// // 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_SOLID_COLOR -// #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 RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL + + +// /*== 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 +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 + + +#ifdef RGB_DI_PIN +#define DRIVER_LED_TOTAL 4 + +#define RGB_MATRIX_KEYPRESSES // reacts to keypresses +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#endif +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 + // 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_SOLID_COLOR + #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 diff --git a/keyboards/momokai/tap_duo/rules.mk b/keyboards/momokai/tap_duo/rules.mk index 59e0e1381f6f..33488b9d3a78 100644 --- a/keyboards/momokai/tap_duo/rules.mk +++ b/keyboards/momokai/tap_duo/rules.mk @@ -14,7 +14,8 @@ CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output - +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 LTO_ENABLE = yes diff --git a/keyboards/momokai/tap_duo/tap_duo.c b/keyboards/momokai/tap_duo/tap_duo.c index 2216c37f4318..bd5381083862 100644 --- a/keyboards/momokai/tap_duo/tap_duo.c +++ b/keyboards/momokai/tap_duo/tap_duo.c @@ -16,16 +16,16 @@ #include "tap_duo.h" -// #ifdef RGB_MATRIX_ENABLE -// led_config_t g_led_config = { { -// // Key Matrix to LED Index -// { 0, 1, 2, NO_LED, NO_LED, NO_LED} -// }, { -// // LED Index to Physical Position -// { 56, 0}, { 112, 0}, { 168, 0}, { 0, 64}, { 224, 64} -// }, { -// // LED Index to Flag -// 4,4,4,2,2 -// } }; +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + // Key Matrix to LED Index + { 0, 1, NO_LED, NO_LED, NO_LED} +}, { + // LED Index to Physical Position + { 112, 0}, { 168, 0}, { 0, 64}, { 224, 64} +}, { + // LED Index to Flag + 4,4,2,2 +} }; -// #endif +#endif diff --git a/keyboards/momokai/tap_trio/config.h b/keyboards/momokai/tap_trio/config.h index 74129762af59..2ccf5cb5abfc 100644 --- a/keyboards/momokai/tap_trio/config.h +++ b/keyboards/momokai/tap_trio/config.h @@ -29,88 +29,88 @@ //TODO: implement RGB Matrix #define RGB_DI_PIN F0 -#define RGBLED_NUM 5 +#define RGB_MATRIX_LED_COUNT 5 #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL +// #define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL - #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 -/*== customize breathing effect ==*/ - /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ - #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 - /*==== use exp() and sin() ====*/ - #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 - #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +// #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 +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 -// #ifdef RGB_DI_PIN -// #define RGB_MATRIX_LED_COUNT 5 +#ifdef RGB_DI_PIN +#define DRIVER_LED_TOTAL 5 -// #define RGB_MATRIX_KEYPRESSES // reacts to keypresses -// // # define RGBLIGHT_LIMIT_VAL 180 // Limit to vendor-recommended value -// #endif -// #ifdef RGB_MATRIX_ENABLE -// // # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 180 // Limit to vendor-recommended value -// // 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_SOLID_COLOR -// #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 +#define RGB_MATRIX_KEYPRESSES // reacts to keypresses +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#endif +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 + // 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_SOLID_COLOR + #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 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 + // 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 diff --git a/keyboards/momokai/tap_trio/rules.mk b/keyboards/momokai/tap_trio/rules.mk index 59e0e1381f6f..33488b9d3a78 100644 --- a/keyboards/momokai/tap_trio/rules.mk +++ b/keyboards/momokai/tap_trio/rules.mk @@ -14,7 +14,8 @@ CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output - +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 LTO_ENABLE = yes diff --git a/keyboards/momokai/tap_trio/tap_trio.c b/keyboards/momokai/tap_trio/tap_trio.c index 02bd0d3addc0..69b850e04cc0 100644 --- a/keyboards/momokai/tap_trio/tap_trio.c +++ b/keyboards/momokai/tap_trio/tap_trio.c @@ -16,16 +16,16 @@ #include "tap_trio.h" -// #ifdef RGB_MATRIX_ENABLE -// led_config_t g_led_config = { { -// // Key Matrix to LED Index -// { 0, 1, 2, NO_LED, NO_LED, NO_LED} -// }, { -// // LED Index to Physical Position -// { 56, 0}, { 112, 0}, { 168, 0}, { 0, 64}, { 224, 64} -// }, { -// // LED Index to Flag -// 4,4,4,2,2 -// } }; +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + // Key Matrix to LED Index + { 0, 1, 2, NO_LED, NO_LED, NO_LED} +}, { + // LED Index to Physical Position + { 56, 0}, { 112, 0}, { 168, 0}, { 0, 64}, { 224, 64} +}, { + // LED Index to Flag + 4,4,4,2,2 +} }; -// #endif +#endif From 9cc130734057d1cb16c706976f55798241d902fd Mon Sep 17 00:00:00 2001 From: peepeetee <43021794+peepeetee@users.noreply.github.com> Date: Wed, 22 Feb 2023 15:58:52 -0600 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: jack <0x6a73@protonmail.com> --- keyboards/momokai/tap_duo/config.h | 33 +---------------------------- keyboards/momokai/tap_trio/config.h | 29 ++----------------------- 2 files changed, 3 insertions(+), 59 deletions(-) diff --git a/keyboards/momokai/tap_duo/config.h b/keyboards/momokai/tap_duo/config.h index 202af4b26ee5..0f9b71e63d51 100644 --- a/keyboards/momokai/tap_duo/config.h +++ b/keyboards/momokai/tap_duo/config.h @@ -42,41 +42,10 @@ //TODO: implement RGB Matrix #define RGB_DI_PIN F0 +#ifdef RGB_MATRIX_ENABLE #define RGB_MATRIX_LED_COUNT 4 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -// #define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL - - -// /*== 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 -// /*== customize breathing effect ==*/ -// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ -// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 -// /*==== use exp() and sin() ====*/ -// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 -// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 - - -#ifdef RGB_DI_PIN -#define DRIVER_LED_TOTAL 4 - #define RGB_MATRIX_KEYPRESSES // reacts to keypresses #define RGB_MATRIX_FRAMEBUFFER_EFFECTS -#endif -#ifdef RGB_MATRIX_ENABLE # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // RGB Matrix Animation modes. Explicitly enabled // For full list of effects, see: diff --git a/keyboards/momokai/tap_trio/config.h b/keyboards/momokai/tap_trio/config.h index 2ccf5cb5abfc..f4ef15924e8e 100644 --- a/keyboards/momokai/tap_trio/config.h +++ b/keyboards/momokai/tap_trio/config.h @@ -29,38 +29,13 @@ //TODO: implement RGB Matrix #define RGB_DI_PIN F0 -#define RGB_MATRIX_LED_COUNT 5 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - // #define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL -// #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 -// /*== customize breathing effect ==*/ -// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ -// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 -// /*==== use exp() and sin() ====*/ -// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 -// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 - - -#ifdef RGB_DI_PIN -#define DRIVER_LED_TOTAL 5 - +#ifdef RGB_MATRIX_ENABLE +#define RGB_MATRIX_LED_COUNT 5 #define RGB_MATRIX_KEYPRESSES // reacts to keypresses #define RGB_MATRIX_FRAMEBUFFER_EFFECTS -#endif -#ifdef RGB_MATRIX_ENABLE # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // RGB Matrix Animation modes. Explicitly enabled // For full list of effects, see: From eefc88efe6e97083c9d9d0248b38b69e59960553 Mon Sep 17 00:00:00 2001 From: peepeetee Date: Tue, 7 Mar 2023 00:14:52 -0600 Subject: [PATCH 3/3] turn off effects when suspended --- keyboards/momokai/tap_duo/config.h | 1 + keyboards/momokai/tap_trio/config.h | 1 + 2 files changed, 2 insertions(+) diff --git a/keyboards/momokai/tap_duo/config.h b/keyboards/momokai/tap_duo/config.h index 696ef4b9829f..ca447bf9c6d1 100644 --- a/keyboards/momokai/tap_duo/config.h +++ b/keyboards/momokai/tap_duo/config.h @@ -42,6 +42,7 @@ #define RGB_MATRIX_LED_COUNT 4 #define RGB_MATRIX_KEYPRESSES // reacts to keypresses #define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // RGB Matrix Animation modes. Explicitly enabled // For full list of effects, see: diff --git a/keyboards/momokai/tap_trio/config.h b/keyboards/momokai/tap_trio/config.h index 6d73194bb226..7a38599d11a9 100644 --- a/keyboards/momokai/tap_trio/config.h +++ b/keyboards/momokai/tap_trio/config.h @@ -32,6 +32,7 @@ #define RGB_MATRIX_LED_COUNT 5 #define RGB_MATRIX_KEYPRESSES // reacts to keypresses #define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // RGB Matrix Animation modes. Explicitly enabled // For full list of effects, see: