diff options
author | Joel Challis <git@zvecr.com> | 2019-10-17 17:48:58 +0100 |
---|---|---|
committer | Florian Didron <fdidron@users.noreply.github.com> | 2019-11-04 17:23:21 +0900 |
commit | d0ee924c9d1689845ca067ca1175521824870ba7 (patch) | |
tree | 43a0c46c63771b4d9da00deecce6e25cc1a10739 | |
parent | 9d1f6c699bae80c6afa1ff92dcc506c546a259b8 (diff) |
Move tmk_core/common/backlight to quantum/backlight (#6710)
* Move tmk_core/common/backlight to quantum/backlight
* Add guards to backlight inclusion
* Add guards to backlight inclusion
* Update backlight guards on clueboard/60
* Use full paths to avoid vpath issues
-rw-r--r-- | common_features.mk | 8 | ||||
-rw-r--r-- | quantum/backlight/backlight.c (renamed from tmk_core/common/backlight.c) | 0 | ||||
-rw-r--r-- | quantum/backlight/backlight.h (renamed from tmk_core/common/backlight.h) | 0 | ||||
-rw-r--r-- | quantum/keymap_common.c | 5 | ||||
-rw-r--r-- | quantum/quantum.c | 6 | ||||
-rw-r--r-- | tmk_core/common.mk | 5 | ||||
-rw-r--r-- | tmk_core/common/action.c | 5 | ||||
-rw-r--r-- | tmk_core/common/avr/suspend.c | 5 | ||||
-rw-r--r-- | tmk_core/common/chibios/suspend.c | 5 | ||||
-rw-r--r-- | tmk_core/common/command.c | 5 | ||||
-rw-r--r-- | tmk_core/common/keyboard.c | 4 |
11 files changed, 34 insertions, 14 deletions
diff --git a/common_features.mk b/common_features.mk index 3bc6f1c73b..a4af319fc6 100644 --- a/common_features.mk +++ b/common_features.mk @@ -233,7 +233,13 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) ifeq ($(strip $(VISUALIZER_ENABLE)), yes) CIE1931_CURVE = yes endif - ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes) + + + COMMON_VPATH += $(QUANTUM_DIR)/backlight + SRC += $(QUANTUM_DIR)/backlight/backlight.c + OPT_DEFS += -DBACKLIGHT_ENABLE + + ifeq ($(strip $(BACKLIGHT_ENABLE)), custom) OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER endif endif diff --git a/tmk_core/common/backlight.c b/quantum/backlight/backlight.c index 708022f68f..708022f68f 100644 --- a/tmk_core/common/backlight.c +++ b/quantum/backlight/backlight.c diff --git a/tmk_core/common/backlight.h b/quantum/backlight/backlight.h index bb1f897ee8..bb1f897ee8 100644 --- a/tmk_core/common/backlight.h +++ b/quantum/backlight/backlight.h diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 9af9510081..4fa45ac37b 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -26,9 +26,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "action.h" #include "action_macro.h" #include "debug.h" -#include "backlight.h" #include "quantum.h" +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif + #ifdef MIDI_ENABLE # include "process_midi.h" #endif diff --git a/quantum/quantum.c b/quantum/quantum.c index 70b1008402..4c4cb8d054 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -28,8 +28,10 @@ # define BREATHING_PERIOD 6 #endif -#include "backlight.h" -extern backlight_config_t backlight_config; +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" + extern backlight_config_t backlight_config; +#endif #ifdef FAUXCLICKY_ENABLE # include "fauxclicky.h" diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 2216887555..db55353465 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -153,11 +153,6 @@ ifeq ($(strip $(NO_SUSPEND_POWER_DOWN)), yes) TMK_COMMON_DEFS += -DNO_SUSPEND_POWER_DOWN endif -ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) - TMK_COMMON_SRC += $(COMMON_DIR)/backlight.c - TMK_COMMON_DEFS += -DBACKLIGHT_ENABLE -endif - ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) TMK_COMMON_DEFS += -DBLUETOOTH_ENABLE TMK_COMMON_DEFS += -DNO_USB_STARTUP_CHECK diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 44b19d368e..bd6aeba4f8 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "mousekey.h" #include "command.h" #include "led.h" -#include "backlight.h" #include "action_layer.h" #include "action_tapping.h" #include "action_macro.h" @@ -28,6 +27,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "action.h" #include "wait.h" +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif + #ifdef DEBUG_ACTION # include "debug.h" #else diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 574000fcd8..c59c196880 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -4,7 +4,6 @@ #include <avr/interrupt.h> #include "matrix.h" #include "action.h" -#include "backlight.h" #include "suspend_avr.h" #include "suspend.h" #include "timer.h" @@ -16,6 +15,10 @@ # include "lufa.h" #endif +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif + #ifdef AUDIO_ENABLE # include "audio.h" #endif /* AUDIO_ENABLE */ diff --git a/tmk_core/common/chibios/suspend.c b/tmk_core/common/chibios/suspend.c index ae1c6f53e2..c0f9c28d44 100644 --- a/tmk_core/common/chibios/suspend.c +++ b/tmk_core/common/chibios/suspend.c @@ -8,10 +8,13 @@ #include "action_util.h" #include "mousekey.h" #include "host.h" -#include "backlight.h" #include "suspend.h" #include "wait.h" +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif + /** \brief suspend idle * * FIXME: needs doc diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index 8bf72ef258..82cd806091 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -32,10 +32,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "sleep_led.h" #include "led.h" #include "command.h" -#include "backlight.h" #include "quantum.h" #include "version.h" +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif + #ifdef MOUSEKEY_ENABLE # include "mousekey.h" #endif diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 0e8ba826e6..8746b2c124 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -29,8 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "util.h" #include "sendchar.h" #include "eeconfig.h" -#include "backlight.h" #include "action_layer.h" +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif #ifdef BOOTMAGIC_ENABLE # include "bootmagic.h" #else |