diff options
author | Ryan <fauxpark@gmail.com> | 2020-06-17 21:43:20 +1000 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2020-09-30 02:57:16 -0700 |
commit | ce09c5c92213958c1aff96c64c022da82ae3058d (patch) | |
tree | 3c5c023f86d3af58ce0c8b217c6959f3c8fda4b3 | |
parent | 6e5476c4476862e0d0941d01e989ec593bd57385 (diff) |
Don't compile outputselect.c if Bluetooth is disabled (#9356)
-rw-r--r-- | quantum/quantum.c | 4 | ||||
-rw-r--r-- | tmk_core/protocol/lufa.mk | 21 | ||||
-rw-r--r-- | tmk_core/protocol/lufa/lufa.c | 16 |
3 files changed, 23 insertions, 18 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 7f82b8c655..75db2f7b1a 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -17,7 +17,7 @@ #include <ctype.h> #include "quantum.h" -#ifdef PROTOCOL_LUFA +#ifdef BLUETOOTH_ENABLE # include "outputselect.h" #endif @@ -631,7 +631,7 @@ void matrix_init_quantum() { #ifdef HAPTIC_ENABLE haptic_init(); #endif -#ifdef OUTPUT_AUTO_ENABLE +#if defined(BLUETOOTH_ENABLE) && defined(OUTPUT_AUTO_ENABLE) set_output(OUTPUT_AUTO); #endif diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk index d87802992e..9bc972c266 100644 --- a/tmk_core/protocol/lufa.mk +++ b/tmk_core/protocol/lufa.mk @@ -15,9 +15,8 @@ else endif LUFA_SRC = lufa.c \ - usb_descriptor.c \ - outputselect.c \ - $(LUFA_SRC_USB) + usb_descriptor.c \ + $(LUFA_SRC_USB) ifeq ($(strip $(MIDI_ENABLE)), yes) include $(TMK_PATH)/protocol/midi.mk @@ -25,23 +24,27 @@ endif ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ - $(TMK_DIR)/protocol/serial_uart.c + outputselect.c \ + $(TMK_DIR)/protocol/serial_uart.c endif ifeq ($(strip $(BLUETOOTH)), AdafruitBLE) - LUFA_SRC += spi_master.c - LUFA_SRC += analog.c - LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp + LUFA_SRC += spi_master.c \ + analog.c \ + outputselect.c \ + $(LUFA_DIR)/adafruit_ble.cpp endif ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey) LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ - $(TMK_DIR)/protocol/serial_uart.c + outputselect.c \ + $(TMK_DIR)/protocol/serial_uart.c endif ifeq ($(strip $(BLUETOOTH)), RN42) LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ - $(TMK_DIR)/protocol/serial_uart.c + outputselect.c \ + $(TMK_DIR)/protocol/serial_uart.c endif ifeq ($(strip $(VIRTSER_ENABLE)), yes) diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 0b076f27bf..ac27383f04 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -53,7 +53,6 @@ #include "lufa.h" #include "quantum.h" #include <util/atomic.h> -#include "outputselect.h" #ifdef NKRO_ENABLE # include "keycode_config.h" @@ -66,6 +65,7 @@ extern keymap_config_t keymap_config; #endif #ifdef BLUETOOTH_ENABLE +# include "outputselect.h" # ifdef MODULE_ADAFRUIT_BLE # include "adafruit_ble.h" # else @@ -666,9 +666,10 @@ static uint8_t keyboard_leds(void) { return keyboard_led_state; } */ static void send_keyboard(report_keyboard_t *report) { uint8_t timeout = 255; - uint8_t where = where_to_send(); #ifdef BLUETOOTH_ENABLE + uint8_t where = where_to_send(); + if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { # ifdef MODULE_ADAFRUIT_BLE adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys)); @@ -690,11 +691,11 @@ static void send_keyboard(report_keyboard_t *report) { } # endif } -#endif if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) { return; } +#endif /* Select the Keyboard Report Endpoint */ uint8_t ep = KEYBOARD_IN_EPNUM; @@ -730,9 +731,10 @@ static void send_keyboard(report_keyboard_t *report) { static void send_mouse(report_mouse_t *report) { #ifdef MOUSE_ENABLE uint8_t timeout = 255; - uint8_t where = where_to_send(); # ifdef BLUETOOTH_ENABLE + uint8_t where = where_to_send(); + if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { # ifdef MODULE_ADAFRUIT_BLE // FIXME: mouse buttons @@ -749,11 +751,11 @@ static void send_mouse(report_mouse_t *report) { bluefruit_serial_send(0x00); # endif } -# endif if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) { return; } +# endif /* Select the Mouse Report Endpoint */ Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); @@ -808,9 +810,9 @@ static void send_system(uint16_t data) { */ static void send_consumer(uint16_t data) { #ifdef EXTRAKEY_ENABLE +# ifdef BLUETOOTH_ENABLE uint8_t where = where_to_send(); -# ifdef BLUETOOTH_ENABLE if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { # ifdef MODULE_ADAFRUIT_BLE adafruit_ble_send_consumer_key(data, 0); @@ -840,11 +842,11 @@ static void send_consumer(uint16_t data) { bluefruit_serial_send(0x00); # endif } -# endif if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) { return; } +# endif send_extra(REPORT_ID_CONSUMER, data); #endif |