summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Liu <i@yangliu.name>2016-01-24 17:05:47 -0800
committerYang Liu <i@yangliu.name>2016-01-24 17:05:47 -0800
commitba9ac457b2159097ecfd9848c5171c52e3a68260 (patch)
tree3e24c67dcac80ea1628caf9f1791f8296fa89c2e
parent0a40654b82520849fcc587e8fb76c823378649a6 (diff)
Integrate WS2812 code into quantum core
-rw-r--r--keyboard/planck/Makefile8
-rw-r--r--keyboard/planck/config.h6
-rwxr-xr-xquantum/light_ws2812.c (renamed from keyboard/planck/light_ws2812.c)0
-rwxr-xr-xquantum/light_ws2812.h (renamed from keyboard/planck/light_ws2812.h)0
-rw-r--r--quantum/quantum.mk9
-rw-r--r--quantum/rgblight.c (renamed from keyboard/planck/rgblight.c)0
-rw-r--r--quantum/rgblight.h (renamed from keyboard/planck/rgblight.h)0
7 files changed, 8 insertions, 15 deletions
diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile
index d37005260a..7619399b98 100644
--- a/keyboard/planck/Makefile
+++ b/keyboard/planck/Makefile
@@ -143,18 +143,12 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
# AUDIO_ENABLE = YES # Audio output on port C6
# UNICODE_ENABLE = YES # Unicode
# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
-RGBLIGHT_ENABLE = yes # Enable WS2812 bottom RGB light
+RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with MIDI at the same time.
ifdef BACKLIGHT_ENABLE
SRC += backlight.c
endif
-ifdef RGBLIGHT_ENABLE
- SRC += light_ws2812.c
- SRC += rgblight.c
- OPT_DEFS += -DRGBLIGHT_ENABLE
-endif
-
# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax
diff --git a/keyboard/planck/config.h b/keyboard/planck/config.h
index 856de73066..d3719e0cb1 100644
--- a/keyboard/planck/config.h
+++ b/keyboard/planck/config.h
@@ -63,15 +63,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define ws2812_DDRREG DDRD
#define ws2812_pin PD1
#define RGBLED_NUM 28 // Number of LEDs
-#ifndef RGBLIGHT_HUE_STEP
#define RGBLIGHT_HUE_STEP 10
-#endif
-#ifndef RGBLIGHT_SAT_STEP
#define RGBLIGHT_SAT_STEP 17
-#endif
-#ifndef RGBLIGHT_VAL_STEP
#define RGBLIGHT_VAL_STEP 17
-#endif
/*
* Feature disable options
diff --git a/keyboard/planck/light_ws2812.c b/quantum/light_ws2812.c
index f20043067e..f20043067e 100755
--- a/keyboard/planck/light_ws2812.c
+++ b/quantum/light_ws2812.c
diff --git a/keyboard/planck/light_ws2812.h b/quantum/light_ws2812.h
index 54eef22d9e..54eef22d9e 100755
--- a/keyboard/planck/light_ws2812.h
+++ b/quantum/light_ws2812.h
diff --git a/quantum/quantum.mk b/quantum/quantum.mk
index df72241788..de93af7e8c 100644
--- a/quantum/quantum.mk
+++ b/quantum/quantum.mk
@@ -2,7 +2,7 @@ QUANTUM_DIR = quantum
# # project specific files
SRC += $(QUANTUM_DIR)/keymap_common.c \
- $(QUANTUM_DIR)/led.c
+ $(QUANTUM_DIR)/led.c
# ifdef KEYMAP_FILE
# ifneq (,$(shell grep USING_MIDI '$(KEYMAP_FILE)'))
@@ -35,6 +35,12 @@ ifdef UNICODE_ENABLE
SRC += $(QUANTUM_DIR)/keymap_unicode.c
endif
+ifdef RGBLIGHT_ENABLE
+ SRC += $(QUANTUM_DIR)/light_ws2812.c
+ SRC += $(QUANTUM_DIR)/rgblight.c
+ OPT_DEFS += -DRGBLIGHT_ENABLE
+endif
+
# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax
@@ -45,4 +51,3 @@ include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk
-
diff --git a/keyboard/planck/rgblight.c b/quantum/rgblight.c
index 552456aae3..552456aae3 100644
--- a/keyboard/planck/rgblight.c
+++ b/quantum/rgblight.c
diff --git a/keyboard/planck/rgblight.h b/quantum/rgblight.h
index fd39ead09f..fd39ead09f 100644
--- a/keyboard/planck/rgblight.h
+++ b/quantum/rgblight.h