-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix endpoint checking; Clean up safe mode printing #4754
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK, no testing performed.
It did not fix #4746 in my tests, both cases with issues now do a reset loop. |
Thanks, because of debugging issues I was testing with an STM board, but will try with an ESP32-S2. |
@Neradoc It turns out the ESP32-S2 endpoint situation is idiosyncratic. From the datasheet:
So there are six additional endpoint pairs, but there can be only up to 5 IN endpoints among EP0 and the six. We need EP0, and then we need four more: one IN for MSC, one IN for HID, two IN per CDC (control and data). So there are not enough for the secondary CDC unless MSC or HID is turned off. There could be MIDI. I'll have to decide how dynamic I can make this, There are static allocations in TinyUSB for each device. |
Note edit in previous comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. It might be good to try an update the translations so that the ones aren't lost about button presses.
I'll be making more changes; dismissing just so it won't be merged.
5f639f3
to
fa6c06f
Compare
Added:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks!
Fixes #4746.
Fixes #4752 (STM32 HID support).
CIRCUITPY_USB_{HID,MIDI,MSC}_ENABLED_DEFAULT
default values were not set conditionally.print_safe_mode_message()
to simplify logic, reduce size, and divide up safe-mode reasons more accurately.run_code_py()
to not print the safe-mode message twice, clean up newlines, and be more consistent about whitespace.EDIT:
It appears to me that a
translate()
message with a\n
in it is actually printed as a\r\n
byserial_write_compressed()
. I'm not sure if that's done during printing or during compression. But a bareserial_write("\n")
does not print a\r
. So I added\r
as necessary in a few places.