Skip to content

Commit eee97e3

Browse files
makarenyafpistm
authored andcommitted
Revert "Variables total_length and rem_length moved into device specific context"
This reverts commit 9d71bad. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 8862f1b commit eee97e3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

cores/arduino/stm32/usb/cdc/usbd_cdc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -651,9 +651,9 @@ static uint8_t USBD_CDC_DataIn(USBD_HandleTypeDef *pdev, uint8_t epnum)
651651
USBD_CDC_ItfTypeDef *ctrl = (USBD_CDC_ItfTypeDef *)pdev->pUserData;
652652

653653
if (pdev->pClassData != NULL) {
654-
if ((hcdc->TxLastLength > 0U) && ((hcdc->TxLastLength % hpcd->IN_ep[epnum].maxpacket) == 0U)) {
654+
if ((pdev->ep_in[epnum].total_length > 0U) && ((pdev->ep_in[epnum].total_length % hpcd->IN_ep[epnum].maxpacket) == 0U)) {
655655
/* Update the packet total length */
656-
hcdc->TxLastLength = 0U;
656+
pdev->ep_in[epnum].total_length = 0U;
657657

658658
/* Send ZLP */
659659
USBD_LL_Transmit(pdev, epnum, NULL, 0U);
@@ -835,7 +835,7 @@ uint8_t USBD_CDC_TransmitPacket(USBD_HandleTypeDef *pdev)
835835
hcdc->TxState = 1U;
836836

837837
/* Update the packet total length */
838-
hcdc->TxLastLength = hcdc->TxLength;
838+
pdev->ep_in[CDC_IN_EP & 0xFU].total_length = hcdc->TxLength;
839839

840840
/* Transmit next packet */
841841
USBD_LL_Transmit(pdev, CDC_IN_EP, hcdc->TxBuffer,

cores/arduino/stm32/usb/cdc/usbd_cdc.h

-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ typedef struct {
115115
uint8_t *TxBuffer;
116116
uint32_t RxLength;
117117
uint32_t TxLength;
118-
uint32_t TxLastLength;
119118

120119
__IO uint32_t TxState;
121120
__IO uint32_t RxState;

0 commit comments

Comments
 (0)