Remove the option to block in USBDevice::connect since this
should be handled at a higher level. Also call init to ensure that
the USBDevice has been initalized.
Add the helper function endpoint_remove_all which removes all added
endpoints. This is useful for class drivers switching between
different USB configurations.
Stalling endpoint 0 indicates the end of a control transfer.
Return immediately when this occurs rather than continuing processing.
In particular, this patch prevents status from erroneously being
sent when _request_setup returns false inside _complete_request.
Perform processing triggered by user callbacks when USB is being
unlocked rather than synchronously. This prevents recursive callbacks
which reduces stack usage. This also prevents state change inside
the user callback which makes the code easier to reason about.
Initialize the _transfer structure so the behavior is the same
regardless of prior memory contents. This fixes a hang during
USB testing when CI flags are used.
Remove the USBDevice function read_start and automatically start all
reads internally in USBDevice. This patch also renames the function
read_finish to read.