Skip to content

Subtract one from USB_EP_SIZE in USB_SendSpace #4864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2016

Conversation

sandeepmistry
Copy link
Contributor

This avoids dealing with ZLP’s in USB_Send, because the max packet size will be EP size - 1.

Alternative to #4138 to resolve #3946.

cc/ @NicoHood @embmicro @BlackBrix.

This avoids dealing with ZLP’s in USB_Send, because the max packet size
will be EP size - 1.
@sandeepmistry sandeepmistry added feature request A request to make an enhancement (not a bug fix) USB: CDC serial Serial interface used by MCUs with native USB (e.g. Leonardo) to communicate with the computer Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) labels Apr 14, 2016
@NicoHood
Copy link
Contributor

Was this internally discussed and tested?

@agdl
Copy link
Member

agdl commented Jul 12, 2016

@NicoHood Yes, tested by me on Ubuntu and Windows. If you can also try it out is good :)

@NicoHood
Copy link
Contributor

NicoHood commented Nov 6, 2016

A user reported that this PR breaks the raw hid code:
NicoHood/HID#91

The ZLP needs to be handled inside the Serial, not the USB-Core. Please revert this commit and think of another solution. This possibly also breaks other USB libs.

@sandeepmistry
Copy link
Contributor Author

@NicoHood thanks for letting us know.

Do you have any suggestions on how to move forward? Please note, the SAMD core has the same behaviour as this PR: arduino/ArduinoCore-samd@40d9554.

@NicoHood
Copy link
Contributor

NicoHood commented Nov 8, 2016

No I dont know how to solve this problem, but I remember that there were multiple solutions provided. I'd revert the PR for now, as this is defenitely implemented wrong and needs to move to the serial library, not the usb core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) feature request A request to make an enhancement (not a bug fix) USB: CDC serial Serial interface used by MCUs with native USB (e.g. Leonardo) to communicate with the computer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Leonardo fails to send exactly 64 bytes.
4 participants