File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,10 +265,11 @@ void USBD_CDC_HAL_TIM_PeriodElapsedCallback(void) {
265265 if (UserTxBufPtrOut != UserTxBufPtrOutShadow ) {
266266 // We have sent data and are waiting for the low-level USB driver to
267267 // finish sending it over the USB in-endpoint.
268- if (UserTxBufPtrWaitCount < 10 ) {
268+ // We have a 15 * 10ms = 150ms timeout
269+ if (UserTxBufPtrWaitCount < 15 ) {
269270 PCD_HandleTypeDef * hpcd = hUSBDDevice .pData ;
270271 USB_OTG_GlobalTypeDef * USBx = hpcd -> Instance ;
271- if (USBx_INEP (3 )-> DIEPTSIZ & USB_OTG_DIEPTSIZ_XFRSIZ ) {
272+ if (USBx_INEP (CDC_IN_EP & 0x7f )-> DIEPTSIZ & USB_OTG_DIEPTSIZ_XFRSIZ ) {
272273 // USB in-endpoint is still reading the data
273274 UserTxBufPtrWaitCount ++ ;
274275 return ;
Original file line number Diff line number Diff line change 1313#define MSC_IN_EP (0x81)
1414#define MSC_OUT_EP (0x01)
1515
16+ // Need to define here for usbd_cdc_interface.c (it needs CDC_IN_EP)
17+ #define CDC_IN_EP (0x83)
18+ #define CDC_OUT_EP (0x03)
19+ #define CDC_CMD_EP (0x82)
20+
1621// only CDC_MSC and CDC_HID are available
1722#define USBD_MODE_CDC (0x01)
1823#define USBD_MODE_MSC (0x02)
Original file line number Diff line number Diff line change 44#define USB_CDC_MSC_CONFIG_DESC_SIZ (98)
55#define USB_CDC_HID_CONFIG_DESC_SIZ (100)
66#define CDC_IFACE_NUM (1)
7- #define CDC_IN_EP (0x83)
8- #define CDC_OUT_EP (0x03)
9- #define CDC_CMD_EP (0x82)
107#define MSC_IFACE_NUM (0)
118#define HID_IFACE_NUM_WITH_CDC (0)
129#define HID_IFACE_NUM_WITH_MSC (1)
You can’t perform that action at this time.
0 commit comments