From 53b2d6b8b35f4907549e2b986045c2b9eab7e081 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Wed, 23 Dec 2020 23:19:08 +0200 Subject: [PATCH] Update USB debugging. * Move usbdbg.h to common headers. * Update text buffer functions. --- src/micropython | 2 +- src/omv/{ports/stm32 => common}/usbdbg.h | 0 src/omv/ports/stm32/usbdbg.c | 5 ++--- 3 files changed, 3 insertions(+), 4 deletions(-) rename src/omv/{ports/stm32 => common}/usbdbg.h (100%) diff --git a/src/micropython b/src/micropython index b4826cb16..552805900 160000 --- a/src/micropython +++ b/src/micropython @@ -1 +1 @@ -Subproject commit b4826cb165e79e2c5830b74d3ac16ddc40b5a69b +Subproject commit 552805900fdf8c747deab21e75fd33d451a21673 diff --git a/src/omv/ports/stm32/usbdbg.h b/src/omv/common/usbdbg.h similarity index 100% rename from src/omv/ports/stm32/usbdbg.h rename to src/omv/common/usbdbg.h diff --git a/src/omv/ports/stm32/usbdbg.c b/src/omv/ports/stm32/usbdbg.c index da3092d3f..cf905cdeb 100644 --- a/src/omv/ports/stm32/usbdbg.c +++ b/src/omv/ports/stm32/usbdbg.c @@ -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; }