summaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-09-16 03:44:39 +0200
committerJack Humbert <jack.humb@gmail.com>2017-09-16 03:44:39 +0200
commit5ad5c230d6cf9f90a8337ec54dee8b14e332d3c6 (patch)
treeac6e6b0417e3c6550e6c8e07f615fabdc74b1ef1 /quantum
parentafcf3a2878d5b5de0f9daba201ab44d779a8b2b1 (diff)
parentdc7d0c7b7442b87600352e083e3da4a08cb2d069 (diff)
downloadqmk_firmware-5ad5c230d6cf9f90a8337ec54dee8b14e332d3c6.tar.gz
qmk_firmware-5ad5c230d6cf9f90a8337ec54dee8b14e332d3c6.tar.xz
Merge branch 'luizribeiro-ps2avrGB'
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgblight.c3
-rw-r--r--quantum/rgblight.h3
-rw-r--r--quantum/rgblight_types.h45
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) {
rgblight_set();
}
-__attribute__ ((weak))
+#ifndef RGBLIGHT_CUSTOM_DRIVER
void rgblight_set(void) {
if (rgblight_config.enable) {
#ifdef RGBW
@@ -394,6 +394,7 @@ void rgblight_set(void) {
#endif
}
}
+#endif
#ifdef RGBLIGHT_ANIMATIONS
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 @@
#include <stdint.h>
#include <stdbool.h>
#include "eeconfig.h"
+#ifndef RGBLIGHT_CUSTOM_DRIVER
#include "ws2812.h"
+#endif
+#include "rgblight_types.h"
extern LED_TYPE led[RGBLED_NUM];
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 @@
+/*
+ * light weight WS2812 lib include
+ *
+ * Version 2.3 - Nev 29th 2015
+ * Author: Tim (cpldcpu@gmail.com)
+ *
+ * Please do not change this file! All configuration is handled in "ws2812_config.h"
+ *
+ * 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/>.
+ */
+
+#ifndef RGBLIGHT_TYPES
+#define RGBLIGHT_TYPES
+
+#include <avr/io.h>
+
+#ifdef RGBW
+ #define LED_TYPE struct cRGBW
+#else
+ #define LED_TYPE struct cRGB
+#endif
+
+
+/*
+ * Structure of the LED array
+ *
+ * cRGB: RGB for WS2812S/B/C/D, SK6812, SK6812Mini, SK6812WWA, APA104, APA106
+ * cRGBW: RGBW for SK6812RGBW
+ */
+
+struct cRGB { uint8_t g; uint8_t r; uint8_t b; };
+struct cRGBW { uint8_t g; uint8_t r; uint8_t b; uint8_t w;};
+
+#endif