From ff8eb874192791605eea7861c6f6689fb4e1907e Mon Sep 17 00:00:00 2001 From: Nikolay Minaylov Date: Mon, 25 Apr 2022 14:57:43 +0300 Subject: [PATCH] BadUSB Speedup: set USB HID interval to 2ms (#1166) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: あく --- firmware/targets/f7/furi_hal/furi_hal_usb_hid.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c b/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c index b9b4bbb0..55825dd9 100644 --- a/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c +++ b/firmware/targets/f7/furi_hal/furi_hal_usb_hid.c @@ -9,6 +9,7 @@ #include "hid_usage_desktop.h" #include "hid_usage_button.h" #include "hid_usage_keyboard.h" +#include "hid_usage_consumer.h" #include "hid_usage_led.h" #define HID_EP_IN 0x81 @@ -18,8 +19,7 @@ #define HID_KB_MAX_KEYS 6 #define HID_CONSUMER_MAX_KEYS 2 -#define HID_PAGE_CONSUMER 0x0C -#define HID_CONSUMER_CONTROL 0x01 +#define HID_INTERVAL 2 #define HID_VID_DEFAULT 0x046D #define HID_PID_DEFAULT 0xC529 @@ -190,7 +190,7 @@ static const struct HidConfigDescriptor hid_cfg_desc = { .bEndpointAddress = HID_EP_IN, .bmAttributes = USB_EPTYPE_INTERRUPT, .wMaxPacketSize = HID_EP_SZ, - .bInterval = 10, + .bInterval = HID_INTERVAL, }, .hid_ep_out = { @@ -199,7 +199,7 @@ static const struct HidConfigDescriptor hid_cfg_desc = { .bEndpointAddress = HID_EP_OUT, .bmAttributes = USB_EPTYPE_INTERRUPT, .wMaxPacketSize = HID_EP_SZ, - .bInterval = 10, + .bInterval = HID_INTERVAL, }, }, };