Skip to content

Commit

Permalink
Move tmk_core/common/backlight to quantum/backlight (qmk#6710)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zvecr authored and fdidron committed Nov 4, 2019
1 parent 9d1f6c6 commit d0ee924
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 14 deletions.
8 changes: 7 additions & 1 deletion common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion quantum/keymap_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions quantum/quantum.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions tmk_core/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tmk_core/common/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ 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"
#include "action_util.h"
#include "action.h"
#include "wait.h"

#ifdef BACKLIGHT_ENABLE
# include "backlight.h"
#endif

#ifdef DEBUG_ACTION
# include "debug.h"
#else
Expand Down
5 changes: 4 additions & 1 deletion tmk_core/common/avr/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -16,6 +15,10 @@
# include "lufa.h"
#endif

#ifdef BACKLIGHT_ENABLE
# include "backlight.h"
#endif

#ifdef AUDIO_ENABLE
# include "audio.h"
#endif /* AUDIO_ENABLE */
Expand Down
5 changes: 4 additions & 1 deletion tmk_core/common/chibios/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion tmk_core/common/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tmk_core/common/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0ee924

Please sign in to comment.