Oops. Request handlers called from setup handler could access the IN side of the endpoint, which does not get a copy of the SETUP bytes.

TODO: Make a single copy of the SETUP bytes, and provide a clean way to access those bytes regardless of whether you're holding the IN or OUT endpoint. (This was a problem in the IN complete handler, and probably other places, too.)
This commit is contained in:
Jared Boone
2012-10-18 19:42:36 -07:00
parent fc9632f19d
commit e8b30f3489

View File

@ -557,6 +557,9 @@ static void usb_check_for_setup_events() {
);
if( endpoint && endpoint->setup_complete ) {
copy_setup(&endpoint->setup, usb_queue_head(endpoint->address)->setup);
// TODO: Clean up this duplicated effort by providing
// a cleaner way to get the SETUP data.
copy_setup(&endpoint->in->setup, usb_queue_head(endpoint->address)->setup);
usb_clear_endpoint_setup_status(endptsetupstat_bit);
endpoint->setup_complete(endpoint);
} else {