@@ -733,6 +733,15 @@ static void handle_alt_ev(void)
733
733
set_nfsr (NFSR_NODE_OPERATIONAL );
734
734
USB -> USB_ALTMSK_REG = USB_USB_ALTMSK_REG_USB_M_RESET_Msk |
735
735
USB_USB_ALTMSK_REG_USB_M_SD3_Msk ;
736
+ // Re-enable reception of endpoint with pending transfer
737
+ for (int epnum = 1 ; epnum <= 3 ; ++ epnum )
738
+ {
739
+ xfer_ctl_t * xfer = XFER_CTL_BASE (epnum , TUSB_DIR_OUT );
740
+ if (xfer -> total_len > xfer -> transferred )
741
+ {
742
+ start_rx_packet (xfer );
743
+ }
744
+ }
736
745
dcd_event_bus_signal (0 , DCD_EVENT_RESUME , true);
737
746
}
738
747
}
@@ -935,13 +944,13 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
935
944
if (dir == TUSB_DIR_OUT )
936
945
{
937
946
regs -> epc_out = epnum | USB_USB_EPC1_REG_USB_EP_EN_Msk | iso_mask ;
938
- USB -> USB_RXMSK_REG |= 0x101 << (epnum - 1 );
947
+ USB -> USB_RXMSK_REG |= 0x11 << (epnum - 1 );
939
948
REG_SET_BIT (USB_MAMSK_REG , USB_M_RX_EV );
940
949
}
941
950
else
942
951
{
943
952
regs -> epc_in = epnum | USB_USB_EPC1_REG_USB_EP_EN_Msk | iso_mask ;
944
- USB -> USB_TXMSK_REG |= 0x101 << (epnum - 1 );
953
+ USB -> USB_TXMSK_REG |= 0x11 << (epnum - 1 );
945
954
REG_SET_BIT (USB_MAMSK_REG , USB_M_TX_EV );
946
955
}
947
956
}
@@ -982,7 +991,7 @@ void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr)
982
991
{
983
992
regs -> rxc = USB_USB_RXC1_REG_USB_FLUSH_Msk ;
984
993
regs -> epc_out = 0 ;
985
- USB -> USB_RXMSK_REG &= ~(0x101 << (epnum - 1 ));
994
+ USB -> USB_RXMSK_REG &= ~(0x11 << (epnum - 1 ));
986
995
// Release DMA if needed
987
996
if (_dcd .dma_ep [TUSB_DIR_OUT ] == epnum )
988
997
{
@@ -994,7 +1003,7 @@ void dcd_edpt_close(uint8_t rhport, uint8_t ep_addr)
994
1003
{
995
1004
regs -> txc = USB_USB_TXC1_REG_USB_FLUSH_Msk ;
996
1005
regs -> epc_in = 0 ;
997
- USB -> USB_TXMSK_REG &= ~(0x101 << (epnum - 1 ));
1006
+ USB -> USB_TXMSK_REG &= ~(0x11 << (epnum - 1 ));
998
1007
// Release DMA if needed
999
1008
if (_dcd .dma_ep [TUSB_DIR_IN ] == epnum )
1000
1009
{
0 commit comments