diff options
| author | William D. Jones <[email protected]> | 2019-02-07 20:29:48 -0500 |
|---|---|---|
| committer | William D. Jones <[email protected]> | 2019-02-07 20:29:48 -0500 |
| commit | b819b33a68c207e7cfda5821d10a093a82093d65 (patch) | |
| tree | c0ee566c4f35f34455f0191241ba409c554648d9 /src | |
| parent | 4dc6746a686f91f4b54dc888a8eadbfbbcd26073 (diff) | |
stm32f4: Make sure interrupts enabled for non-zero endpoints.
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/stm/stm32f4/dcd_stm32f4.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/portable/stm/stm32f4/dcd_stm32f4.c b/src/portable/stm/stm32f4/dcd_stm32f4.c index 69832c539..e6e5806e4 100644 --- a/src/portable/stm/stm32f4/dcd_stm32f4.c +++ b/src/portable/stm/stm32f4/dcd_stm32f4.c @@ -206,6 +206,7 @@ void dcd_set_config (uint8_t rhport, uint8_t config_num) bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt) { (void) rhport; + USB_OTG_DeviceTypeDef * dev = DEVICE_BASE; USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE; USB_OTG_INEndpointTypeDef * in_ep = IN_EP_BASE; @@ -224,11 +225,13 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt) out_ep[epnum].DOEPCTL |= (1 << USB_OTG_DOEPCTL_USBAEP_Pos) | \ desc_edpt->bmAttributes.xfer << USB_OTG_DOEPCTL_EPTYP_Pos | \ desc_edpt->wMaxPacketSize.size << USB_OTG_DOEPCTL_MPSIZ_Pos; + dev->DAINTMSK |= (1 << (USB_OTG_DAINTMSK_OEPM_Pos + epnum)); } else { in_ep[epnum].DIEPCTL |= (1 << USB_OTG_DIEPCTL_USBAEP_Pos) | \ (epnum - 1) << USB_OTG_DIEPCTL_TXFNUM_Pos | \ desc_edpt->bmAttributes.xfer << USB_OTG_DIEPCTL_EPTYP_Pos | \ desc_edpt->wMaxPacketSize.size << USB_OTG_DIEPCTL_MPSIZ_Pos; + dev->DAINTMSK |= (1 << (USB_OTG_DAINTMSK_IEPM_Pos + epnum)); USB_OTG_FS->DIEPTXF[epnum - 1] = (40 << USB_OTG_DIEPTXF_INEPTXFD_Pos) | (epnum * 0x100); } |
