[usb] Reset endpoints before setting them up.

This fixes an enumaration bug when plugging, un-plugging and re-plugging
the calculator.

Change-Id: Ifbb4386b46b7492ce2b833e9e4755fd3cfefc708
This commit is contained in:
Léa Saviot
2018-02-14 16:52:46 +01:00
parent 3583ea3ade
commit 78f56d9ada

View File

@@ -214,6 +214,7 @@ void poll() {
/* Handle USB RESET. */
OTG.GINTSTS()->setENUMDNE(true); //Clear the ENUMDNE bit.
usb_set_address(0);
usb_endpoints_reset();
usb_endpoint_setup();
return;
}