From f0a23837f994eb3432df227780b51779165ea279 Mon Sep 17 00:00:00 2001 From: bactaholic Date: Wed, 4 Oct 2023 18:48:26 -0700 Subject: [PATCH 01/10] add starlight animations --- keyboards/moonlander/config.h | 3 ++ .../animations/rgb_matrix_effects.inc | 3 ++ .../rgb_matrix/animations/starlight_anim.h | 30 +++++++++++++++++ .../animations/starlight_dual_hue_anim.h | 31 +++++++++++++++++ .../animations/starlight_dual_sat_anim.h | 33 +++++++++++++++++++ 5 files changed, 100 insertions(+) create mode 100644 quantum/rgb_matrix/animations/starlight_anim.h create mode 100644 quantum/rgb_matrix/animations/starlight_dual_hue_anim.h create mode 100644 quantum/rgb_matrix/animations/starlight_dual_sat_anim.h diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h index 7c20260162d6..fd9e20fb6486 100644 --- a/keyboards/moonlander/config.h +++ b/keyboards/moonlander/config.h @@ -125,6 +125,9 @@ # define ENABLE_RGB_MATRIX_MULTISPLASH # define ENABLE_RGB_MATRIX_SOLID_SPLASH # define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +# define ENABLE_RGB_MATRIX_STAR_LIGHT +# define ENABLE_RGB_MATRIX_DUAL_HUE_STAR_LIGHT +# define ENABLE_RGB_MATRIX_DUAL_SAT_STAR_LIGHT // #define RGB_MATRIX_LED_PROCESS_LIMIT 5 // #define RGB_MATRIX_LED_FLUSH_LIMIT 26 diff --git a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc index df347188387e..a8fa72e6abf5 100644 --- a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc +++ b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc @@ -39,3 +39,6 @@ #include "solid_reactive_nexus.h" #include "splash_anim.h" #include "solid_splash_anim.h" +#include "starlight_anim.h" +#include "starlight_dual_sat_anim.h" +#include "starlight_dual_hue_anim.h" \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_anim.h b/quantum/rgb_matrix/animations/starlight_anim.h new file mode 100644 index 000000000000..8a3f00064dfd --- /dev/null +++ b/quantum/rgb_matrix/animations/starlight_anim.h @@ -0,0 +1,30 @@ +#ifdef ENABLE_RGB_MATRIX_STAR_LIGHT +RGB_MATRIX_EFFECT(STAR_LIGHT) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static void star_light_set_color(int i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; + HSV hsv = rgb_matrix_config.hsv; + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = rgb_matrix_hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +} + +bool STAR_LIGHT(effect_params_t* params) { + if (!params->init) { + if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { + star_light_set_color(rand() % RGB_MATRIX_LED_COUNT, params); + } + return false; + } + + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (int i = led_min; i < led_max; i++) { + star_light_set_color(i, params); + } + return rgb_matrix_check_finished_leds(led_max); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STAR_LIGHT \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h new file mode 100644 index 000000000000..57b04f35133f --- /dev/null +++ b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h @@ -0,0 +1,31 @@ +#ifdef ENABLE_RGB_MATRIX_DUAL_HUE_STAR_LIGHT +RGB_MATRIX_EFFECT(DUAL_HUE_STAR_LIGHT) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static void dual_hue_star_light_set_color(int i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; + HSV hsv = rgb_matrix_config.hsv; + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + hsv.h = hsv.h + (rand() % (30 + 1 - -30) + -30); + RGB rgb = rgb_matrix_hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +} + +bool DUAL_HUE_STAR_LIGHT(effect_params_t* params) { + if (!params->init) { + if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { + dual_hue_star_light_set_color(rand() % RGB_MATRIX_LED_COUNT, params); + } + return false; + } + + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (int i = led_min; i < led_max; i++) { + dual_hue_star_light_set_color(i, params); + } + return rgb_matrix_check_finished_leds(led_max); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_DUAL_HUE_STAR_LIGHT \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h new file mode 100644 index 000000000000..503aaf0e6c5d --- /dev/null +++ b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h @@ -0,0 +1,33 @@ +#ifdef ENABLE_RGB_MATRIX_DUAL_SAT_STAR_LIGHT +RGB_MATRIX_EFFECT(DUAL_SAT_STAR_LIGHT) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +static void dual_sat_star_light_set_color(int i, effect_params_t* params) { + if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; + HSV hsv = rgb_matrix_config.hsv; + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + hsv.s = hsv.s + (rand() % (30 + 1 - -30) + -30); + RGB rgb = rgb_matrix_hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +} + +bool DUAL_SAT_STAR_LIGHT(effect_params_t* params) { + if (!params->init) { + if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { + dual_sat_star_light_set_color(rand() % RGB_MATRIX_LED_COUNT, params); + } + return false; + } + + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (int i = led_min; i < led_max; i++) { + dual_sat_star_light_set_color(i, params); + } + return rgb_matrix_check_finished_leds(led_max); +} + + + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_DUAL_SAT_STAR_LIGHT \ No newline at end of file From 2625c2740e74634ed6fadc14d51528991e0e4eb4 Mon Sep 17 00:00:00 2001 From: bactaholic Date: Thu, 5 Oct 2023 16:24:27 -0700 Subject: [PATCH 02/10] updated all custom animations + starlight smooth --- keyboards/moonlander/config.h | 7 ++-- .../rgb_matrix/animations/starlight_anim.h | 30 ++++++++--------- .../animations/starlight_dual_hue_anim.h | 32 +++++++++---------- .../animations/starlight_dual_sat_anim.h | 29 ++++++++--------- .../animations/starlight_smooth_anim.h | 22 +++++++++++++ 5 files changed, 71 insertions(+), 49 deletions(-) create mode 100644 quantum/rgb_matrix/animations/starlight_smooth_anim.h diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h index fd9e20fb6486..ae2e46a7d212 100644 --- a/keyboards/moonlander/config.h +++ b/keyboards/moonlander/config.h @@ -125,9 +125,10 @@ # define ENABLE_RGB_MATRIX_MULTISPLASH # define ENABLE_RGB_MATRIX_SOLID_SPLASH # define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -# define ENABLE_RGB_MATRIX_STAR_LIGHT -# define ENABLE_RGB_MATRIX_DUAL_HUE_STAR_LIGHT -# define ENABLE_RGB_MATRIX_DUAL_SAT_STAR_LIGHT +# define ENABLE_RGB_MATRIX_STARLIGHT +# define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE +# define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT +# define ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH // #define RGB_MATRIX_LED_PROCESS_LIMIT 5 // #define RGB_MATRIX_LED_FLUSH_LIMIT 26 diff --git a/quantum/rgb_matrix/animations/starlight_anim.h b/quantum/rgb_matrix/animations/starlight_anim.h index 8a3f00064dfd..20c07138fcc2 100644 --- a/quantum/rgb_matrix/animations/starlight_anim.h +++ b/quantum/rgb_matrix/animations/starlight_anim.h @@ -1,30 +1,30 @@ -#ifdef ENABLE_RGB_MATRIX_STAR_LIGHT -RGB_MATRIX_EFFECT(STAR_LIGHT) -# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#ifdef ENABLE_RGB_MATRIX_STARLIGHT +RGB_MATRIX_EFFECT(STARLIGHT) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -static void star_light_set_color(int i, effect_params_t* params) { - if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; - HSV hsv = rgb_matrix_config.hsv; - uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - RGB rgb = rgb_matrix_hsv_to_rgb(hsv); - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +void set_starlight_color(int i, effect_params_t* params) { + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } -bool STAR_LIGHT(effect_params_t* params) { +bool STARLIGHT(effect_params_t* params) { if (!params->init) { if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { - star_light_set_color(rand() % RGB_MATRIX_LED_COUNT, params); + int rand_led = rand() % RGB_MATRIX_LED_COUNT; + set_starlight_color(rand_led, params); } return false; } RGB_MATRIX_USE_LIMITS(led_min, led_max); for (int i = led_min; i < led_max; i++) { - star_light_set_color(i, params); + set_starlight_color(i, params); } return rgb_matrix_check_finished_leds(led_max); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_STAR_LIGHT \ No newline at end of file +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h index 57b04f35133f..4b22141c7408 100644 --- a/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h +++ b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h @@ -1,31 +1,31 @@ -#ifdef ENABLE_RGB_MATRIX_DUAL_HUE_STAR_LIGHT -RGB_MATRIX_EFFECT(DUAL_HUE_STAR_LIGHT) -# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#ifdef ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE +RGB_MATRIX_EFFECT(STARLIGHT_DUAL_HUE) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -static void dual_hue_star_light_set_color(int i, effect_params_t* params) { - if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; - HSV hsv = rgb_matrix_config.hsv; - uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - hsv.h = hsv.h + (rand() % (30 + 1 - -30) + -30); - RGB rgb = rgb_matrix_hsv_to_rgb(hsv); - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +void set_starlight_dual_hue_color(int i, effect_params_t* params) { + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + hsv.h = hsv.h + (rand() % (30 + 1 - -30) + -30); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } -bool DUAL_HUE_STAR_LIGHT(effect_params_t* params) { +bool STARLIGHT_DUAL_HUE(effect_params_t* params) { if (!params->init) { if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { - dual_hue_star_light_set_color(rand() % RGB_MATRIX_LED_COUNT, params); + int rand_led = rand() % RGB_MATRIX_LED_COUNT; + set_starlight_dual_hue_color(rand_led, params); } return false; } RGB_MATRIX_USE_LIMITS(led_min, led_max); for (int i = led_min; i < led_max; i++) { - dual_hue_star_light_set_color(i, params); + set_starlight_dual_hue_color(i, params); } return rgb_matrix_check_finished_leds(led_max); } -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_DUAL_HUE_STAR_LIGHT \ No newline at end of file +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h index 503aaf0e6c5d..83a4e28a72b6 100644 --- a/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h +++ b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h @@ -1,33 +1,32 @@ -#ifdef ENABLE_RGB_MATRIX_DUAL_SAT_STAR_LIGHT -RGB_MATRIX_EFFECT(DUAL_SAT_STAR_LIGHT) +#ifdef ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT +RGB_MATRIX_EFFECT(STARLIGHT_DUAL_SAT) # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -static void dual_sat_star_light_set_color(int i, effect_params_t* params) { - if (!HAS_ANY_FLAGS(g_led_config.flags[i], params->flags)) return; - HSV hsv = rgb_matrix_config.hsv; - uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - hsv.s = hsv.s + (rand() % (30 + 1 - -30) + -30); - RGB rgb = rgb_matrix_hsv_to_rgb(hsv); - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); +void set_starlight_dual_sat_color(int i, effect_params_t* params) { + uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + hsv.s = hsv.s + (rand() % (30 + 1 - -30) + -30); + RGB rgb = hsv_to_rgb(hsv); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } -bool DUAL_SAT_STAR_LIGHT(effect_params_t* params) { +bool STARLIGHT_DUAL_SAT(effect_params_t* params) { if (!params->init) { if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 5)) % 5 == 0) { - dual_sat_star_light_set_color(rand() % RGB_MATRIX_LED_COUNT, params); + int rand_led = rand() % RGB_MATRIX_LED_COUNT; + set_starlight_dual_sat_color(rand_led, params); } return false; } RGB_MATRIX_USE_LIMITS(led_min, led_max); for (int i = led_min; i < led_max; i++) { - dual_sat_star_light_set_color(i, params); + set_starlight_dual_sat_color(i, params); } return rgb_matrix_check_finished_leds(led_max); } - # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_DUAL_SAT_STAR_LIGHT \ No newline at end of file +#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_smooth_anim.h b/quantum/rgb_matrix/animations/starlight_smooth_anim.h new file mode 100644 index 000000000000..2a258b0c02e1 --- /dev/null +++ b/quantum/rgb_matrix/animations/starlight_smooth_anim.h @@ -0,0 +1,22 @@ +#ifdef ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH +RGB_MATRIX_EFFECT(STAR_LIGHT_SMOOTH) +#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +//inspired by @PleasureTek's Massdrop Alt LED animation + +bool STAR_LIGHT_SMOOTH(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (uint8_t i = led_min; i < led_max; i++) { + HSV hsv = rgb_matrix_config.hsv; + uint16_t time = scale16by8(g_rgb_timer + (i * 315), rgb_matrix_config.speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = rgb_matrix_hsv_to_rgb(hsv); + RGB_MATRIX_TEST_LED_FLAGS(); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + + return rgb_matrix_check_finished_leds(led_max); +} + +#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH From ce0f8ca010ae133b879b040edf34f93bc32e1b01 Mon Sep 17 00:00:00 2001 From: bactaholic Date: Thu, 5 Oct 2023 16:50:06 -0700 Subject: [PATCH 03/10] clang-format feat: starlight rgb animations --- keyboards/moonlander/config.h | 152 ------------------ keyboards/moonlander/keymaps/default/keymap.c | 73 --------- .../rgb_matrix/animations/starlight_anim.h | 12 +- .../animations/starlight_dual_hue_anim.h | 14 +- .../animations/starlight_dual_sat_anim.h | 13 +- .../animations/starlight_smooth_anim.h | 14 +- 6 files changed, 26 insertions(+), 252 deletions(-) delete mode 100644 keyboards/moonlander/config.h delete mode 100644 keyboards/moonlander/keymaps/default/keymap.c diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h deleted file mode 100644 index ae2e46a7d212..000000000000 --- a/keyboards/moonlander/config.h +++ /dev/null @@ -1,152 +0,0 @@ -/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> - * Copyright 2020 Jack Humbert - * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - - -#define WEBUSB_LANDING_PAGE_URL u8"configure.ergodox-ez.com" - -/* key matrix size */ -#define MATRIX_ROWS 12 -#define MATRIX_COLS 7 - -/* PCB default pin-out */ -// #define MATRIX_ROW_PINS { B10, B11, B12, B13, B14, B15 } -// #define MATRIX_COL_PINS { A0, A1, A2, A3, A6, A7, B0 } - -// #define MCP23_ROW_PINS { GPB5, GBP4, GBP3, GBP2, GBP1, GBP0 } -// #define MCP23_COL_PINS { GPA0, GBA1, GBA2, GBA3, GBA4, GBA5, GBA6 } - -// #define MCP23_LED_R GPB7 -// #define MCP23_LED_G GPB6 -// #define MCP23_LED_B GPA7 - -#define EEPROM_I2C_24LC128 - -// Not needed, is default address: -// #define EXTERNAL_EEPROM_I2C_BASE_ADDRESS 0b10100000 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION ROW2COL - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT - -#define DRIVER_ADDR_1 IS31FL3731_I2C_ADDRESS_GND -#define DRIVER_ADDR_2 IS31FL3731_I2C_ADDRESS_VCC - -#define IS31FL3731_DRIVER_COUNT 2 -#define DRIVER_1_LED_TOTAL 36 -#define DRIVER_2_LED_TOTAL 36 -#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) -#define RGB_MATRIX_CENTER { 120, 36 } -#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 175 -#define RGB_MATRIX_FRAMEBUFFER_EFFECTS -#define RGB_MATRIX_KEYPRESSES -#define RGB_DISABLE_WHEN_USB_SUSPENDED -// 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_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 -# define ENABLE_RGB_MATRIX_STARLIGHT -# define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE -# define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT -# define ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH - -// #define RGB_MATRIX_LED_PROCESS_LIMIT 5 -// #define RGB_MATRIX_LED_FLUSH_LIMIT 26 - -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 60 -#define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 400 -#define MOUSEKEY_WHEEL_INTERVAL MOUSEKEY_INTERVAL -#define MOUSEKEY_WHEEL_MAX_SPEED MOUSEKEY_MAX_SPEED -#define MOUSEKEY_WHEEL_TIME_TO_MAX MOUSEKEY_TIME_TO_MAX - -#define MUSIC_MAP - -#define FIRMWARE_VERSION_SIZE 17 -#define DYNAMIC_KEYMAP_EEPROM_ADDR (EECONFIG_SIZE + FIRMWARE_VERSION_SIZE) - -#define AUDIO_PIN A5 -#define AUDIO_PIN_ALT A4 -#define AUDIO_PIN_ALT_AS_NEGATIVE diff --git a/keyboards/moonlander/keymaps/default/keymap.c b/keyboards/moonlander/keymaps/default/keymap.c deleted file mode 100644 index ad7705eff835..000000000000 --- a/keyboards/moonlander/keymaps/default/keymap.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> - * Copyright 2020 Jack Humbert - * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - - -#include QMK_KEYBOARD_H -#include "version.h" - -enum layers { - BASE, // default layer - SYMB, // symbols - MDIA, // media keys -}; - -enum custom_keycodes { - VRSN = SAFE_RANGE, -}; - -// clang-format off -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT( - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HYPR, KC_MEH, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), LGUI_T(KC_QUOT), - KC_LSFT, LCTL_T(KC_Z),KC_X,KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), KC_RSFT, - LT(SYMB,KC_GRV),WEBUSB_PAIR,A(KC_LSFT),KC_LEFT, KC_RGHT, LALT_T(KC_APP), RCTL_T(KC_ESC), KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, MO(SYMB), - KC_SPC, KC_BSPC, KC_LGUI, KC_LALT, KC_TAB, KC_ENT - ), - - [SYMB] = LAYOUT( - VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, _______, _______, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______, - _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______, - EE_CLR, _______, _______, _______, _______, RGB_VAI, RGB_TOG, _______, KC_DOT, KC_0, KC_EQL, _______, - RGB_HUD, RGB_VAD, RGB_HUI, TOGGLE_LAYER_COLOR,_______, _______ - ), - - [MDIA] = LAYOUT( - LED_LEVEL,_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, - _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, _______, _______, - _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, - _______, _______, _______, _______, _______, _______ - ), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case VRSN: - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - return false; - } - } - return true; -} diff --git a/quantum/rgb_matrix/animations/starlight_anim.h b/quantum/rgb_matrix/animations/starlight_anim.h index 20c07138fcc2..33f0b61a9172 100644 --- a/quantum/rgb_matrix/animations/starlight_anim.h +++ b/quantum/rgb_matrix/animations/starlight_anim.h @@ -1,12 +1,12 @@ #ifdef ENABLE_RGB_MATRIX_STARLIGHT RGB_MATRIX_EFFECT(STARLIGHT) -#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS void set_starlight_color(int i, effect_params_t* params) { uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); - HSV hsv = rgb_matrix_config.hsv; - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - RGB rgb = hsv_to_rgb(hsv); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } @@ -26,5 +26,5 @@ bool STARLIGHT(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_STARLIGHT \ No newline at end of file +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h index 4b22141c7408..df6461b8b7f5 100644 --- a/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h +++ b/quantum/rgb_matrix/animations/starlight_dual_hue_anim.h @@ -1,13 +1,13 @@ #ifdef ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE RGB_MATRIX_EFFECT(STARLIGHT_DUAL_HUE) -#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS void set_starlight_dual_hue_color(int i, effect_params_t* params) { uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); - HSV hsv = rgb_matrix_config.hsv; - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - hsv.h = hsv.h + (rand() % (30 + 1 - -30) + -30); - RGB rgb = hsv_to_rgb(hsv); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + hsv.h = hsv.h + (rand() % (30 + 1 - -30) + -30); + RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } @@ -27,5 +27,5 @@ bool STARLIGHT_DUAL_HUE(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE \ No newline at end of file +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h index 83a4e28a72b6..f6ecd48aa176 100644 --- a/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h +++ b/quantum/rgb_matrix/animations/starlight_dual_sat_anim.h @@ -4,10 +4,10 @@ RGB_MATRIX_EFFECT(STARLIGHT_DUAL_SAT) void set_starlight_dual_sat_color(int i, effect_params_t* params) { uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8); - HSV hsv = rgb_matrix_config.hsv; - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - hsv.s = hsv.s + (rand() % (30 + 1 - -30) + -30); - RGB rgb = hsv_to_rgb(hsv); + HSV hsv = rgb_matrix_config.hsv; + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + hsv.s = hsv.s + (rand() % (30 + 1 - -30) + -30); + RGB rgb = hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } @@ -27,6 +27,5 @@ bool STARLIGHT_DUAL_SAT(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } - -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT \ No newline at end of file +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/starlight_smooth_anim.h b/quantum/rgb_matrix/animations/starlight_smooth_anim.h index 2a258b0c02e1..678298c4270e 100644 --- a/quantum/rgb_matrix/animations/starlight_smooth_anim.h +++ b/quantum/rgb_matrix/animations/starlight_smooth_anim.h @@ -1,16 +1,16 @@ #ifdef ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH RGB_MATRIX_EFFECT(STAR_LIGHT_SMOOTH) -#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS -//inspired by @PleasureTek's Massdrop Alt LED animation +// inspired by @PleasureTek's Massdrop Alt LED animation bool STAR_LIGHT_SMOOTH(effect_params_t* params) { RGB_MATRIX_USE_LIMITS(led_min, led_max); for (uint8_t i = led_min; i < led_max; i++) { - HSV hsv = rgb_matrix_config.hsv; + HSV hsv = rgb_matrix_config.hsv; uint16_t time = scale16by8(g_rgb_timer + (i * 315), rgb_matrix_config.speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - RGB rgb = rgb_matrix_hsv_to_rgb(hsv); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = rgb_matrix_hsv_to_rgb(hsv); RGB_MATRIX_TEST_LED_FLAGS(); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } @@ -18,5 +18,5 @@ bool STAR_LIGHT_SMOOTH(effect_params_t* params) { return rgb_matrix_check_finished_leds(led_max); } -#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH From 95f84ffd4cb1af2807790cf4b8bf06d793c47c0f Mon Sep 17 00:00:00 2001 From: bactaholic Date: Thu, 5 Oct 2023 16:54:22 -0700 Subject: [PATCH 04/10] undo clang-format on .h undoing auto-clang --- keyboards/moonlander/config.h | 156 ++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 keyboards/moonlander/config.h diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h new file mode 100644 index 000000000000..27c0acb1e0ba --- /dev/null +++ b/keyboards/moonlander/config.h @@ -0,0 +1,156 @@ +/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> + * Copyright 2020 Jack Humbert + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + + +#define WEBUSB_LANDING_PAGE_URL u8"configure.ergodox-ez.com" + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 7 + +/* PCB default pin-out */ +// #define MATRIX_ROW_PINS { B10, B11, B12, B13, B14, B15 } +// #define MATRIX_COL_PINS { A0, A1, A2, A3, A6, A7, B0 } + +// #define MCP23_ROW_PINS { GPB5, GBP4, GBP3, GBP2, GBP1, GBP0 } +// #define MCP23_COL_PINS { GPA0, GBA1, GBA2, GBA3, GBA4, GBA5, GBA6 } + +// #define MCP23_LED_R GPB7 +// #define MCP23_LED_G GPB6 +// #define MCP23_LED_B GPA7 + +#define EEPROM_I2C_24LC128 + +// Not needed, is default address: +// #define EXTERNAL_EEPROM_I2C_BASE_ADDRESS 0b10100000 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT + +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110111 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 36 +#define DRIVER_2_LED_TOTAL 36 +#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +#define RGB_MATRIX_CENTER { 120, 36 } +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 175 +#define RGB_MATRIX_FRAMEBUFFER_EFFECTS +#define RGB_MATRIX_KEYPRESSES +#define RGB_DISABLE_WHEN_USB_SUSPENDED +// 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_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 +# define ENABLE_RGB_MATRIX_STARLIGHT +# define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE +# define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT +# define ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH + +// #define RGB_MATRIX_LED_PROCESS_LIMIT 5 +// #define RGB_MATRIX_LED_FLUSH_LIMIT 26 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 400 +#define MOUSEKEY_WHEEL_INTERVAL MOUSEKEY_INTERVAL +#define MOUSEKEY_WHEEL_MAX_SPEED MOUSEKEY_MAX_SPEED +#define MOUSEKEY_WHEEL_TIME_TO_MAX MOUSEKEY_TIME_TO_MAX + +#define MUSIC_MAP + +#define FIRMWARE_VERSION_SIZE 17 +#define DYNAMIC_KEYMAP_EEPROM_ADDR (EECONFIG_SIZE + FIRMWARE_VERSION_SIZE) +#ifdef EEPROM_I2C +# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 16383 +# define DYNAMIC_KEYMAP_LAYER_COUNT 8 +#endif + +#define AUDIO_PIN A5 +#define AUDIO_PIN_ALT A4 +#define AUDIO_PIN_ALT_AS_NEGATIVE From 0255ea04ff4323e8fd756ca3593050906a8f72a3 Mon Sep 17 00:00:00 2001 From: bactaholic Date: Thu, 5 Oct 2023 16:55:21 -0700 Subject: [PATCH 05/10] undo clang-format on moonlander keymap.c yet another clang-format fix --- keyboards/moonlander/keymaps/default/keymap.c | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 keyboards/moonlander/keymaps/default/keymap.c diff --git a/keyboards/moonlander/keymaps/default/keymap.c b/keyboards/moonlander/keymaps/default/keymap.c new file mode 100644 index 000000000000..754227262fb2 --- /dev/null +++ b/keyboards/moonlander/keymaps/default/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> + * Copyright 2020 Jack Humbert + * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + + +#include QMK_KEYBOARD_H +#include "version.h" + +enum layers { + BASE, // default layer + SYMB, // symbols + MDIA, // media keys +}; + +enum custom_keycodes { + VRSN = SAFE_RANGE, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT_moonlander( + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HYPR, KC_MEH, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), LGUI_T(KC_QUOT), + KC_LSFT, LCTL_T(KC_Z),KC_X,KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RCTL_T(KC_SLSH), KC_RSFT, + LT(SYMB,KC_GRV),WEBUSB_PAIR,A(KC_LSFT),KC_LEFT, KC_RGHT, LALT_T(KC_APP), RCTL_T(KC_ESC), KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, MO(SYMB), + KC_SPC, KC_BSPC, KC_LGUI, KC_LALT, KC_TAB, KC_ENT + ), + + [SYMB] = LAYOUT_moonlander( + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, _______, _______, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, _______, + EE_CLR, _______, _______, _______, _______, RGB_VAI, RGB_TOG, _______, KC_DOT, KC_0, KC_EQL, _______, + RGB_HUD, RGB_VAD, RGB_HUI, TOGGLE_LAYER_COLOR,_______, _______ + ), + + [MDIA] = LAYOUT_moonlander( + LED_LEVEL,_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, + _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, _______, _______, + _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, + _______, _______, _______, _______, _______, _______ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch (keycode) { + case VRSN: + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + return false; + } + } + return true; +} From 677e8073cfa7be939e68acc684af5dcb8170928b Mon Sep 17 00:00:00 2001 From: bactaholic Date: Thu, 5 Oct 2023 16:55:57 -0700 Subject: [PATCH 06/10] fixed clang note on moonlander keymap.c --- keyboards/moonlander/keymaps/default/keymap.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/keyboards/moonlander/keymaps/default/keymap.c b/keyboards/moonlander/keymaps/default/keymap.c index 754227262fb2..8148dc15fda7 100644 --- a/keyboards/moonlander/keymaps/default/keymap.c +++ b/keyboards/moonlander/keymaps/default/keymap.c @@ -16,15 +16,13 @@ * along with this program. If not, see . */ - - #include QMK_KEYBOARD_H #include "version.h" enum layers { - BASE, // default layer - SYMB, // symbols - MDIA, // media keys + BASE, // default layer + SYMB, // symbols + MDIA, // media keys }; enum custom_keycodes { From ca983ebe436d31030392c52ff1f45264eca5f27e Mon Sep 17 00:00:00 2001 From: bactaholic Date: Thu, 5 Oct 2023 17:51:53 -0700 Subject: [PATCH 07/10] undo moonlander config.h additions --- keyboards/moonlander/config.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h index 27c0acb1e0ba..389f97d6963d 100644 --- a/keyboards/moonlander/config.h +++ b/keyboards/moonlander/config.h @@ -125,10 +125,6 @@ # define ENABLE_RGB_MATRIX_MULTISPLASH # define ENABLE_RGB_MATRIX_SOLID_SPLASH # define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH -# define ENABLE_RGB_MATRIX_STARLIGHT -# define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE -# define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT -# define ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH // #define RGB_MATRIX_LED_PROCESS_LIMIT 5 // #define RGB_MATRIX_LED_FLUSH_LIMIT 26 From 0f66bf6d46d458d5352de3eb62add9c3ab330600 Mon Sep 17 00:00:00 2001 From: bactaholic Date: Fri, 6 Oct 2023 17:22:43 -0700 Subject: [PATCH 08/10] fix moonlander files --- keyboards/moonlander/config.h | 10 +++------- keyboards/moonlander/keymaps/default/keymap.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h index 389f97d6963d..7c20260162d6 100644 --- a/keyboards/moonlander/config.h +++ b/keyboards/moonlander/config.h @@ -65,10 +65,10 @@ //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -#define DRIVER_ADDR_1 0b1110100 -#define DRIVER_ADDR_2 0b1110111 +#define DRIVER_ADDR_1 IS31FL3731_I2C_ADDRESS_GND +#define DRIVER_ADDR_2 IS31FL3731_I2C_ADDRESS_VCC -#define DRIVER_COUNT 2 +#define IS31FL3731_DRIVER_COUNT 2 #define DRIVER_1_LED_TOTAL 36 #define DRIVER_2_LED_TOTAL 36 #define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) @@ -142,10 +142,6 @@ #define FIRMWARE_VERSION_SIZE 17 #define DYNAMIC_KEYMAP_EEPROM_ADDR (EECONFIG_SIZE + FIRMWARE_VERSION_SIZE) -#ifdef EEPROM_I2C -# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 16383 -# define DYNAMIC_KEYMAP_LAYER_COUNT 8 -#endif #define AUDIO_PIN A5 #define AUDIO_PIN_ALT A4 diff --git a/keyboards/moonlander/keymaps/default/keymap.c b/keyboards/moonlander/keymaps/default/keymap.c index 8148dc15fda7..ad7705eff835 100644 --- a/keyboards/moonlander/keymaps/default/keymap.c +++ b/keyboards/moonlander/keymaps/default/keymap.c @@ -16,13 +16,15 @@ * along with this program. If not, see . */ + + #include QMK_KEYBOARD_H #include "version.h" enum layers { - BASE, // default layer - SYMB, // symbols - MDIA, // media keys + BASE, // default layer + SYMB, // symbols + MDIA, // media keys }; enum custom_keycodes { @@ -31,7 +33,7 @@ enum custom_keycodes { // clang-format off const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT_moonlander( + [BASE] = LAYOUT( KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DEL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HYPR, KC_MEH, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), LGUI_T(KC_QUOT), @@ -40,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_SPC, KC_BSPC, KC_LGUI, KC_LALT, KC_TAB, KC_ENT ), - [SYMB] = LAYOUT_moonlander( + [SYMB] = LAYOUT( VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, _______, _______, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, _______, @@ -49,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RGB_HUD, RGB_VAD, RGB_HUI, TOGGLE_LAYER_COLOR,_______, _______ ), - [MDIA] = LAYOUT_moonlander( + [MDIA] = LAYOUT( LED_LEVEL,_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT, _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, From 73379b0ba8e60bddfd23195962ae9280709eb11e Mon Sep 17 00:00:00 2001 From: bactaholic Date: Tue, 17 Oct 2023 15:43:54 -0700 Subject: [PATCH 09/10] updating the docs, renamed Starlight Smooth to Riverflow --- docs/feature_rgb_matrix.md | 8 +++++++ .../animations/rgb_matrix_effects.inc | 3 ++- .../rgb_matrix/animations/riverflow_anim.h | 22 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 quantum/rgb_matrix/animations/riverflow_anim.h diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 82b45583ec07..db1fa5d031cd 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -668,6 +668,10 @@ enum rgb_matrix_effects { RGB_MATRIX_MULTISPLASH, // Full gradient & value pulse away from multiple key hits then fades value out RGB_MATRIX_SOLID_SPLASH, // Hue & value pulse away from a single key hit then fades value out RGB_MATRIX_SOLID_MULTISPLASH, // Hue & value pulse away from multiple key hits then fades value out + RGB_MATRIX_STARLIGHT, // LEDs turn on and off at random at varying brightness, maintaining user set color + RGB_MATRIX_STARLIGHT_DUAL_HUE, // LEDs turn on and off at random at varying brightness, modifies user set hue by +- 30 + RGB_MATRIX_STARLIGHT_DUAL_SAT, // LEDs turn on and off at random at varying brightness, modifies user set saturation by +- 30 + RGB_MATRIX_RIVERFLOW, // Modification to breathing animation, offset's animation depending on key location to simulate a river flowing RGB_MATRIX_EFFECT_MAX }; ``` @@ -707,6 +711,10 @@ You can enable a single effect by defining `ENABLE_[EFFECT_NAME]` in your `confi |`#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL` |Enables `RGB_MATRIX_PIXEL_FRACTAL` | |`#define ENABLE_RGB_MATRIX_PIXEL_FLOW` |Enables `RGB_MATRIX_PIXEL_FLOW` | |`#define ENABLE_RGB_MATRIX_PIXEL_RAIN` |Enables `RGB_MATRIX_PIXEL_RAIN` | +|`#define ENABLE_RGB_MATRIX_STARLIGHT` |Enables `RGB_MATRIX_STARLIGHT` | +|`#define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_HUE` |Enables `RGB_MATRIX_STARLIGHT_DUAL_HUE` | +|`#define ENABLE_RGB_MATRIX_STARLIGHT_DUAL_SAT` |Enables `RGB_MATRIX_STARLIGHT_DUAL_SAT` | +|`#define ENABLE_RGB_MATRIX_RIVERFLOW` |Enables `RGB_MATRIX_RIVERFLOW` | |Framebuffer Defines |Description | |------------------------------------------------------|----------------------------------------------| diff --git a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc index a8fa72e6abf5..a02238a2d1a6 100644 --- a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc +++ b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc @@ -41,4 +41,5 @@ #include "solid_splash_anim.h" #include "starlight_anim.h" #include "starlight_dual_sat_anim.h" -#include "starlight_dual_hue_anim.h" \ No newline at end of file +#include "starlight_dual_hue_anim.h" +#include "riverflow_anim.h" \ No newline at end of file diff --git a/quantum/rgb_matrix/animations/riverflow_anim.h b/quantum/rgb_matrix/animations/riverflow_anim.h new file mode 100644 index 000000000000..79a38e7f6ef6 --- /dev/null +++ b/quantum/rgb_matrix/animations/riverflow_anim.h @@ -0,0 +1,22 @@ +#ifdef ENABLE_RGB_MATRIX_RIVERFLOW +RGB_MATRIX_EFFECT(RIVERFLOW) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +// inspired by @PleasureTek's Massdrop Alt LED animation + +bool RIVERFLOW(effect_params_t* params) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + for (uint8_t i = led_min; i < led_max; i++) { + HSV hsv = rgb_matrix_config.hsv; + uint16_t time = scale16by8(g_rgb_timer + (i * 315), rgb_matrix_config.speed / 8); + hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); + RGB rgb = rgb_matrix_hsv_to_rgb(hsv); + RGB_MATRIX_TEST_LED_FLAGS(); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + + return rgb_matrix_check_finished_leds(led_max); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_RIVERFLOW From c65af349360da674e2b8a1e2b4471ce125f041d1 Mon Sep 17 00:00:00 2001 From: db <108231591+bactaholic@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:47:18 -0700 Subject: [PATCH 10/10] Delete quantum/rgb_matrix/animations/starlight_smooth_anim.h removed starlight smooth animation .h --- .../animations/starlight_smooth_anim.h | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 quantum/rgb_matrix/animations/starlight_smooth_anim.h diff --git a/quantum/rgb_matrix/animations/starlight_smooth_anim.h b/quantum/rgb_matrix/animations/starlight_smooth_anim.h deleted file mode 100644 index 678298c4270e..000000000000 --- a/quantum/rgb_matrix/animations/starlight_smooth_anim.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifdef ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH -RGB_MATRIX_EFFECT(STAR_LIGHT_SMOOTH) -# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS - -// inspired by @PleasureTek's Massdrop Alt LED animation - -bool STAR_LIGHT_SMOOTH(effect_params_t* params) { - RGB_MATRIX_USE_LIMITS(led_min, led_max); - for (uint8_t i = led_min; i < led_max; i++) { - HSV hsv = rgb_matrix_config.hsv; - uint16_t time = scale16by8(g_rgb_timer + (i * 315), rgb_matrix_config.speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - RGB rgb = rgb_matrix_hsv_to_rgb(hsv); - RGB_MATRIX_TEST_LED_FLAGS(); - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - - return rgb_matrix_check_finished_leds(led_max); -} - -# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS -#endif // ENABLE_RGB_MATRIX_STARLIGHT_SMOOTH