diff options
author | Drashna Jaelre <drashna@live.com> | 2022-11-23 22:50:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-24 15:50:11 +0900 |
commit | 263bc7cf21e60ecefe602d8fe3d02945201eaf77 (patch) | |
tree | 16ad661fae12185c53fe11e4c4eed5bdb1f927e9 /tmk_core/protocol/chibios | |
parent | 64f04b30c2f48fc0e7c49ca043443f03dc56df94 (diff) |
Remove Web USB (depreciated) (#361)
Diffstat (limited to 'tmk_core/protocol/chibios')
-rw-r--r-- | tmk_core/protocol/chibios/chibios.c | 7 | ||||
-rw-r--r-- | tmk_core/protocol/chibios/usb_main.c | 61 |
2 files changed, 0 insertions, 68 deletions
diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c index bd6adbe17e..259fe31cc0 100644 --- a/tmk_core/protocol/chibios/chibios.c +++ b/tmk_core/protocol/chibios/chibios.c @@ -81,10 +81,6 @@ void console_task(void); void midi_ep_task(void); #endif -#ifdef WEBUSB_ENABLE -void webusb_task(void); -#endif - /* TESTING * Amber LED blinker thread, times are in milliseconds. */ @@ -222,8 +218,5 @@ void protocol_post_task(void) { #ifdef RAW_ENABLE raw_hid_task(); #endif -#ifdef WEBUSB_ENABLE - webusb_task(); -#endif } diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index b61228511d..f9124f6b9d 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -58,10 +58,6 @@ extern keymap_config_t keymap_config; # include "oryx.h" #endif -#ifdef WEBUSB_ENABLE -# include "webusb.h" -#endif - #ifdef JOYSTICK_ENABLE # include "joystick.h" #endif @@ -331,9 +327,6 @@ typedef struct { #ifdef VIRTSER_ENABLE usb_driver_config_t serial_driver; #endif -#ifdef WEBUSB_ENABLE - usb_driver_config_t webusb_driver; -#endif #ifdef JOYSTICK_ENABLE usb_driver_config_t joystick_driver; #endif @@ -381,13 +374,6 @@ static usb_driver_configs_t drivers = { .serial_driver = QMK_USB_DRIVER_CONFIG(CDC, CDC_NOTIFICATION_EPNUM, false), #endif -#ifdef WEBUSB_ENABLE -# define WEBUSB_IN_CAPACITY 4 -# define WEBUSB_OUT_CAPACITY 4 -# define WEBUSB_IN_MODE USB_EP_MODE_TYPE_INTR -# define WEBUSB_OUT_MODE USB_EP_MODE_TYPE_INTR - .webusb_driver = QMK_USB_DRIVER_CONFIG(WEBUSB, 0, false), -#endif #ifdef JOYSTICK_ENABLE # define JOYSTICK_IN_CAPACITY 4 # define JOYSTICK_OUT_CAPACITY 4 @@ -695,28 +681,6 @@ static bool usb_request_hook_cb(USBDriver *usbp) { break; } } - -#ifdef WEBUSB_ENABLE - switch (usbp->setup[1]) { - case WEBUSB_VENDOR_CODE: - if (usbp->setup[4] == WebUSB_RTYPE_GetURL) { - if (usbp->setup[2] == WEBUSB_LANDING_PAGE_INDEX) { - usbSetupTransfer(usbp, (uint8_t *)&WebUSB_LandingPage, WebUSB_LandingPage.Header.Size, NULL); - return TRUE; - break; - } - } - break; - - case MS_OS_20_VENDOR_CODE: - if (usbp->setup[4] == MS_OS_20_DESCRIPTOR_INDEX) { - usbSetupTransfer(usbp, (uint8_t *)&MS_OS_20_Descriptor, MS_OS_20_Descriptor.Header.TotalLength, NULL); - return TRUE; - break; - } - break; - } -#endif /* Handle the Get_Descriptor Request for HID class (not handled by the default hook) */ if ((usbp->setup[0] == 0x81) && (usbp->setup[1] == USB_REQ_GET_DESCRIPTOR)) { dp = usbp->config->get_descriptor_cb(usbp, usbp->setup[3], usbp->setup[2], get_hword(&usbp->setup[4])); @@ -1166,31 +1130,6 @@ void raw_hid_task(void) { #endif -#ifdef WEBUSB_ENABLE -void webusb_send(uint8_t *data, uint8_t length) { - if (chnWriteTimeout(&drivers.webusb_driver.driver, data, length, TIME_IMMEDIATE) != length) { - webusb_state.paired = false; - webusb_state.pairing = false; - } -} - -// 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 webusb_task(void) { - uint8_t buffer[WEBUSB_EPSIZE]; - size_t size = 0; - do { - size_t size = chnReadTimeout(&drivers.webusb_driver.driver, buffer, sizeof(buffer), TIME_IMMEDIATE); - if (size > 0) { - webusb_receive(buffer, size); - } - } while (size > 0); -} - -#endif - #ifdef MIDI_ENABLE void send_midi_packet(MIDI_EventPacket_t *event) { |