mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
usb: fix random "null ctrl req" panic when switching usb config
Change-Id: I7839edb99461abfbff03460d63343691085ef34f
This commit is contained in:
parent
d395520cd0
commit
75edff7880
3 changed files with 15 additions and 1 deletions
|
|
@ -863,9 +863,14 @@ static int usb_core_do_set_config(uint8_t new_config)
|
|||
}
|
||||
}
|
||||
init_deinit_endpoints(usb_config - 1, false);
|
||||
|
||||
/* clear any pending transfer completions,
|
||||
* because they are depend on contents of ep_data */
|
||||
usb_clear_pending_transfer_completion_events();
|
||||
/* reset endpoint states */
|
||||
memset(ep_data, 0, sizeof(ep_data));
|
||||
}
|
||||
|
||||
memset(ep_data, 0, sizeof(ep_data));
|
||||
usb_config = new_config;
|
||||
usb_state = usb_config == 0 ? ADDRESS : CONFIGURED;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue