summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-04-11 12:55:45 +0700
committerhathach <[email protected]>2020-04-11 12:55:45 +0700
commitae1314f1c77bb043789d54bf8a7fa30ff7efd1e2 (patch)
tree867abbe03c81b2787d24a6fe67bdb04fa4fd1fb8 /src
parent2ff3f765db7e62201d0491093111b0d649446046 (diff)
fix incorrect setup packet
also increase usbd stack in example when debug is enabled
Diffstat (limited to 'src')
-rw-r--r--src/portable/espressif/esp32s2/dcd_esp32s2.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/portable/espressif/esp32s2/dcd_esp32s2.c b/src/portable/espressif/esp32s2/dcd_esp32s2.c
index de9ef6b6d..126f3ea20 100644
--- a/src/portable/espressif/esp32s2/dcd_esp32s2.c
+++ b/src/portable/espressif/esp32s2/dcd_esp32s2.c
@@ -331,9 +331,8 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t *buffer, uint16_t to
USB0.dtknqr4_fifoemptymsk |= (1 << epnum);
} else {
// Each complete packet for OUT xfers triggers XFRC.
- USB0.out_ep_reg[epnum].doeptsiz = USB_PKTCNT0_M |
- ((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
- USB0.out_ep_reg[epnum].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
+ USB0.out_ep_reg[epnum].doeptsiz |= USB_PKTCNT0_M | ((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
+ USB0.out_ep_reg[epnum].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
}
return true;
}
@@ -603,8 +602,7 @@ static void handle_epout_ints(void)
dcd_event_xfer_complete(0, n, xfer->queued_len, XFER_RESULT_SUCCESS, true);
} else {
// Schedule another packet to be received.
- USB0.out_ep_reg[n].doeptsiz = USB_PKTCNT0_M |
- ((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
+ USB0.out_ep_reg[n].doeptsiz |= USB_PKTCNT0_M | ((xfer->max_size & USB_XFERSIZE0_V) << USB_XFERSIZE0_S);
USB0.out_ep_reg[n].doepctl |= USB_EPENA0_M | USB_CNAK0_M;
}
}