Skip to content

Commit

Permalink
USB glue: check mode before read (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrZlo13 committed Jul 21, 2023
1 parent 09111b4 commit a398f19
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/tinyusb/drivers/usb-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,11 @@ void usb_glue_cdc_send(const uint8_t* buf, size_t len, bool flush) {
}

size_t usb_glue_cdc_receive(uint8_t* buf, size_t len) {
return tud_cdc_n_read(BlackmagicCDCTypeUART, buf, len);
if(usb_device_type == USBDeviceTypeDualCDC) {
return tud_cdc_n_read(BlackmagicCDCTypeUART, buf, len);
} else {
return tud_cdc_n_read(DapCDCTypeUART, buf, len);
}
}

void usb_glue_gdb_send(const uint8_t* buf, size_t len, bool flush) {
Expand Down

0 comments on commit a398f19

Please sign in to comment.