Skip to content

Commit 12a186b

Browse files
committed
update HID to work with new esp32 config descriptor builder
1 parent 6e77d5b commit 12a186b

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

src/arduino/hid/Adafruit_USBD_HID.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,7 @@ static Adafruit_USBD_HID *_hid_instances[CFG_TUD_HID] = {0};
3333

3434
uint8_t Adafruit_USBD_HID::_instance_count = 0;
3535

36-
#ifdef ARDUINO_ARCH_ESP32
37-
static uint16_t hid_load_descriptor(uint8_t *dst, uint8_t *itf) {
38-
// uint8_t str_index = tinyusb_add_string_descriptor("TinyUSB HID");
39-
40-
uint8_t const inst_count = Adafruit_USBD_HID::getInstanceCount();
41-
TU_VERIFY(inst_count > 0, 0);
42-
43-
Adafruit_USBD_HID *p_hid = _hid_instances[inst_count - 1];
44-
TU_VERIFY(p_hid);
45-
46-
uint8_t ep_in = tinyusb_get_free_in_endpoint();
47-
TU_VERIFY(ep_in != 0);
48-
ep_in |= 0x80;
49-
50-
uint8_t ep_out = 0;
51-
if (p_hid->isOutEndpointEnabled()) {
52-
ep_out = tinyusb_get_free_out_endpoint();
53-
TU_VERIFY(ep_out != 0);
54-
}
55-
56-
uint16_t const desc_len =
57-
p_hid->makeItfDesc(*itf, dst, TUD_HID_INOUT_DESC_LEN, ep_in, ep_out);
58-
59-
*itf += 1;
60-
return desc_len;
61-
}
62-
#endif
63-
6436
//------------- IMPLEMENTATION -------------//
65-
6637
Adafruit_USBD_HID::Adafruit_USBD_HID(void)
6738
: Adafruit_USBD_HID(NULL, 0, HID_ITF_PROTOCOL_NONE, 4, false) {}
6839

@@ -81,19 +52,6 @@ Adafruit_USBD_HID::Adafruit_USBD_HID(uint8_t const *desc_report, uint16_t len,
8152

8253
_get_report_cb = NULL;
8354
_set_report_cb = NULL;
84-
85-
#ifdef ARDUINO_ARCH_ESP32
86-
// ESP32 requires setup configuration descriptor within constructor
87-
if (_instance_count >= CFG_TUD_HID) {
88-
return;
89-
}
90-
91-
_instance = _instance_count++;
92-
_hid_instances[_instance] = this;
93-
94-
uint16_t const desc_len = getInterfaceDescriptorLen();
95-
tinyusb_enable_interface(USB_INTERFACE_HID, desc_len, hid_load_descriptor);
96-
#endif
9755
}
9856

9957
void Adafruit_USBD_HID::setPollInterval(uint8_t interval_ms) {

0 commit comments

Comments
 (0)