@@ -394,6 +394,7 @@ void USBDeviceClass::initEP(uint32_t ep, uint32_t config)
394
394
usbd.epBank1SetSize (ep, 64 );
395
395
usbd.epBank1SetAddress (ep, &udd_ep_in_cache_buffer[ep]);
396
396
usbd.epBank1SetType (ep, 4 ); // INTERRUPT IN
397
+ usbd.epBank1EnableTransferComplete (ep);
397
398
}
398
399
else if (config == (USB_ENDPOINT_TYPE_BULK | USB_ENDPOINT_OUT (0 )))
399
400
{
@@ -411,6 +412,9 @@ void USBDeviceClass::initEP(uint32_t ep, uint32_t config)
411
412
usbd.epBank1ResetReady (ep);
412
413
413
414
usbd.epBank1SetType (ep, 3 ); // BULK IN
415
+
416
+ // XXX: this somehow interfere with CDC rx - WHY???
417
+ // usbd.epBank1EnableTransferComplete(ep);
414
418
}
415
419
else if (config == USB_ENDPOINT_TYPE_CONTROL)
416
420
{
@@ -426,6 +430,9 @@ void USBDeviceClass::initEP(uint32_t ep, uint32_t config)
426
430
427
431
// Release OUT EP
428
432
usbd.epReleaseOutBank0 (ep, 64 );
433
+
434
+ // Enable Setup-Received interrupt
435
+ usbd.epBank0EnableSetupReceived (ep);
429
436
}
430
437
}
431
438
@@ -763,10 +770,6 @@ bool USBDeviceClass::handleStandardSetup(USBSetup &setup)
763
770
initEndpoints ();
764
771
_usbConfiguration = setup.wValueL ;
765
772
766
- #ifdef CDC_ENABLED
767
- SerialUSB.enableInterrupt ();
768
- #endif
769
-
770
773
sendZlp (0 );
771
774
return true ;
772
775
} else {
@@ -801,9 +804,6 @@ void USBDeviceClass::ISRHandler()
801
804
// Configure EP 0
802
805
initEP (0 , USB_ENDPOINT_TYPE_CONTROL);
803
806
804
- // Enable Setup-Received interrupt
805
- usbd.epBank0EnableSetupReceived (0 );
806
-
807
807
_usbConfiguration = 0 ;
808
808
}
809
809
0 commit comments