@@ -295,12 +295,12 @@ USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev,
295
295
pep = & pdev -> ep_out [0 ];
296
296
297
297
if (pdev -> ep0_state == USBD_EP0_DATA_OUT ) {
298
- if (pep -> rem_length > pep -> maxpacket ) {
299
- pep -> rem_length -= pep -> maxpacket ;
298
+ if (pep -> rem_length > USB_MAX_EP0_SIZE ) {
299
+ pep -> rem_length -= USB_MAX_EP0_SIZE ;
300
300
301
301
USBD_CtlContinueRx (pdev ,
302
302
pdata ,
303
- (uint16_t )MIN (pep -> rem_length , pep -> maxpacket ));
303
+ (uint16_t )MIN (pep -> rem_length , USB_MAX_EP0_SIZE ));
304
304
} else {
305
305
if ((pdev -> pClass -> EP0_RxReady != NULL ) &&
306
306
(pdev -> dev_state == USBD_STATE_CONFIGURED )) {
@@ -344,17 +344,17 @@ USBD_StatusTypeDef USBD_LL_DataInStage(USBD_HandleTypeDef *pdev, uint8_t epnum,
344
344
pep = & pdev -> ep_in [0 ];
345
345
346
346
if (pdev -> ep0_state == USBD_EP0_DATA_IN ) {
347
- if (pep -> rem_length > pep -> maxpacket ) {
348
- pep -> rem_length -= pep -> maxpacket ;
347
+ if (pep -> rem_length > USB_MAX_EP0_SIZE ) {
348
+ pep -> rem_length -= USB_MAX_EP0_SIZE ;
349
349
350
350
USBD_CtlContinueSendData (pdev , pdata , (uint16_t )pep -> rem_length );
351
351
352
352
/* Prepare endpoint for premature end of transfer */
353
353
USBD_LL_PrepareReceive (pdev , 0U , NULL , 0U );
354
354
} else {
355
355
/* last packet is MPS multiple, so send ZLP packet */
356
- if ((pep -> total_length % pep -> maxpacket == 0U ) &&
357
- (pep -> total_length >= pep -> maxpacket ) &&
356
+ if ((pep -> total_length % USB_MAX_EP0_SIZE == 0U ) &&
357
+ (pep -> total_length >= USB_MAX_EP0_SIZE ) &&
358
358
(pep -> total_length < pdev -> ep0_data_len )) {
359
359
USBD_CtlContinueSendData (pdev , NULL , 0U );
360
360
pdev -> ep0_data_len = 0U ;
@@ -410,13 +410,10 @@ USBD_StatusTypeDef USBD_LL_Reset(USBD_HandleTypeDef *pdev)
410
410
USBD_LL_OpenEP (pdev , 0x00U , USBD_EP_TYPE_CTRL , USB_MAX_EP0_SIZE );
411
411
pdev -> ep_out [0x00U & 0xFU ].is_used = 1U ;
412
412
413
- pdev -> ep_out [0 ].maxpacket = USB_MAX_EP0_SIZE ;
414
-
415
413
/* Open EP0 IN */
416
414
USBD_LL_OpenEP (pdev , 0x80U , USBD_EP_TYPE_CTRL , USB_MAX_EP0_SIZE );
417
415
pdev -> ep_in [0x80U & 0xFU ].is_used = 1U ;
418
416
419
- pdev -> ep_in [0 ].maxpacket = USB_MAX_EP0_SIZE ;
420
417
/* Upon Reset call user call back */
421
418
pdev -> dev_state = USBD_STATE_DEFAULT ;
422
419
pdev -> ep0_state = USBD_EP0_IDLE ;
0 commit comments