diff options
| author | Ryan <fauxpark@gmail.com> | 2022-09-08 04:59:24 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-07 19:59:24 +0100 |
| commit | f7d2b001bc4f79164e9ea3a4ff7faa54be0b7d82 (patch) | |
| tree | 304a51de5cb8a64958645812941b0ebfe65223d9 /tmk_core/protocol/lufa/lufa.c | |
| parent | cf8cdd19920b1810f3d3ecc987943ad8d59023b4 (diff) | |
Move Bluetooth-related function calls up to host/keyboard level (#18274)
* Move Bluetooth-related function calls up to host/keyboard level
* Remove pointless set_output() call
* Move bluetooth (rn42) init to end of keyboard_init()
* Enable SPI/UART for ChibiOS targets
* Some more slight tweaks
Diffstat (limited to 'tmk_core/protocol/lufa/lufa.c')
| -rw-r--r-- | tmk_core/protocol/lufa/lufa.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 03e19745f8..2a3f5fd883 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c | |||
| @@ -65,15 +65,6 @@ extern keymap_config_t keymap_config; | |||
| 65 | # include "audio.h" | 65 | # include "audio.h" |
| 66 | #endif | 66 | #endif |
| 67 | 67 | ||
| 68 | #ifdef BLUETOOTH_ENABLE | ||
| 69 | # include "outputselect.h" | ||
| 70 | # ifdef BLUETOOTH_BLUEFRUIT_LE | ||
| 71 | # include "bluefruit_le.h" | ||
| 72 | # elif BLUETOOTH_RN42 | ||
| 73 | # include "rn42.h" | ||
| 74 | # endif | ||
| 75 | #endif | ||
| 76 | |||
| 77 | #ifdef VIRTSER_ENABLE | 68 | #ifdef VIRTSER_ENABLE |
| 78 | # include "virtser.h" | 69 | # include "virtser.h" |
| 79 | #endif | 70 | #endif |
| @@ -648,17 +639,6 @@ static uint8_t keyboard_leds(void) { | |||
| 648 | static void send_keyboard(report_keyboard_t *report) { | 639 | static void send_keyboard(report_keyboard_t *report) { |
| 649 | uint8_t timeout = 255; | 640 | uint8_t timeout = 255; |
| 650 | 641 | ||
| 651 | #ifdef BLUETOOTH_ENABLE | ||
| 652 | if (where_to_send() == OUTPUT_BLUETOOTH) { | ||
| 653 | # ifdef BLUETOOTH_BLUEFRUIT_LE | ||
| 654 | bluefruit_le_send_keys(report->mods, report->keys, sizeof(report->keys)); | ||
| 655 | # elif BLUETOOTH_RN42 | ||
| 656 | rn42_send_keyboard(report); | ||
| 657 | # endif | ||
| 658 | return; | ||
| 659 | } | ||
| 660 | #endif | ||
| 661 | |||
| 662 | /* Select the Keyboard Report Endpoint */ | 642 | /* Select the Keyboard Report Endpoint */ |
| 663 | uint8_t ep = KEYBOARD_IN_EPNUM; | 643 | uint8_t ep = KEYBOARD_IN_EPNUM; |
| 664 | uint8_t size = KEYBOARD_REPORT_SIZE; | 644 | uint8_t size = KEYBOARD_REPORT_SIZE; |
| @@ -695,18 +675,6 @@ static void send_mouse(report_mouse_t *report) { | |||
| 695 | #ifdef MOUSE_ENABLE | 675 | #ifdef MOUSE_ENABLE |
| 696 | uint8_t timeout = 255; | 676 | uint8_t timeout = 255; |
| 697 | 677 | ||
| 698 | # ifdef BLUETOOTH_ENABLE | ||
| 699 | if (where_to_send() == OUTPUT_BLUETOOTH) { | ||
| 700 | # ifdef BLUETOOTH_BLUEFRUIT_LE | ||
| 701 | // FIXME: mouse buttons | ||
| 702 | bluefruit_le_send_mouse_move(report->x, report->y, report->v, report->h, report->buttons); | ||
| 703 | # elif BLUETOOTH_RN42 | ||
| 704 | rn42_send_mouse(report); | ||
| 705 | # endif | ||
| 706 | return; | ||
| 707 | } | ||
| 708 | # endif | ||
| 709 | |||
| 710 | /* Select the Mouse Report Endpoint */ | 678 | /* Select the Mouse Report Endpoint */ |
| 711 | Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); | 679 | Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); |
| 712 | 680 | ||
| @@ -747,17 +715,6 @@ static void send_report(void *report, size_t size) { | |||
| 747 | */ | 715 | */ |
| 748 | static void send_extra(uint8_t report_id, uint16_t data) { | 716 | static void send_extra(uint8_t report_id, uint16_t data) { |
| 749 | #ifdef EXTRAKEY_ENABLE | 717 | #ifdef EXTRAKEY_ENABLE |
| 750 | # ifdef BLUETOOTH_ENABLE | ||
| 751 | if (report_id == REPORT_ID_CONSUMER && where_to_send() == OUTPUT_BLUETOOTH) { | ||
| 752 | # ifdef BLUETOOTH_BLUEFRUIT_LE | ||
| 753 | bluefruit_le_send_consumer_key(data); | ||
| 754 | # elif BLUETOOTH_RN42 | ||
| 755 | rn42_send_consumer(data); | ||
| 756 | # endif | ||
| 757 | return; | ||
| 758 | } | ||
| 759 | # endif | ||
| 760 | |||
| 761 | static report_extra_t r; | 718 | static report_extra_t r; |
| 762 | r = (report_extra_t){.report_id = report_id, .usage = data}; | 719 | r = (report_extra_t){.report_id = report_id, .usage = data}; |
| 763 | send_report(&r, sizeof(r)); | 720 | send_report(&r, sizeof(r)); |
| @@ -1007,10 +964,6 @@ void protocol_pre_init(void) { | |||
| 1007 | setup_usb(); | 964 | setup_usb(); |
| 1008 | sei(); | 965 | sei(); |
| 1009 | 966 | ||
| 1010 | #if defined(BLUETOOTH_RN42) | ||
| 1011 | rn42_init(); | ||
| 1012 | #endif | ||
| 1013 | |||
| 1014 | /* wait for USB startup & debug output */ | 967 | /* wait for USB startup & debug output */ |
| 1015 | 968 | ||
| 1016 | #ifdef WAIT_FOR_USB | 969 | #ifdef WAIT_FOR_USB |
| @@ -1062,10 +1015,6 @@ void protocol_post_task(void) { | |||
| 1062 | MIDI_Device_USBTask(&USB_MIDI_Interface); | 1015 | MIDI_Device_USBTask(&USB_MIDI_Interface); |
| 1063 | #endif | 1016 | #endif |
| 1064 | 1017 | ||
| 1065 | #ifdef BLUETOOTH_BLUEFRUIT_LE | ||
| 1066 | bluefruit_le_task(); | ||
| 1067 | #endif | ||
| 1068 | |||
| 1069 | #ifdef VIRTSER_ENABLE | 1018 | #ifdef VIRTSER_ENABLE |
| 1070 | virtser_task(); | 1019 | virtser_task(); |
| 1071 | CDC_Device_USBTask(&cdc_device); | 1020 | CDC_Device_USBTask(&cdc_device); |
