File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -393,9 +393,7 @@ class DoubleBufferedEPOutHandler : public EPHandler {
393393 }
394394 release ();
395395 }
396- if (usbd.epBank0IsTransferComplete (ep) || usbd.epBank1IsTransferComplete (ep)) {
397- usbd.epAckPendingInterrupts (ep);
398- }
396+ usbd.epAckPendingInterrupts (ep);
399397 }
400398
401399 // Returns how many bytes are stored in the buffers
Original file line number Diff line number Diff line change @@ -300,11 +300,9 @@ void USBDeviceClass::handleEndpoint(uint8_t ep)
300300#if defined(CDC_ENABLED)
301301 if (ep == CDC_ENDPOINT_IN || ep == CDC_ENDPOINT_ACM)
302302 {
303- if (usbd.epBank0IsTransferComplete (ep) || usbd.epBank1IsTransferComplete (ep)) {
304- // NAK on endpoint IN, the bank is not yet filled in.
305- usbd.epBank1ResetReady (ep);
306- usbd.epBank1AckTransferComplete (ep);
307- }
303+ // NAK on endpoint IN, the bank is not yet filled in.
304+ usbd.epBank1ResetReady (ep);
305+ usbd.epBank1AckTransferComplete (ep);
308306 return ;
309307 }
310308#endif
@@ -1012,11 +1010,18 @@ void USBDeviceClass::ISRHandler()
10121010 }
10131011
10141012 } // end Received Setup handler
1015- // usbd.epAckPendingInterrupts(0);
10161013
1014+ uint8_t ept_int = usbd.epInterruptSummary () & 0xFE ; // Remove endpoint number 0 (setup)
10171015 for (int ep = 1 ; ep < USB_EPT_NUM; ep++) {
1016+ // Check if endpoint has a pending interrupt
1017+ if ((ept_int & (1 << ep)) == 0 ) {
1018+ continue ;
1019+ }
1020+
10181021 // Endpoint Transfer Complete (0/1) Interrupt
1019- if (usbd.epHasPendingInterrupts (ep)) {
1022+ if (usbd.epBank0IsTransferComplete (ep) ||
1023+ usbd.epBank1IsTransferComplete (ep))
1024+ {
10201025 if (epHandlers[ep]) {
10211026 epHandlers[ep]->handleEndpoint ();
10221027 } else {
You can’t perform that action at this time.
0 commit comments