summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-04-08 15:41:16 +0700
committerhathach <[email protected]>2020-04-08 15:41:16 +0700
commit880595433ce6b75428dca30b72b41d865a4b89f4 (patch)
treeeef9bf5e23ca64835db46f6c34034ee9a2899de5 /src
parent7b7a78ab2e89a8f147bbe7210923a72560b601d8 (diff)
use macro for easy enable/disable SOF
Diffstat (limited to 'src')
-rw-r--r--src/portable/espressif/esp32s2/dcd_esp32s2.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/portable/espressif/esp32s2/dcd_esp32s2.c b/src/portable/espressif/esp32s2/dcd_esp32s2.c
index 4cd682e12..8a11f57b0 100644
--- a/src/portable/espressif/esp32s2/dcd_esp32s2.c
+++ b/src/portable/espressif/esp32s2/dcd_esp32s2.c
@@ -116,7 +116,9 @@ static void bus_reset(void)
USB0.grxfsiz = 52;
USB0.gintmsk = USB_MODEMISMSK_M |
- /* USB_SOFMSK_M | */
+#if USE_SOF
+ USB_SOFMSK_M |
+#endif
USB_RXFLVIMSK_M |
USB_ERLYSUSPMSK_M |
USB_USBSUSPMSK_M |
@@ -157,8 +159,6 @@ static void enum_done_processing(void)
xfer_status[0][TUSB_DIR_OUT].max_size = 8;
xfer_status[0][TUSB_DIR_IN].max_size = 8;
}
-
-// USB0.gintmsk |= USB_SOFMSK_M; // SOF unmask
}
@@ -206,7 +206,9 @@ void dcd_init(uint8_t rhport)
USB0.gotgint = ~0U; //clear OTG ints
USB0.gintsts = ~0U; //clear pending ints
USB0.gintmsk = USB_MODEMISMSK_M |
- /*USB_SOFMSK_M |*/
+#if USE_SOF
+ USB_SOFMSK_M |
+#endif
USB_RXFLVIMSK_M |
USB_ERLYSUSPMSK_M |
USB_USBSUSPMSK_M |
@@ -698,10 +700,12 @@ static void dcd_int_handler(void)
dcd_event_bus_signal(0, DCD_EVENT_BUS_RESET, true);
}
+#if USE_SOF
if (int_status & USB_SOF_M) {
USB0.gintsts = USB_SOF_M;
dcd_event_bus_signal(0, DCD_EVENT_SOF, true); // do nothing actually
}
+#endif
if ((int_status & USB_RXFLVI_M) & (int_msk & USB_RXFLVIMSK_M)) {
ESP_EARLY_LOGV(TAG, "dcd_int_handler - rx!");