From ddc036b69ea508750f5129d9a43fee484148716a Mon Sep 17 00:00:00 2001 From: Travis La Marr Date: Fri, 24 Mar 2017 12:53:55 -0400 Subject: Refactor Bluetooth Handling Refactored Bluetooth support to make adding new Bluetooth modules easier in the future. * Remove `OUT_BLE` key from QMK's keymap. `OUT_BT` is all we need now as there's no difference anymore. * Made BLUETOOTH_ENABLE build option legacy as not to break existing keymaps (Falls back to existing EZ Key support if on) * Removed `ADAFRUIT_BLE_ENABLE` build option * Created new build option `BLUETOOTH` with module option (Currently `AdafruitEZKey` & `AdafruitBLE`) * Moved all LUFA bluetooth key/mouse events under `BLUETOOTH_ENABLE` ifdef with selected modules output. --- tmk_core/protocol/lufa.mk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tmk_core/protocol/lufa.mk') diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk index de0cc795f6..5b15779723 100644 --- a/tmk_core/protocol/lufa.mk +++ b/tmk_core/protocol/lufa.mk @@ -22,11 +22,16 @@ ifeq ($(strip $(MIDI_ENABLE)), yes) include $(TMK_PATH)/protocol/midi.mk endif -ifeq ($(strip $(ADAFRUIT_BLE_ENABLE)), yes) - LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp +ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) + LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ + $(TMK_DIR)/protocol/serial_uart.c endif -ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) +ifeq ($(strip $(BLUETOOTH)), AdafruitBLE) + LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp +endif + +ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey) LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ $(TMK_DIR)/protocol/serial_uart.c endif @@ -54,6 +59,7 @@ LUFA_OPTS += -DUSE_FLASH_DESCRIPTORS LUFA_OPTS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" #LUFA_OPTS += -DINTERRUPT_CONTROL_ENDPOINT LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 +LUFA_OPTS += -DFIXED_CONTROL_ENDPOINT_SIZE=8 LUFA_OPTS += -DFIXED_NUM_CONFIGURATIONS=1 # Remote wakeup fix for ATmega32U2 https://github.com/tmk/tmk_keyboard/issues/361 -- cgit v1.2.3