Skip to content

Fixed error, when host send some buffer, less then minimum. - #466

Merged
fpistm merged 1 commit into
stm32duino:masterfrom
makarenya:buffer_size_fix
Mar 7, 2019
Merged

Fixed error, when host send some buffer, less then minimum.#466
fpistm merged 1 commit into
stm32duino:masterfrom
makarenya:buffer_size_fix

Conversation

@makarenya

Copy link
Copy Markdown
Contributor

Fixed error, when host send some buffer, less then minimum, and new buffer can't be allocated

I found error in my buffer flipping technology (for usb CDC). When host sends some buffer, less than maxpacket and queue is full, USBD_CDC_Receive does nothing... But, it means, that usb pcd try to fill the rest of previously allocated buffer, and it will expect, that host will send buffer, smaller that maxpacket. But as a rule it is not. So, we must clear pcd buffer in this case.

@fpistm
fpistm self-requested a review March 6, 2019 15:40
@fpistm fpistm added bug 🐛 Something isn't working fix 🩹 Bug fix labels Mar 6, 2019
@fpistm fpistm added this to the 1.5.1/1.6.0 milestone Mar 6, 2019

@fpistm fpistm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one comment else LGTM

Comment thread cores/arduino/stm32/usb/cdc/usbd_cdc.c Outdated
@fpistm
fpistm merged commit 33bedf6 into stm32duino:master Mar 7, 2019
Comment thread cores/arduino/stm32/usb/cdc/usbd_cdc_if.c
benwaffle pushed a commit to benwaffle/Arduino_Core_STM32 that referenced this pull request Apr 10, 2019
Fixed error, when host send some buffer, less then minimum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐛 Something isn't working fix 🩹 Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants