summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/usbd_cdc_interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'stmhal/usbd_cdc_interface.c')
-rw-r--r--stmhal/usbd_cdc_interface.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/stmhal/usbd_cdc_interface.c b/stmhal/usbd_cdc_interface.c
index 552f7cc9ec..b81ab11b24 100644
--- a/stmhal/usbd_cdc_interface.c
+++ b/stmhal/usbd_cdc_interface.c
@@ -265,10 +265,11 @@ void USBD_CDC_HAL_TIM_PeriodElapsedCallback(void) {
if (UserTxBufPtrOut != UserTxBufPtrOutShadow) {
// We have sent data and are waiting for the low-level USB driver to
// finish sending it over the USB in-endpoint.
- if (UserTxBufPtrWaitCount < 10) {
+ // We have a 15 * 10ms = 150ms timeout
+ if (UserTxBufPtrWaitCount < 15) {
PCD_HandleTypeDef *hpcd = hUSBDDevice.pData;
USB_OTG_GlobalTypeDef *USBx = hpcd->Instance;
- if (USBx_INEP(3)->DIEPTSIZ & USB_OTG_DIEPTSIZ_XFRSIZ) {
+ if (USBx_INEP(CDC_IN_EP & 0x7f)->DIEPTSIZ & USB_OTG_DIEPTSIZ_XFRSIZ) {
// USB in-endpoint is still reading the data
UserTxBufPtrWaitCount++;
return;