aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol/chibios/usb_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/protocol/chibios/usb_main.c')
-rw-r--r--tmk_core/protocol/chibios/usb_main.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index 2a287e0d98..b798a8d1cb 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -21,10 +21,6 @@
#include "host.h"
#include "suspend.h"
#include "timer.h"
-#ifdef SLEEP_LED_ENABLE
-# include "sleep_led.h"
-# include "led.h"
-#endif
#include "wait.h"
#include "usb_endpoints.h"
#include "usb_device_state.h"
@@ -32,6 +28,10 @@
#include "usb_driver.h"
#include "usb_types.h"
+#ifdef RAW_ENABLE
+# include "raw_hid.h"
+#endif
+
#ifdef NKRO_ENABLE
# include "keycode_config.h"
@@ -127,19 +127,11 @@ static inline bool usb_event_queue_dequeue(usbevent_t *event) {
static inline void usb_event_suspend_handler(void) {
usb_device_state_set_suspend(USB_DRIVER.configuration != 0, USB_DRIVER.configuration);
-#ifdef SLEEP_LED_ENABLE
- sleep_led_enable();
-#endif /* SLEEP_LED_ENABLE */
}
static inline void usb_event_wakeup_handler(void) {
suspend_wakeup_init();
usb_device_state_set_resume(USB_DRIVER.configuration != 0, USB_DRIVER.configuration);
-#ifdef SLEEP_LED_ENABLE
- sleep_led_disable();
- // NOTE: converters may not accept this
- led_set(host_keyboard_leds());
-#endif /* SLEEP_LED_ENABLE */
}
bool last_suspend_state = false;
@@ -325,18 +317,10 @@ static bool usb_requests_hook_cb(USBDriver *usbp) {
return false;
}
-static __attribute__((unused)) void dummy_cb(USBDriver *usbp) {
- (void)usbp;
-}
-
static const USBConfig usbcfg = {
usb_event_cb, /* USB events callback */
usb_get_descriptor_cb, /* Device GET_DESCRIPTOR request callback */
usb_requests_hook_cb, /* Requests hook callback */
-#if STM32_USB_USE_OTG1 == TRUE || STM32_USB_USE_OTG2 == TRUE
- dummy_cb, /* Workaround for OTG Peripherals not servicing new interrupts
- after resuming from suspend. */
-#endif
};
void init_usb_driver(USBDriver *usbp) {
@@ -523,19 +507,13 @@ void console_task(void) {
#endif /* CONSOLE_ENABLE */
#ifdef RAW_ENABLE
-void raw_hid_send(uint8_t *data, uint8_t length) {
+void send_raw_hid(uint8_t *data, uint8_t length) {
if (length != RAW_EPSIZE) {
return;
}
send_report(USB_ENDPOINT_IN_RAW, data, length);
}
-__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.
-}
-
void raw_hid_task(void) {
uint8_t buffer[RAW_EPSIZE];
while (receive_report(USB_ENDPOINT_OUT_RAW, buffer, sizeof(buffer))) {