Merge pull request #1049 from openmv/usbdbg_update

Update USB debugging.
This commit is contained in:
Ibrahim Abd Elkader 2020-12-23 23:50:12 +02:00 committed by GitHub
commit 881f5398ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

@ -1 +1 @@
Subproject commit b4826cb165e79e2c5830b74d3ac16ddc40b5a69b Subproject commit 552805900fdf8c747deab21e75fd33d451a21673

View File

@ -90,7 +90,7 @@ void usbdbg_data_in(void *buffer, int length)
} }
case USBDBG_TX_BUF_LEN: { case USBDBG_TX_BUF_LEN: {
uint32_t tx_buf_len = usb_cdc_tx_buf_len(); uint32_t tx_buf_len = usb_cdc_buf_len();
memcpy(buffer, &tx_buf_len, sizeof(tx_buf_len)); memcpy(buffer, &tx_buf_len, sizeof(tx_buf_len));
cmd = USBDBG_NONE; cmd = USBDBG_NONE;
break; break;
@ -107,8 +107,7 @@ void usbdbg_data_in(void *buffer, int length)
} }
case USBDBG_TX_BUF: { case USBDBG_TX_BUF: {
uint8_t *tx_buf = usb_cdc_tx_buf(length); xfer_bytes += usb_cdc_get_buf(buffer, length);
memcpy(buffer, tx_buf, length);
if (xfer_bytes == xfer_length) { if (xfer_bytes == xfer_length) {
cmd = USBDBG_NONE; cmd = USBDBG_NONE;
} }