diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2017-09-15 21:43:58 -0400 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2017-09-15 21:43:58 -0400 |
| commit | dc7d0c7b7442b87600352e083e3da4a08cb2d069 (patch) | |
| tree | ac6e6b0417e3c6550e6c8e07f615fabdc74b1ef1 /quantum | |
| parent | afcf3a2878d5b5de0f9daba201ab44d779a8b2b1 (diff) | |
| parent | d5486265b8afcada68306c815b08c225fce287af (diff) | |
| download | qmk_firmware-dc7d0c7b7442b87600352e083e3da4a08cb2d069.tar.gz qmk_firmware-dc7d0c7b7442b87600352e083e3da4a08cb2d069.zip | |
update to driver separation
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/rgblight.c | 3 | ||||
| -rw-r--r-- | quantum/rgblight.h | 3 | ||||
| -rw-r--r-- | quantum/rgblight_types.h | 45 |
3 files changed, 50 insertions, 1 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 5ae6e69d6..9ac1893d2 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
| @@ -373,7 +373,7 @@ void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) { | |||
| 373 | rgblight_set(); | 373 | rgblight_set(); |
| 374 | } | 374 | } |
| 375 | 375 | ||
| 376 | __attribute__ ((weak)) | 376 | #ifndef RGBLIGHT_CUSTOM_DRIVER |
| 377 | void rgblight_set(void) { | 377 | void rgblight_set(void) { |
| 378 | if (rgblight_config.enable) { | 378 | if (rgblight_config.enable) { |
| 379 | #ifdef RGBW | 379 | #ifdef RGBW |
| @@ -394,6 +394,7 @@ void rgblight_set(void) { | |||
| 394 | #endif | 394 | #endif |
| 395 | } | 395 | } |
| 396 | } | 396 | } |
| 397 | #endif | ||
| 397 | 398 | ||
| 398 | #ifdef RGBLIGHT_ANIMATIONS | 399 | #ifdef RGBLIGHT_ANIMATIONS |
| 399 | 400 | ||
diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 7acd5a257..c1b3378b3 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h | |||
| @@ -62,7 +62,10 @@ | |||
| 62 | #include <stdint.h> | 62 | #include <stdint.h> |
| 63 | #include <stdbool.h> | 63 | #include <stdbool.h> |
| 64 | #include "eeconfig.h" | 64 | #include "eeconfig.h" |
| 65 | #ifndef RGBLIGHT_CUSTOM_DRIVER | ||
| 65 | #include "ws2812.h" | 66 | #include "ws2812.h" |
| 67 | #endif | ||
| 68 | #include "rgblight_types.h" | ||
| 66 | 69 | ||
| 67 | extern LED_TYPE led[RGBLED_NUM]; | 70 | extern LED_TYPE led[RGBLED_NUM]; |
| 68 | 71 | ||
diff --git a/quantum/rgblight_types.h b/quantum/rgblight_types.h new file mode 100644 index 000000000..b1aa7026c --- /dev/null +++ b/quantum/rgblight_types.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | /* | ||
| 2 | * light weight WS2812 lib include | ||
| 3 | * | ||
| 4 | * Version 2.3 - Nev 29th 2015 | ||
| 5 | * Author: Tim (cpldcpu@gmail.com) | ||
| 6 | * | ||
| 7 | * Please do not change this file! All configuration is handled in "ws2812_config.h" | ||
| 8 | * | ||
| 9 | * This program is free software: you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation, either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef RGBLIGHT_TYPES | ||
| 24 | #define RGBLIGHT_TYPES | ||
| 25 | |||
| 26 | #include <avr/io.h> | ||
| 27 | |||
| 28 | #ifdef RGBW | ||
| 29 | #define LED_TYPE struct cRGBW | ||
| 30 | #else | ||
| 31 | #define LED_TYPE struct cRGB | ||
| 32 | #endif | ||
| 33 | |||
| 34 | |||
| 35 | /* | ||
| 36 | * Structure of the LED array | ||
| 37 | * | ||
| 38 | * cRGB: RGB for WS2812S/B/C/D, SK6812, SK6812Mini, SK6812WWA, APA104, APA106 | ||
| 39 | * cRGBW: RGBW for SK6812RGBW | ||
| 40 | */ | ||
| 41 | |||
| 42 | struct cRGB { uint8_t g; uint8_t r; uint8_t b; }; | ||
| 43 | struct cRGBW { uint8_t g; uint8_t r; uint8_t b; uint8_t w;}; | ||
| 44 | |||
| 45 | #endif | ||
