summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/lufa
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2022-09-03 05:38:27 +1000
committerGitHub <noreply@github.com>2022-09-02 20:38:27 +0100
commit09d668eb0ed3ff6fa48ce1db98910b022bca2d90 (patch)
treeda13eca69e7e24e439c4bccdd1296fc4de212085 /tmk_core/protocol/lufa
parent0ceaaaae8e71f4713d232ac1b657906f4a45833f (diff)
Simplify extrakeys sending at the host driver level (#18230)
* Simplify extrakeys sending at the host driver level * There are two arguments here * Wrong syntax * Adjust keyboards which use a custom host driver
Diffstat (limited to 'tmk_core/protocol/lufa')
-rw-r--r--tmk_core/protocol/lufa/lufa.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index b4b03357a3..5c1a9b600e 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -101,10 +101,9 @@ static report_keyboard_t keyboard_report_sent;
static uint8_t keyboard_leds(void);
static void send_keyboard(report_keyboard_t *report);
static void send_mouse(report_mouse_t *report);
-static void send_system(uint16_t data);
-static void send_consumer(uint16_t data);
+static void send_extra(uint8_t report_id, uint16_t data);
static void send_programmable_button(uint32_t data);
-host_driver_t lufa_driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer, send_programmable_button};
+host_driver_t lufa_driver = {keyboard_leds, send_keyboard, send_mouse, send_extra, send_programmable_button};
#ifdef VIRTSER_ENABLE
// clang-format off
@@ -748,30 +747,8 @@ static void send_report(void *report, size_t size) {
*/
#ifdef EXTRAKEY_ENABLE
static void send_extra(uint8_t report_id, uint16_t data) {
- static report_extra_t r;
- r = (report_extra_t){.report_id = report_id, .usage = data};
- send_report(&r, sizeof(r));
-}
-#endif
-
-/** \brief Send System
- *
- * FIXME: Needs doc
- */
-static void send_system(uint16_t data) {
-#ifdef EXTRAKEY_ENABLE
- send_extra(REPORT_ID_SYSTEM, data);
-#endif
-}
-
-/** \brief Send Consumer
- *
- * FIXME: Needs doc
- */
-static void send_consumer(uint16_t data) {
-#ifdef EXTRAKEY_ENABLE
# ifdef BLUETOOTH_ENABLE
- if (where_to_send() == OUTPUT_BLUETOOTH) {
+ if (report_id == REPORT_ID_CONSUMER && where_to_send() == OUTPUT_BLUETOOTH) {
# ifdef BLUETOOTH_BLUEFRUIT_LE
bluefruit_le_send_consumer_key(data);
# elif BLUETOOTH_RN42
@@ -781,9 +758,11 @@ static void send_consumer(uint16_t data) {
}
# endif
- send_extra(REPORT_ID_CONSUMER, data);
-#endif
+ static report_extra_t r;
+ r = (report_extra_t){.report_id = report_id, .usage = data};
+ send_report(&r, sizeof(r));
}
+#endif
static void send_programmable_button(uint32_t data) {
#ifdef PROGRAMMABLE_BUTTON_ENABLE