SAMD21: one endpoint pair for MSC now instead of two #4239
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A long time ago when I was working on HID, I found that MSC on the SAMD21 needed to use separate endpoint pairs for IN and OUT. I discovered this only empirically. There is no erratum that would dictate needing two endpoints. At the time we were using the ASF4 USB stack. I was suspicious it was due to ASF4, but could not be sure.
Now that we are using TinyUSB, I tried this again, and, after some mild testing, I didn't see any problem with using just one endpoint pair with MSC on SAMD21. Neither do the TinyUSB MSC examples.
This PR undoes the special treatment for SAMD21. Theoretically, now, secondary CDC is available on SAMD21. Practically speaking, there is no room on many builds. When turned on, it does not fit on non-Express boards, and only barely fits on smaller translations on SAMD21 Express boards. So I have left it turned off. However, custom builds with secondary CDC should now be possible on SAMD21.
@hathach Just tagging you for interest.