Skip to content

Commit

Permalink
[ion] DFU driver: fix action following enumeration interruption
Browse files Browse the repository at this point in the history
An end-point reset was added to fix a enumeration problem. But, it
triggered another issue: the calculator freezes because of a SEDET (end
of session) detection. Plus, the initial bug doesn't seem to exist now.
  • Loading branch information
EmilieNumworks authored and LeaNumworks committed Aug 20, 2021
1 parent aaf2c1c commit 7bab48b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions ion/src/device/shared/usb/stack/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ void Device::poll() {
/* After a USB reset, the host talks to the device by sending messages to
* address 0; */
setAddress(0);
// Flush the FIFOs
m_ep0.reset();
m_ep0.setup();
/* In setup(), we should set the MPSIZ field in OTG_DIEPCTL0 to the maximum
* packet size depending on the enumeration speed (found in OTG_DSTS). We
Expand Down
3 changes: 1 addition & 2 deletions ion/src/device/shared/usb/stack/endpoint0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ void Endpoint0::flushTxFifo() {
OTG.DIEPCTL0()->setSNAK(true);

// Wait for core to respond
// TODO: understand why !OTG.GOTGINT()->getSEDET() is required since verion 16
while (!OTG.DIEPINT(0)->getINEPNE() && !OTG.GOTGINT()->getSEDET()) {
while (!OTG.DIEPINT(0)->getINEPNE()) {
}

// Get the Tx FIFO number
Expand Down

0 comments on commit 7bab48b

Please sign in to comment.