Update USB debugging.

* Move usbdbg.h to common headers.
* Update text buffer functions.
This commit is contained in:
iabdalkader 2020-12-23 23:19:08 +02:00
parent 02ec14866c
commit 53b2d6b8b3
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: {
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));
cmd = USBDBG_NONE;
break;
@ -107,8 +107,7 @@ void usbdbg_data_in(void *buffer, int length)
}
case USBDBG_TX_BUF: {
uint8_t *tx_buf = usb_cdc_tx_buf(length);
memcpy(buffer, tx_buf, length);
xfer_bytes += usb_cdc_get_buf(buffer, length);
if (xfer_bytes == xfer_length) {
cmd = USBDBG_NONE;
}