File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -117,8 +117,7 @@ uint8_t Serial_::getShortName(char* name) {
117117 return 32 ;
118118}
119119
120- void Serial_::handleEndpoint (int ep) {
121- usbd.epAckPendingInterrupts (ep);
120+ void Serial_::handleEndpoint (int /* ep */ ) {
122121}
123122
124123bool Serial_::setup (USBSetup& setup)
Original file line number Diff line number Diff line change @@ -833,8 +833,6 @@ void USBDeviceClass::ISRHandler()
833833 // Endpoint 0 Received Setup interrupt
834834 if (usbd.epBank0IsSetupReceived (0 ))
835835 {
836- usbd.epBank0AckSetupReceived (0 );
837-
838836 USBSetup *setup = reinterpret_cast <USBSetup *>(udd_ep_out_cache_buffer[0 ]);
839837
840838 delayMicroseconds (10 );
@@ -859,24 +857,23 @@ void USBDeviceClass::ISRHandler()
859857
860858 if (usbd.epBank1IsStalled (0 ))
861859 {
862- usbd.epBank1AckStalled (0 );
863-
864860 // Remove stall request
865861 usbd.epBank1DisableStalled (0 );
866862 }
867-
868863 } // end Received Setup handler
864+ usbd.epAckPendingInterrupts (0 );
869865
870- for (int i = 1 ; i < USB_EPT_NUM; i ++) {
866+ for (int ep = 1 ; ep < USB_EPT_NUM; ep ++) {
871867 // Endpoint Transfer Complete (0/1) Interrupt
872- if (usbd.epBank0IsTransferComplete (i) || usbd. epBank1IsTransferComplete (i)) {
873- if (epHandlers[i ]) {
874- epHandlers[i ]->handleEndpoint ();
868+ if (usbd.epHasPendingInterrupts (ep)) {
869+ if (epHandlers[ep ]) {
870+ epHandlers[ep ]->handleEndpoint ();
875871 } else {
876872 #if defined(PLUGGABLE_USB_ENABLED)
877- PluggableUSB ().handleEndpoint (i );
873+ PluggableUSB ().handleEndpoint (ep );
878874 #endif
879875 }
876+ usbd.epAckPendingInterrupts (ep);
880877 }
881878 }
882879}
You can’t perform that action at this time.
0 commit comments