aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol/lufa
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol/lufa')
-rw-r--r--tmk_core/protocol/lufa/lufa.c16
1 files changed, 9 insertions, 7 deletions
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