summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorWilliam D. Jones <[email protected]>2019-02-14 23:41:16 -0500
committerWilliam D. Jones <[email protected]>2019-02-14 23:41:16 -0500
commit5a1c5cf0b7eadf11bdf98e2f11c8d065049aeb51 (patch)
treebf661f207bbd2138330a2658ad8af064a16b2c42 /src/portable
parent5a34a9de69e36c2417ab1110f334b9f20704d868 (diff)
stm32f4: Clarify comments and disable OTGINT; fixes stack reset on
cable disconnect, and we don't use OTG right now.
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/stm/stm32f4/dcd_stm32f4.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/portable/stm/stm32f4/dcd_stm32f4.c b/src/portable/stm/stm32f4/dcd_stm32f4.c
index 3d4e06b29..d93fc8c9e 100644
--- a/src/portable/stm/stm32f4/dcd_stm32f4.c
+++ b/src/portable/stm/stm32f4/dcd_stm32f4.c
@@ -142,8 +142,10 @@ bool dcd_init (uint8_t rhport)
USB_OTG_GINTSTS_USBRST | USB_OTG_GINTSTS_ENUMDNE | \
USB_OTG_GINTSTS_ESUSP | USB_OTG_GINTSTS_USBSUSP | USB_OTG_GINTSTS_SOF;
- // Required as part of core initialization.
- USB_OTG_FS->GINTMSK |= USB_OTG_GINTMSK_OTGINT | USB_OTG_GINTMSK_MMISM;
+ // Required as part of core initialization. Disable OTGINT as we don't use
+ // it right now. TODO: How should mode mismatch be handled? It will cause
+ // the core to stop working/require reset.
+ USB_OTG_FS->GINTMSK |= /* USB_OTG_GINTMSK_OTGINT | */ USB_OTG_GINTMSK_MMISM;
USB_OTG_DeviceTypeDef * dev = ((USB_OTG_DeviceTypeDef *) (USB_OTG_FS_PERIPH_BASE + USB_OTG_DEVICE_BASE));
@@ -577,7 +579,7 @@ void OTG_FS_IRQHandler(void) {
_setup_packet[1] = (* rx_fifo);
}
break;
- default: // Invalid, do something here?
+ default: // Invalid, do something here, like breakpoint?
break;
}