Skip to content

Commit 34c1d07

Browse files
committed
Update USBHID.cpp
1 parent d1223dd commit 34c1d07

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

libraries/USB/src/USBHID.cpp

-26
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,6 @@ ESP_EVENT_DEFINE_BASE(ARDUINO_USB_HID_EVENTS);
2323
esp_err_t arduino_usb_event_post(esp_event_base_t event_base, int32_t event_id, void *event_data, size_t event_data_size, TickType_t ticks_to_wait);
2424
esp_err_t arduino_usb_event_handler_register_with(esp_event_base_t event_base, int32_t event_id, esp_event_handler_t event_handler, void *event_handler_arg);
2525

26-
static void log_print_buf_line(const uint8_t *b, size_t len){
27-
for(size_t i = 0; i<len; i++){
28-
log_printf("%s0x%02x,",i?" ":"", b[i]);
29-
}
30-
for(size_t i = len; i<16; i++){
31-
log_printf(" ");
32-
}
33-
log_printf(" // ");
34-
for(size_t i = 0; i<len; i++){
35-
log_printf("%c",((b[i] >= 0x20) && (b[i] < 0x80))?b[i]:'.');
36-
}
37-
log_printf("\n");
38-
}
39-
40-
void log_print_buf(const uint8_t *b, size_t len){
41-
if(!len || !b){
42-
return;
43-
}
44-
for(size_t i = 0; i<len; i+=16){
45-
log_printf("/* 0x%04X */ ", i);
46-
log_print_buf_line(b+i, ((len-i)<16)?(len - i):16);
47-
}
48-
}
49-
5026
typedef struct {
5127
USBHIDDevice * device;
5228
uint8_t reports_num;
@@ -266,12 +242,10 @@ void tud_hid_set_report_cb(uint8_t instance, uint8_t report_id, hid_report_type_
266242
report_id = buffer[0];
267243
if(!tinyusb_on_set_output(report_id, buffer+1, bufsize-1)){
268244
log_d("instance: %u, report_id: %u, report_type: %s, bufsize: %u", instance, *buffer, tinyusb_hid_device_report_types[HID_REPORT_TYPE_OUTPUT], bufsize-1);
269-
//log_print_buf(buffer+1, bufsize-1);
270245
}
271246
} else {
272247
if(!tinyusb_on_set_feature(report_id, buffer, bufsize)){
273248
log_d("instance: %u, report_id: %u, report_type: %s, bufsize: %u", instance, report_id, tinyusb_hid_device_report_types[report_type], bufsize);
274-
//log_print_buf(buffer, bufsize);
275249
}
276250
}
277251
}

0 commit comments

Comments
 (0)