diff options
Diffstat (limited to 'tmk_core/protocol/lufa/lufa.c')
| -rw-r--r-- | tmk_core/protocol/lufa/lufa.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 60cba8d2a..ae6129d1a 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c | |||
| @@ -606,6 +606,13 @@ static void send_keyboard(report_keyboard_t *report) | |||
| 606 | if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { | 606 | if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { |
| 607 | #ifdef MODULE_ADAFRUIT_BLE | 607 | #ifdef MODULE_ADAFRUIT_BLE |
| 608 | adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys)); | 608 | adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys)); |
| 609 | #elif MODULE_RN42 | ||
| 610 | bluefruit_serial_send(0xFD); | ||
| 611 | bluefruit_serial_send(0x09); | ||
| 612 | bluefruit_serial_send(0x01); | ||
| 613 | for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) { | ||
| 614 | bluefruit_serial_send(report->raw[i]); | ||
| 615 | } | ||
| 609 | #else | 616 | #else |
| 610 | bluefruit_serial_send(0xFD); | 617 | bluefruit_serial_send(0xFD); |
| 611 | for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) { | 618 | for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) { |
| @@ -726,6 +733,16 @@ static void send_consumer(uint16_t data) | |||
| 726 | if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { | 733 | if (where == OUTPUT_BLUETOOTH || where == OUTPUT_USB_AND_BT) { |
| 727 | #ifdef MODULE_ADAFRUIT_BLE | 734 | #ifdef MODULE_ADAFRUIT_BLE |
| 728 | adafruit_ble_send_consumer_key(data, 0); | 735 | adafruit_ble_send_consumer_key(data, 0); |
| 736 | #elif MODULE_RN42 | ||
| 737 | static uint16_t last_data = 0; | ||
| 738 | if (data == last_data) return; | ||
| 739 | last_data = data; | ||
| 740 | uint16_t bitmap = CONSUMER2RN42(data); | ||
| 741 | bluefruit_serial_send(0xFD); | ||
| 742 | bluefruit_serial_send(0x03); | ||
| 743 | bluefruit_serial_send(0x03); | ||
| 744 | bluefruit_serial_send(bitmap&0xFF); | ||
| 745 | bluefruit_serial_send((bitmap>>8)&0xFF); | ||
| 729 | #else | 746 | #else |
| 730 | static uint16_t last_data = 0; | 747 | static uint16_t last_data = 0; |
| 731 | if (data == last_data) return; | 748 | if (data == last_data) return; |
| @@ -1132,7 +1149,7 @@ int main(void) | |||
| 1132 | // midi_send_noteoff(&midi_device, 0, 64, 127); | 1149 | // midi_send_noteoff(&midi_device, 0, 64, 127); |
| 1133 | #endif | 1150 | #endif |
| 1134 | 1151 | ||
| 1135 | #ifdef MODULE_ADAFRUIT_EZKEY | 1152 | #if defined(MODULE_ADAFRUIT_EZKEY) || defined(MODULE_RN42) |
| 1136 | serial_init(); | 1153 | serial_init(); |
| 1137 | #endif | 1154 | #endif |
| 1138 | 1155 | ||
