aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol/lufa/lufa.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol/lufa/lufa.c')
-rw-r--r--tmk_core/protocol/lufa/lufa.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index 81da035f0c..e13f4b548e 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -44,9 +44,6 @@
#include "led.h"
#include "sendchar.h"
#include "debug.h"
-#ifdef SLEEP_LED_ENABLE
-# include "sleep_led.h"
-#endif
#include "suspend.h"
#include "wait.h"
@@ -75,11 +72,24 @@
static report_keyboard_t keyboard_report_sent;
/* Host driver */
-static void send_keyboard(report_keyboard_t *report);
-static void send_nkro(report_nkro_t *report);
-static void send_mouse(report_mouse_t *report);
-static void send_extra(report_extra_t *report);
-host_driver_t lufa_driver = {.keyboard_leds = usb_device_state_get_leds, .send_keyboard = send_keyboard, .send_nkro = send_nkro, .send_mouse = send_mouse, .send_extra = send_extra};
+static void send_keyboard(report_keyboard_t *report);
+static void send_nkro(report_nkro_t *report);
+static void send_mouse(report_mouse_t *report);
+static void send_extra(report_extra_t *report);
+#ifdef RAW_ENABLE
+static void send_raw_hid(uint8_t *data, uint8_t length);
+#endif
+
+host_driver_t lufa_driver = {
+ .keyboard_leds = usb_device_state_get_leds,
+ .send_keyboard = send_keyboard,
+ .send_nkro = send_nkro,
+ .send_mouse = send_mouse,
+ .send_extra = send_extra,
+#ifdef RAW_ENABLE
+ .send_raw_hid = send_raw_hid,
+#endif
+};
void send_report(uint8_t endpoint, void *report, size_t size) {
uint8_t timeout = 255;
@@ -131,21 +141,11 @@ USB_ClassInfo_CDC_Device_t cdc_device = {
*
* FIXME: Needs doc
*/
-void raw_hid_send(uint8_t *data, uint8_t length) {
+static void send_raw_hid(uint8_t *data, uint8_t length) {
if (length != RAW_EPSIZE) return;
send_report(RAW_IN_EPNUM, data, RAW_EPSIZE);
}
-/** \brief Raw HID Receive
- *
- * FIXME: Needs doc
- */
-__attribute__((weak)) void raw_hid_receive(uint8_t *data, uint8_t length) {
- // Users should #include "raw_hid.h" in their own code
- // and implement this function there. Leave this as weak linkage
- // so users can opt to not handle data coming in.
-}
-
/** \brief Raw HID Task
*
* FIXME: Needs doc
@@ -275,10 +275,6 @@ void EVENT_USB_Device_Reset(void) {
void EVENT_USB_Device_Suspend(void) {
print("[S]");
usb_device_state_set_suspend(USB_Device_ConfigurationNumber != 0, USB_Device_ConfigurationNumber);
-
-#ifdef SLEEP_LED_ENABLE
- sleep_led_enable();
-#endif
}
/** \brief Event USB Device Connect
@@ -292,12 +288,6 @@ void EVENT_USB_Device_WakeUp(void) {
#endif
usb_device_state_set_resume(USB_DeviceState == DEVICE_STATE_Configured, USB_Device_ConfigurationNumber);
-
-#ifdef SLEEP_LED_ENABLE
- sleep_led_disable();
- // NOTE: converters may not accept this
- led_set(host_keyboard_leds());
-#endif
}
#ifdef CONSOLE_ENABLE