diff options
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/rgb_matrix.h | 6 | ||||
| -rw-r--r-- | quantum/rgb_matrix_drivers.c | 21 | ||||
| -rw-r--r-- | quantum/rgblight.c | 4 |
3 files changed, 29 insertions, 2 deletions
diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 0e193dcb2..0a11f2692 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h | |||
| @@ -28,9 +28,11 @@ | |||
| 28 | #ifdef IS31FL3731 | 28 | #ifdef IS31FL3731 |
| 29 | #include "is31fl3731.h" | 29 | #include "is31fl3731.h" |
| 30 | #elif defined (IS31FL3733) | 30 | #elif defined (IS31FL3733) |
| 31 | #include "is31fl3733.h" | 31 | #include "is31fl3733.h" |
| 32 | #elif defined (IS31FL3737) | 32 | #elif defined (IS31FL3737) |
| 33 | #include "is31fl3737.h" | 33 | #include "is31fl3737.h" |
| 34 | #elif defined (WS2812) | ||
| 35 | #include "ws2812.h" | ||
| 34 | #endif | 36 | #endif |
| 35 | 37 | ||
| 36 | #ifndef RGB_MATRIX_LED_FLUSH_LIMIT | 38 | #ifndef RGB_MATRIX_LED_FLUSH_LIMIT |
diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index 3b7d58483..3814dd61f 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c | |||
| @@ -97,4 +97,25 @@ const rgb_matrix_driver_t rgb_matrix_driver = { | |||
| 97 | }; | 97 | }; |
| 98 | #endif | 98 | #endif |
| 99 | 99 | ||
| 100 | #elif defined(WS2812) | ||
| 101 | |||
| 102 | extern LED_TYPE led[RGBLED_NUM]; | ||
| 103 | |||
| 104 | static void flush( void ) | ||
| 105 | { | ||
| 106 | // Assumes use of RGB_DI_PIN | ||
| 107 | ws2812_setleds(led, RGBLED_NUM); | ||
| 108 | } | ||
| 109 | |||
| 110 | static void init( void ) | ||
| 111 | { | ||
| 112 | |||
| 113 | } | ||
| 114 | |||
| 115 | const rgb_matrix_driver_t rgb_matrix_driver = { | ||
| 116 | .init = init, | ||
| 117 | .flush = flush, | ||
| 118 | .set_color = ws2812_setled, | ||
| 119 | .set_color_all = ws2812_setled_all, | ||
| 120 | }; | ||
| 100 | #endif | 121 | #endif |
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 08515564b..e2410424e 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
| @@ -63,7 +63,11 @@ const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; | |||
| 63 | rgblight_config_t rgblight_config; | 63 | rgblight_config_t rgblight_config; |
| 64 | bool is_rgblight_initialized = false; | 64 | bool is_rgblight_initialized = false; |
| 65 | 65 | ||
| 66 | #ifndef LED_ARRAY | ||
| 66 | LED_TYPE led[RGBLED_NUM]; | 67 | LED_TYPE led[RGBLED_NUM]; |
| 68 | #define LED_ARRAY led | ||
| 69 | #endif | ||
| 70 | |||
| 67 | bool rgblight_timer_enabled = false; | 71 | bool rgblight_timer_enabled = false; |
| 68 | 72 | ||
| 69 | static uint8_t clipping_start_pos = 0; | 73 | static uint8_t clipping_start_pos = 0; |
