mirror of
https://github.com/hathach/tinyusb.git
synced 2026-08-18 02:53:35 +00:00
usbd: clear the queued-setup counter on bus reset
A SETUP counted before a bus reset must not be carried across it: the consumer would either skip a post-reset SETUP (count drained by the stale entry) or, if the count leaked high for any other reason, skip them all. usbd_reset() now zeroes the counter; the consumer already guards on zero, and any pre-reset SETUP still in the queue is stale by definition and correctly discarded.
This commit is contained in:
@ -642,6 +642,8 @@ static void configuration_reset(uint8_t rhport) {
|
||||
|
||||
static void usbd_reset(uint8_t rhport) {
|
||||
configuration_reset(rhport);
|
||||
// discard any pre-reset SETUP still counted: a stale count skips post-reset SETUPs
|
||||
_usbd_queued_setup = 0;
|
||||
}
|
||||
|
||||
bool tud_task_event_ready(void) {
|
||||
|
||||
Reference in New Issue
Block a user