aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--quantum/quantum.c4
-rw-r--r--tmk_core/protocol/lufa.mk21
-rw-r--r--tmk_core/protocol/lufa/lufa.c16
3 files changed, 23 insertions, 18 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 044a15612..9d63f4de2 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -17,7 +17,7 @@
17#include <ctype.h> 17#include <ctype.h>
18#include "quantum.h" 18#include "quantum.h"
19 19
20#ifdef PROTOCOL_LUFA 20#ifdef BLUETOOTH_ENABLE
21# include "outputselect.h" 21# include "outputselect.h"
22#endif 22#endif
23 23
@@ -618,7 +618,7 @@ void matrix_init_quantum() {
618#ifdef HAPTIC_ENABLE 618#ifdef HAPTIC_ENABLE
619 haptic_init(); 619 haptic_init();
620#endif 620#endif
621#ifdef OUTPUT_AUTO_ENABLE 621#if defined(BLUETOOTH_ENABLE) && defined(OUTPUT_AUTO_ENABLE)
622 set_output(OUTPUT_AUTO); 622 set_output(OUTPUT_AUTO);
623#endif 623#endif
624 624
diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk
index d87802992..9bc972c26 100644
--- a/tmk_core/protocol/lufa.mk
+++ b/tmk_core/protocol/lufa.mk
@@ -15,9 +15,8 @@ else
15endif 15endif
16 16
17LUFA_SRC = lufa.c \ 17LUFA_SRC = lufa.c \
18 usb_descriptor.c \ 18 usb_descriptor.c \
19 outputselect.c \ 19 $(LUFA_SRC_USB)
20 $(LUFA_SRC_USB)
21 20
22ifeq ($(strip $(MIDI_ENABLE)), yes) 21ifeq ($(strip $(MIDI_ENABLE)), yes)
23 include $(TMK_PATH)/protocol/midi.mk 22 include $(TMK_PATH)/protocol/midi.mk
@@ -25,23 +24,27 @@ endif
25 24
26ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) 25ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
27 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ 26 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
28 $(TMK_DIR)/protocol/serial_uart.c 27 outputselect.c \
28 $(TMK_DIR)/protocol/serial_uart.c
29endif 29endif
30 30
31ifeq ($(strip $(BLUETOOTH)), AdafruitBLE) 31ifeq ($(strip $(BLUETOOTH)), AdafruitBLE)
32 LUFA_SRC += spi_master.c 32 LUFA_SRC += spi_master.c \
33 LUFA_SRC += analog.c 33 analog.c \
34 LUFA_SRC += $(LUFA_DIR)/adafruit_ble.cpp 34 outputselect.c \
35 $(LUFA_DIR)/adafruit_ble.cpp
35endif 36endif
36 37
37ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey) 38ifeq ($(strip $(BLUETOOTH)), AdafruitEZKey)
38 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ 39 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
39 $(TMK_DIR)/protocol/serial_uart.c 40 outputselect.c \
41 $(TMK_DIR)/protocol/serial_uart.c
40endif 42endif
41 43
42ifeq ($(strip $(BLUETOOTH)), RN42) 44ifeq ($(strip $(BLUETOOTH)), RN42)
43 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ 45 LUFA_SRC += $(LUFA_DIR)/bluetooth.c \
44 $(TMK_DIR)/protocol/serial_uart.c 46 outputselect.c \
47 $(TMK_DIR)/protocol/serial_uart.c
45endif 48endif
46 49
47ifeq ($(strip $(VIRTSER_ENABLE)), yes) 50ifeq ($(strip $(VIRTSER_ENABLE)), yes)
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index 3ca1a809d..ca3384ba2 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -53,7 +53,6 @@
53#include "lufa.h" 53#include "lufa.h"
54#include "quantum.h" 54#include "quantum.h"
55#include <util/atomic.h> 55#include <util/atomic.h>
56#include "outputselect.h"
57 56
58#ifdef NKRO_ENABLE 57#ifdef NKRO_ENABLE
59# include "keycode_config.h" 58# include "keycode_config.h"
@@ -66,6 +65,7 @@ extern keymap_config_t keymap_config;
66#endif 65#endif
67 66
68#ifdef BLUETOOTH_ENABLE 67#ifdef BLUETOOTH_ENABLE
68# include "outputselect.h"
69# ifdef MODULE_ADAFRUIT_BLE 69# ifdef MODULE_ADAFRUIT_BLE
70# include "adafruit_ble.h" 70# include "adafruit_ble.h"
71# else 71# else
@@ -554,9 +554,10 @@ static uint8_t keyboard_leds(void) { return keyboard_led_state; }
554 */ 554 */
555static void send_keyboard(report_keyboard_t *report) { 555static void send_keyboard(report_keyboard_t *report) {
556 uint8_t timeout = 255; 556 uint8_t timeout = 255;
557 uint8_t where = where_to_send();
558 557
559#ifdef BLUETOOTH_ENABLE 558#ifdef BLUETOOTH_ENABLE
559 uint8_t where = where_to_send();
560
560 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { 561 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
561# ifdef MODULE_ADAFRUIT_BLE 562# ifdef MODULE_ADAFRUIT_BLE
562 adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys)); 563 adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys));
@@ -578,11 +579,11 @@ static void send_keyboard(report_keyboard_t *report) {
578 } 579 }
579# endif 580# endif
580 } 581 }
581#endif
582 582
583 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) { 583 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
584 return; 584 return;
585 } 585 }
586#endif
586 587
587 /* Select the Keyboard Report Endpoint */ 588 /* Select the Keyboard Report Endpoint */
588 uint8_t ep = KEYBOARD_IN_EPNUM; 589 uint8_t ep = KEYBOARD_IN_EPNUM;
@@ -618,9 +619,10 @@ static void send_keyboard(report_keyboard_t *report) {
618static void send_mouse(report_mouse_t *report) { 619static void send_mouse(report_mouse_t *report) {
619#ifdef MOUSE_ENABLE 620#ifdef MOUSE_ENABLE
620 uint8_t timeout = 255; 621 uint8_t timeout = 255;
621 uint8_t where = where_to_send();
622 622
623# ifdef BLUETOOTH_ENABLE 623# ifdef BLUETOOTH_ENABLE
624 uint8_t where = where_to_send();
625
624 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { 626 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
625# ifdef MODULE_ADAFRUIT_BLE 627# ifdef MODULE_ADAFRUIT_BLE
626 // FIXME: mouse buttons 628 // FIXME: mouse buttons
@@ -637,11 +639,11 @@ static void send_mouse(report_mouse_t *report) {
637 bluefruit_serial_send(0x00); 639 bluefruit_serial_send(0x00);
638# endif 640# endif
639 } 641 }
640# endif
641 642
642 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) { 643 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
643 return; 644 return;
644 } 645 }
646# endif
645 647
646 /* Select the Mouse Report Endpoint */ 648 /* Select the Mouse Report Endpoint */
647 Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); 649 Endpoint_SelectEndpoint(MOUSE_IN_EPNUM);
@@ -696,9 +698,9 @@ static void send_system(uint16_t data) {
696 */ 698 */
697static void send_consumer(uint16_t data) { 699static void send_consumer(uint16_t data) {
698#ifdef EXTRAKEY_ENABLE 700#ifdef EXTRAKEY_ENABLE
701# ifdef BLUETOOTH_ENABLE
699 uint8_t where = where_to_send(); 702 uint8_t where = where_to_send();
700 703
701# ifdef BLUETOOTH_ENABLE
702 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { 704 if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
703# ifdef MODULE_ADAFRUIT_BLE 705# ifdef MODULE_ADAFRUIT_BLE
704 adafruit_ble_send_consumer_key(data, 0); 706 adafruit_ble_send_consumer_key(data, 0);
@@ -728,11 +730,11 @@ static void send_consumer(uint16_t data) {
728 bluefruit_serial_send(0x00); 730 bluefruit_serial_send(0x00);
729# endif 731# endif
730 } 732 }
731# endif
732 733
733 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) { 734 if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
734 return; 735 return;
735 } 736 }
737# endif
736 738
737 send_extra(REPORT_ID_CONSUMER, data); 739 send_extra(REPORT_ID_CONSUMER, data);
738#endif 740#endif