@@ -295,12 +295,12 @@ USBD_StatusTypeDef USBD_LL_DataOutStage(USBD_HandleTypeDef *pdev,
295295 pep = & pdev -> ep_out [0 ];
296296
297297 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 ;
300300
301301 USBD_CtlContinueRx (pdev ,
302302 pdata ,
303- (uint16_t )MIN (pep -> rem_length , pep -> maxpacket ));
303+ (uint16_t )MIN (pep -> rem_length , USB_MAX_EP0_SIZE ));
304304 } else {
305305 if ((pdev -> pClass -> EP0_RxReady != NULL ) &&
306306 (pdev -> dev_state == USBD_STATE_CONFIGURED )) {
@@ -344,17 +344,17 @@ USBD_StatusTypeDef USBD_LL_DataInStage(USBD_HandleTypeDef *pdev, uint8_t epnum,
344344 pep = & pdev -> ep_in [0 ];
345345
346346 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 ;
349349
350350 USBD_CtlContinueSendData (pdev , pdata , (uint16_t )pep -> rem_length );
351351
352352 /* Prepare endpoint for premature end of transfer */
353353 USBD_LL_PrepareReceive (pdev , 0U , NULL , 0U );
354354 } else {
355355 /* 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 ) &&
358358 (pep -> total_length < pdev -> ep0_data_len )) {
359359 USBD_CtlContinueSendData (pdev , NULL , 0U );
360360 pdev -> ep0_data_len = 0U ;
@@ -410,13 +410,10 @@ USBD_StatusTypeDef USBD_LL_Reset(USBD_HandleTypeDef *pdev)
410410 USBD_LL_OpenEP (pdev , 0x00U , USBD_EP_TYPE_CTRL , USB_MAX_EP0_SIZE );
411411 pdev -> ep_out [0x00U & 0xFU ].is_used = 1U ;
412412
413- pdev -> ep_out [0 ].maxpacket = USB_MAX_EP0_SIZE ;
414-
415413 /* Open EP0 IN */
416414 USBD_LL_OpenEP (pdev , 0x80U , USBD_EP_TYPE_CTRL , USB_MAX_EP0_SIZE );
417415 pdev -> ep_in [0x80U & 0xFU ].is_used = 1U ;
418416
419- pdev -> ep_in [0 ].maxpacket = USB_MAX_EP0_SIZE ;
420417 /* Upon Reset call user call back */
421418 pdev -> dev_state = USBD_STATE_DEFAULT ;
422419 pdev -> ep0_state = USBD_EP0_IDLE ;
0 commit comments