Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output selection: Remove "USB and BT" option #11940

Merged
merged 1 commit into from
Feb 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions tmk_core/protocol/lufa/lufa.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,7 @@ static void send_keyboard(report_keyboard_t *report) {
uint8_t timeout = 255;

#ifdef BLUETOOTH_ENABLE
uint8_t where = where_to_send();

if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
if (where_to_send() == OUTPUT_BLUETOOTH) {
# ifdef MODULE_ADAFRUIT_BLE
adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys));
# elif MODULE_RN42
Expand All @@ -686,9 +684,6 @@ static void send_keyboard(report_keyboard_t *report) {
serial_send(report->keys[i]);
}
# endif
}

if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
return;
}
#endif
Expand Down Expand Up @@ -729,9 +724,7 @@ static void send_mouse(report_mouse_t *report) {
uint8_t timeout = 255;

# ifdef BLUETOOTH_ENABLE
uint8_t where = where_to_send();

if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
if (where_to_send() == OUTPUT_BLUETOOTH) {
# ifdef MODULE_ADAFRUIT_BLE
// FIXME: mouse buttons
adafruit_ble_send_mouse_move(report->x, report->y, report->v, report->h, report->buttons);
Expand All @@ -746,9 +739,6 @@ static void send_mouse(report_mouse_t *report) {
serial_send(report->h); // should try sending the wheel h here
serial_send(0x00);
# endif
}

if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
return;
}
# endif
Expand Down Expand Up @@ -807,9 +797,7 @@ 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();

if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) {
if (where_to_send() == OUTPUT_BLUETOOTH) {
# ifdef MODULE_ADAFRUIT_BLE
adafruit_ble_send_consumer_key(data);
# elif MODULE_RN42
Expand All @@ -823,9 +811,6 @@ static void send_consumer(uint16_t data) {
serial_send(bitmap & 0xFF);
serial_send((bitmap >> 8) & 0xFF);
# endif
}

if (where != OUTPUT_USB && where != OUTPUT_USB_AND_BT) {
return;
}
# endif
Expand Down
14 changes: 2 additions & 12 deletions tmk_core/protocol/lufa/outputselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,11 @@ enum outputs {

OUTPUT_NONE,
OUTPUT_USB,
OUTPUT_BLUETOOTH,

// backward compatibility
OUTPUT_USB_AND_BT
OUTPUT_BLUETOOTH
};

/**
* backward compatibility for BLUETOOTH_ENABLE, send to BT and USB by default
*/
#ifndef OUTPUT_DEFAULT
# ifdef BLUETOOTH_ENABLE
# define OUTPUT_DEFAULT OUTPUT_USB_AND_BT
# else
# define OUTPUT_DEFAULT OUTPUT_AUTO
# endif
# define OUTPUT_DEFAULT OUTPUT_AUTO
#endif

void set_output(uint8_t output);
Expand Down