diff options
Diffstat (limited to 'quantum/rgb_matrix')
-rw-r--r-- | quantum/rgb_matrix/animations/flower_blooming_anim.h | 53 | ||||
-rw-r--r-- | quantum/rgb_matrix/animations/rgb_matrix_effects.inc | 1 | ||||
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix.c | 54 | ||||
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix.h | 75 | ||||
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix_drivers.c | 132 | ||||
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix_types.h | 15 |
6 files changed, 198 insertions, 132 deletions
diff --git a/quantum/rgb_matrix/animations/flower_blooming_anim.h b/quantum/rgb_matrix/animations/flower_blooming_anim.h new file mode 100644 index 0000000000..7629fde858 --- /dev/null +++ b/quantum/rgb_matrix/animations/flower_blooming_anim.h @@ -0,0 +1,53 @@ +/* Copyright 2023 HorrorTroll <https://github.com/HorrorTroll> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#ifdef ENABLE_RGB_MATRIX_FLOWER_BLOOMING +RGB_MATRIX_EFFECT(FLOWER_BLOOMING) +# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS + +typedef HSV (*flower_blooming_f)(HSV hsv, uint8_t i, uint8_t time); + +bool effect_runner_bloom(effect_params_t* params, flower_blooming_f effect_func) { + RGB_MATRIX_USE_LIMITS(led_min, led_max); + + uint8_t time = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed / 10, 1)); + for (uint8_t i = led_min; i < led_max; i++) { + RGB_MATRIX_TEST_LED_FLAGS(); + if (g_led_config.point[i].y > k_rgb_matrix_center.y) { + RGB bgr = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time)); + rgb_matrix_set_color(i, bgr.b, bgr.g, bgr.r); + } else { + RGB rgb = rgb_matrix_hsv_to_rgb(effect_func(rgb_matrix_config.hsv, i, time)); + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + } + return rgb_matrix_check_finished_leds(led_max); +} + +static HSV FLOWER_BLOOMING_math(HSV hsv, uint8_t i, uint8_t time) { + if (g_led_config.point[i].y > k_rgb_matrix_center.y) + hsv.h = g_led_config.point[i].x * 3 - g_led_config.point[i].y * 3 + time; + else + hsv.h = g_led_config.point[i].x * 3 - g_led_config.point[i].y * 3 - time; + return hsv; +} + +bool FLOWER_BLOOMING(effect_params_t* params) { + return effect_runner_bloom(params, &FLOWER_BLOOMING_math); +} + +# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS +#endif // ENABLE_RGB_MATRIX_FLOWER_BLOOMING diff --git a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc index ac7bac428d..df34718838 100644 --- a/quantum/rgb_matrix/animations/rgb_matrix_effects.inc +++ b/quantum/rgb_matrix/animations/rgb_matrix_effects.inc @@ -21,6 +21,7 @@ #include "dual_beacon_anim.h" #include "rainbow_beacon_anim.h" #include "rainbow_pinwheels_anim.h" +#include "flower_blooming_anim.h" #include "raindrops_anim.h" #include "jellybean_raindrops_anim.h" #include "hue_breathing_anim.h" diff --git a/quantum/rgb_matrix/rgb_matrix.c b/quantum/rgb_matrix/rgb_matrix.c index 96be615162..8e69616a0e 100644 --- a/quantum/rgb_matrix/rgb_matrix.c +++ b/quantum/rgb_matrix/rgb_matrix.c @@ -60,56 +60,6 @@ __attribute__((weak)) RGB rgb_matrix_hsv_to_rgb(HSV hsv) { // -----End rgb effect includes macros------- // ------------------------------------------ -#ifndef RGB_MATRIX_TIMEOUT -# define RGB_MATRIX_TIMEOUT 0 -#endif - -#if !defined(RGB_MATRIX_MAXIMUM_BRIGHTNESS) || RGB_MATRIX_MAXIMUM_BRIGHTNESS > UINT8_MAX -# undef RGB_MATRIX_MAXIMUM_BRIGHTNESS -# define RGB_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX -#endif - -#if !defined(RGB_MATRIX_HUE_STEP) -# define RGB_MATRIX_HUE_STEP 8 -#endif - -#if !defined(RGB_MATRIX_SAT_STEP) -# define RGB_MATRIX_SAT_STEP 16 -#endif - -#if !defined(RGB_MATRIX_VAL_STEP) -# define RGB_MATRIX_VAL_STEP 16 -#endif - -#if !defined(RGB_MATRIX_SPD_STEP) -# define RGB_MATRIX_SPD_STEP 16 -#endif - -#if !defined(RGB_MATRIX_DEFAULT_MODE) -# ifdef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT -# else -// fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace -# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR -# endif -#endif - -#if !defined(RGB_MATRIX_DEFAULT_HUE) -# define RGB_MATRIX_DEFAULT_HUE 0 -#endif - -#if !defined(RGB_MATRIX_DEFAULT_SAT) -# define RGB_MATRIX_DEFAULT_SAT UINT8_MAX -#endif - -#if !defined(RGB_MATRIX_DEFAULT_VAL) -# define RGB_MATRIX_DEFAULT_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS -#endif - -#if !defined(RGB_MATRIX_DEFAULT_SPD) -# define RGB_MATRIX_DEFAULT_SPD UINT8_MAX / 2 -#endif - // globals rgb_config_t rgb_matrix_config; // TODO: would like to prefix this with g_ for global consistancy, do this in another pr uint32_t g_rgb_timer; @@ -149,7 +99,7 @@ void eeconfig_update_rgb_matrix(void) { void eeconfig_update_rgb_matrix_default(void) { dprintf("eeconfig_update_rgb_matrix_default\n"); - rgb_matrix_config.enable = 1; + rgb_matrix_config.enable = RGB_MATRIX_DEFAULT_ON; rgb_matrix_config.mode = RGB_MATRIX_DEFAULT_MODE; rgb_matrix_config.hsv = (HSV){RGB_MATRIX_DEFAULT_HUE, RGB_MATRIX_DEFAULT_SAT, RGB_MATRIX_DEFAULT_VAL}; rgb_matrix_config.speed = RGB_MATRIX_DEFAULT_SPD; @@ -736,7 +686,7 @@ void rgb_matrix_decrease_speed(void) { void rgb_matrix_set_flags_eeprom_helper(led_flags_t flags, bool write_to_eeprom) { rgb_matrix_config.flags = flags; eeconfig_flag_rgb_matrix(write_to_eeprom); - dprintf("rgb matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.flags); + dprintf("rgb matrix set flags [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.flags); } led_flags_t rgb_matrix_get_flags(void) { diff --git a/quantum/rgb_matrix/rgb_matrix.h b/quantum/rgb_matrix/rgb_matrix.h index 38040fb0cc..8ac263c635 100644 --- a/quantum/rgb_matrix/rgb_matrix.h +++ b/quantum/rgb_matrix/rgb_matrix.h @@ -24,26 +24,81 @@ #include "color.h" #include "keyboard.h" -#ifdef IS31FL3731 +#if defined(RGB_MATRIX_IS31FL3218) +# include "is31fl3218.h" +#elif defined(RGB_MATRIX_IS31FL3731) # include "is31fl3731.h" -#elif defined(IS31FL3733) +#elif defined(RGB_MATRIX_IS31FL3733) # include "is31fl3733.h" -#elif defined(IS31FL3736) +#elif defined(RGB_MATRIX_IS31FL3736) # include "is31fl3736.h" -#elif defined(IS31FL3737) +#elif defined(RGB_MATRIX_IS31FL3737) # include "is31fl3737.h" -#elif defined(IS31FL3741) +#elif defined(RGB_MATRIX_IS31FL3741) # include "is31fl3741.h" #elif defined(IS31FLCOMMON) # include "is31flcommon.h" -#elif defined(CKLED2001) -# include "ckled2001.h" -#elif defined(AW20216) -# include "aw20216.h" -#elif defined(WS2812) +#elif defined(RGB_MATRIX_SNLED27351) +# include "snled27351.h" +#elif defined(RGB_MATRIX_AW20216S) +# include "aw20216s.h" +#elif defined(RGB_MATRIX_WS2812) # include "ws2812.h" #endif +#ifndef RGB_MATRIX_TIMEOUT +# define RGB_MATRIX_TIMEOUT 0 +#endif + +#ifndef RGB_MATRIX_MAXIMUM_BRIGHTNESS +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX +#endif + +#ifndef RGB_MATRIX_HUE_STEP +# define RGB_MATRIX_HUE_STEP 8 +#endif + +#ifndef RGB_MATRIX_SAT_STEP +# define RGB_MATRIX_SAT_STEP 16 +#endif + +#ifndef RGB_MATRIX_VAL_STEP +# define RGB_MATRIX_VAL_STEP 16 +#endif + +#ifndef RGB_MATRIX_SPD_STEP +# define RGB_MATRIX_SPD_STEP 16 +#endif + +#ifndef RGB_MATRIX_DEFAULT_ON +# define RGB_MATRIX_DEFAULT_ON true +#endif + +#ifndef RGB_MATRIX_DEFAULT_MODE +# ifdef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT +# else +// fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace +# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR +# endif +#endif + +#ifndef RGB_MATRIX_DEFAULT_HUE +# define RGB_MATRIX_DEFAULT_HUE 0 +#endif + +#ifndef RGB_MATRIX_DEFAULT_SAT +# define RGB_MATRIX_DEFAULT_SAT UINT8_MAX +#endif + +#ifndef RGB_MATRIX_DEFAULT_VAL +# define RGB_MATRIX_DEFAULT_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS +#endif + +#ifndef RGB_MATRIX_DEFAULT_SPD +# define RGB_MATRIX_DEFAULT_SPD UINT8_MAX / 2 +#endif + #ifndef RGB_MATRIX_LED_FLUSH_LIMIT # define RGB_MATRIX_LED_FLUSH_LIMIT 16 #endif diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c index 695ecc78a4..06d82b9c69 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix/rgb_matrix_drivers.c @@ -24,7 +24,7 @@ * be here if shared between boards. */ -#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3736) || defined(IS31FL3737) || defined(IS31FL3741) || defined(IS31FLCOMMON) || defined(CKLED2001) +#if defined(RGB_MATRIX_IS31FL3218) || defined(RGB_MATRIX_IS31FL3731) || defined(RGB_MATRIX_IS31FL3733) || defined(RGB_MATRIX_IS31FL3736) || defined(RGB_MATRIX_IS31FL3737) || defined(RGB_MATRIX_IS31FL3741) || defined(IS31FLCOMMON) || defined(RGB_MATRIX_SNLED27351) # include "i2c_master.h" // TODO: Remove this at some later date @@ -37,7 +37,10 @@ static void init(void) { i2c_init(); -# if defined(IS31FL3731) +# if defined(RGB_MATRIX_IS31FL3218) + is31fl3218_init(); + +# elif defined(RGB_MATRIX_IS31FL3731) is31fl3731_init(DRIVER_ADDR_1); # if defined(DRIVER_ADDR_2) is31fl3731_init(DRIVER_ADDR_2); @@ -49,7 +52,7 @@ static void init(void) { # endif # endif -# elif defined(IS31FL3733) +# elif defined(RGB_MATRIX_IS31FL3733) # if !defined(DRIVER_SYNC_1) # define DRIVER_SYNC_1 0 # endif @@ -73,7 +76,7 @@ static void init(void) { # endif # endif -# elif defined(IS31FL3736) +# elif defined(RGB_MATRIX_IS31FL3736) is31fl3736_init(DRIVER_ADDR_1); # if defined(DRIVER_ADDR_2) is31fl3736_init(DRIVER_ADDR_2); @@ -85,7 +88,7 @@ static void init(void) { # endif # endif -# elif defined(IS31FL3737) +# elif defined(RGB_MATRIX_IS31FL3737) is31fl3737_init(DRIVER_ADDR_1); # if defined(DRIVER_ADDR_2) is31fl3737_init(DRIVER_ADDR_2); @@ -97,7 +100,7 @@ static void init(void) { # endif # endif -# elif defined(IS31FL3741) +# elif defined(RGB_MATRIX_IS31FL3741) is31fl3741_init(DRIVER_ADDR_1); # if defined(DRIVER_ADDR_2) is31fl3741_init(DRIVER_ADDR_2); @@ -121,14 +124,14 @@ static void init(void) { # endif # endif -# elif defined(CKLED2001) - ckled2001_init(DRIVER_ADDR_1); +# elif defined(RGB_MATRIX_SNLED27351) + snled27351_init(DRIVER_ADDR_1); # if defined(DRIVER_ADDR_2) - ckled2001_init(DRIVER_ADDR_2); + snled27351_init(DRIVER_ADDR_2); # if defined(DRIVER_ADDR_3) - ckled2001_init(DRIVER_ADDR_3); + snled27351_init(DRIVER_ADDR_3); # if defined(DRIVER_ADDR_4) - ckled2001_init(DRIVER_ADDR_4); + snled27351_init(DRIVER_ADDR_4); # endif # endif # endif @@ -138,25 +141,30 @@ static void init(void) { bool enabled = true; // This only caches it for later -# if defined(IS31FL3731) +# if defined(RGB_MATRIX_IS31FL3218) + is31fl3218_set_led_control_register(index, enabled, enabled, enabled); +# elif defined(RGB_MATRIX_IS31FL3731) is31fl3731_set_led_control_register(index, enabled, enabled, enabled); -# elif defined(IS31FL3733) +# elif defined(RGB_MATRIX_IS31FL3733) is31fl3733_set_led_control_register(index, enabled, enabled, enabled); -# elif defined(IS31FL3736) +# elif defined(RGB_MATRIX_IS31FL3736) is31fl3736_set_led_control_register(index, enabled, enabled, enabled); -# elif defined(IS31FL3737) +# elif defined(RGB_MATRIX_IS31FL3737) is31fl3737_set_led_control_register(index, enabled, enabled, enabled); -# elif defined(IS31FL3741) +# elif defined(RGB_MATRIX_IS31FL3741) is31fl3741_set_led_control_register(index, enabled, enabled, enabled); # elif defined(IS31FLCOMMON) IS31FL_RGB_set_scaling_buffer(index, enabled, enabled, enabled); -# elif defined(CKLED2001) - ckled2001_set_led_control_register(index, enabled, enabled, enabled); +# elif defined(RGB_MATRIX_SNLED27351) + snled27351_set_led_control_register(index, enabled, enabled, enabled); # endif } // This actually updates the LED drivers -# if defined(IS31FL3731) +# if defined(RGB_MATRIX_IS31FL3218) + is31fl3218_update_led_control_registers(); + +# elif defined(RGB_MATRIX_IS31FL3731) is31fl3731_update_led_control_registers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) is31fl3731_update_led_control_registers(DRIVER_ADDR_2, 1); @@ -168,7 +176,7 @@ static void init(void) { # endif # endif -# elif defined(IS31FL3733) +# elif defined(RGB_MATRIX_IS31FL3733) is31fl3733_update_led_control_registers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) is31fl3733_update_led_control_registers(DRIVER_ADDR_2, 1); @@ -180,7 +188,7 @@ static void init(void) { # endif # endif -# elif defined(IS31FL3736) +# elif defined(RGB_MATRIX_IS31FL3736) is31fl3736_update_led_control_registers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) is31fl3736_update_led_control_registers(DRIVER_ADDR_2, 1); @@ -192,7 +200,7 @@ static void init(void) { # endif # endif -# elif defined(IS31FL3737) +# elif defined(RGB_MATRIX_IS31FL3737) is31fl3737_update_led_control_registers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) is31fl3737_update_led_control_registers(DRIVER_ADDR_2, 1); @@ -204,7 +212,7 @@ static void init(void) { # endif # endif -# elif defined(IS31FL3741) +# elif defined(RGB_MATRIX_IS31FL3741) is31fl3741_update_led_control_registers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) is31fl3741_update_led_control_registers(DRIVER_ADDR_2, 1); @@ -231,21 +239,33 @@ static void init(void) { # endif # endif -# elif defined(CKLED2001) - ckled2001_update_led_control_registers(DRIVER_ADDR_1, 0); +# elif defined(RGB_MATRIX_SNLED27351) + snled27351_update_led_control_registers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) - ckled2001_update_led_control_registers(DRIVER_ADDR_2, 1); + snled27351_update_led_control_registers(DRIVER_ADDR_2, 1); # if defined(DRIVER_ADDR_3) - ckled2001_update_led_control_registers(DRIVER_ADDR_3, 2); + snled27351_update_led_control_registers(DRIVER_ADDR_3, 2); # if defined(DRIVER_ADDR_4) - ckled2001_update_led_control_registers(DRIVER_ADDR_4, 3); + snled27351_update_led_control_registers(DRIVER_ADDR_4, 3); # endif # endif # endif # endif } -# if defined(IS31FL3731) +# if defined(RGB_MATRIX_IS31FL3218) +static void flush(void) { + is31fl3218_update_pwm_buffers(); +} + +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = init, + .flush = flush, + .set_color = is31fl3218_set_color, + .set_color_all = is31fl3218_set_color_all, +}; + +# elif defined(RGB_MATRIX_IS31FL3731) static void flush(void) { is31fl3731_update_pwm_buffers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) @@ -260,13 +280,13 @@ static void flush(void) { } const rgb_matrix_driver_t rgb_matrix_driver = { - .init = init, - .flush = flush, - .set_color = is31fl3731_set_color, + .init = init, + .flush = flush, + .set_color = is31fl3731_set_color, .set_color_all = is31fl3731_set_color_all, }; -# elif defined(IS31FL3733) +# elif defined(RGB_MATRIX_IS31FL3733) static void flush(void) { is31fl3733_update_pwm_buffers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) @@ -287,7 +307,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color_all = is31fl3733_set_color_all, }; -# elif defined(IS31FL3736) +# elif defined(RGB_MATRIX_IS31FL3736) static void flush(void) { is31fl3736_update_pwm_buffers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) @@ -308,7 +328,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color_all = is31fl3736_set_color_all, }; -# elif defined(IS31FL3737) +# elif defined(RGB_MATRIX_IS31FL3737) static void flush(void) { is31fl3737_update_pwm_buffers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) @@ -329,7 +349,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color_all = is31fl3737_set_color_all, }; -# elif defined(IS31FL3741) +# elif defined(RGB_MATRIX_IS31FL3741) static void flush(void) { is31fl3741_update_pwm_buffers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) @@ -371,15 +391,15 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color_all = IS31FL_RGB_set_color_all, }; -# elif defined(CKLED2001) +# elif defined(RGB_MATRIX_SNLED27351) static void flush(void) { - ckled2001_update_pwm_buffers(DRIVER_ADDR_1, 0); + snled27351_update_pwm_buffers(DRIVER_ADDR_1, 0); # if defined(DRIVER_ADDR_2) - ckled2001_update_pwm_buffers(DRIVER_ADDR_2, 1); + snled27351_update_pwm_buffers(DRIVER_ADDR_2, 1); # if defined(DRIVER_ADDR_3) - ckled2001_update_pwm_buffers(DRIVER_ADDR_3, 2); + snled27351_update_pwm_buffers(DRIVER_ADDR_3, 2); # if defined(DRIVER_ADDR_4) - ckled2001_update_pwm_buffers(DRIVER_ADDR_4, 3); + snled27351_update_pwm_buffers(DRIVER_ADDR_4, 3); # endif # endif # endif @@ -388,46 +408,46 @@ static void flush(void) { const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, .flush = flush, - .set_color = ckled2001_set_color, - .set_color_all = ckled2001_set_color_all, + .set_color = snled27351_set_color, + .set_color_all = snled27351_set_color_all, }; # endif -#elif defined(AW20216) +#elif defined(RGB_MATRIX_AW20216S) # include "spi_master.h" static void init(void) { spi_init(); - aw20216_init(DRIVER_1_CS, DRIVER_1_EN); -# if defined(DRIVER_2_CS) - aw20216_init(DRIVER_2_CS, DRIVER_2_EN); + aw20216s_init(AW20216S_DRIVER_1_CS, AW20216S_DRIVER_1_EN); +# if defined(AW20216S_DRIVER_2_CS) + aw20216s_init(AW20216S_DRIVER_2_CS, AW20216S_DRIVER_2_EN); # endif } static void flush(void) { - aw20216_update_pwm_buffers(DRIVER_1_CS, 0); -# if defined(DRIVER_2_CS) - aw20216_update_pwm_buffers(DRIVER_2_CS, 1); + aw20216s_update_pwm_buffers(AW20216S_DRIVER_1_CS, 0); +# if defined(AW20216S_DRIVER_2_CS) + aw20216s_update_pwm_buffers(AW20216S_DRIVER_2_CS, 1); # endif } const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, .flush = flush, - .set_color = aw20216_set_color, - .set_color_all = aw20216_set_color_all, + .set_color = aw20216s_set_color, + .set_color_all = aw20216s_set_color_all, }; -#elif defined(WS2812) -# if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_CUSTOM_DRIVER) +#elif defined(RGB_MATRIX_WS2812) +# if defined(RGBLIGHT_WS2812) # pragma message "Cannot use RGBLIGHT and RGB Matrix using WS2812 at the same time." # pragma message "You need to use a custom driver, or re-implement the WS2812 driver to use a different configuration." # endif // LED color buffer -LED_TYPE rgb_matrix_ws2812_array[RGB_MATRIX_LED_COUNT]; -bool ws2812_dirty = false; +rgb_led_t rgb_matrix_ws2812_array[RGB_MATRIX_LED_COUNT]; +bool ws2812_dirty = false; static void init(void) { ws2812_dirty = false; diff --git a/quantum/rgb_matrix/rgb_matrix_types.h b/quantum/rgb_matrix/rgb_matrix_types.h index 53ff7321b8..0a3fd7cc0d 100644 --- a/quantum/rgb_matrix/rgb_matrix_types.h +++ b/quantum/rgb_matrix/rgb_matrix_types.h @@ -19,16 +19,7 @@ #include <stdint.h> #include <stdbool.h> #include "color.h" - -#if defined(__GNUC__) -# define PACKED __attribute__((__packed__)) -#else -# define PACKED -#endif - -#if defined(_MSC_VER) -# pragma pack(push, 1) -#endif +#include "util.h" #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) # define RGB_MATRIX_KEYREACTIVE_ENABLED @@ -94,7 +85,3 @@ typedef union { } rgb_config_t; _Static_assert(sizeof(rgb_config_t) == sizeof(uint64_t), "RGB Matrix EECONFIG out of spec."); - -#if defined(_MSC_VER) -# pragma pack(pop) -#endif |