summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Kueppers <[email protected]>2022-10-24 22:39:38 +0200
committerMengsk <[email protected]>2022-12-29 12:13:56 +0100
commit8c0388f477839810260f578922f17a5197294cc1 (patch)
treec90c19946d765a5b5c3625b5c721613260aee601 /src
parentd9b2c9934a5a7051e6f6c19fa4047109c3e056fb (diff)
Fixed wrongly enabling RX and TX status simultaneously on ISOCHRONOUS endpoints
Diffstat (limited to 'src')
-rw-r--r--src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
index 73fecb750..d2fefde82 100644
--- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
+++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
@@ -818,12 +818,6 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc
*pcd_ep_tx_address_ptr(USB, epnum) = pma_addr;
pcd_set_ep_tx_cnt(USB, epnum, epMaxPktSize);
pcd_clear_tx_dtog(USB, epnum);
-
- if(wType == USB_EP_ISOCHRONOUS) {
- pcd_set_ep_tx_status(USB, epnum, USB_EP_TX_DIS);
- } else {
- pcd_set_ep_tx_status(USB, epnum, USB_EP_TX_NAK);
- }
}
#if defined(ISOCHRONOUS_DOUBLEBUFFER)
if( (dir == TUSB_DIR_OUT) || (wType == USB_EP_ISOCHRONOUS) )
@@ -834,7 +828,18 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc
*pcd_ep_rx_address_ptr(USB, epnum) = pma_addr;
pcd_set_ep_rx_cnt(USB, epnum, epMaxPktSize);
pcd_clear_rx_dtog(USB, epnum);
+ }
+ /* Enable endpoint */
+ if (dir == TUSB_DIR_IN)
+ {
+ if(wType == USB_EP_ISOCHRONOUS) {
+ pcd_set_ep_tx_status(USB, epnum, USB_EP_TX_DIS);
+ } else {
+ pcd_set_ep_tx_status(USB, epnum, USB_EP_TX_NAK);
+ }
+ } else
+ {
if(wType == USB_EP_ISOCHRONOUS) {
pcd_set_ep_rx_status(USB, epnum, USB_EP_RX_DIS);
} else {