summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWilliam D. Jones <[email protected]>2019-01-23 03:31:44 -0500
committerWilliam D. Jones <[email protected]>2019-01-23 03:31:44 -0500
commit01117fb965d470f8bf7b88b71c32dcc1d81110a0 (patch)
treed81f70d56f892b97ac4d6ca6b3af535d121a2594 /src
parentb41f6105142e128bfa7641fbe001aeceb2dc5dd9 (diff)
stm32f4: Finish dcd_edpt_xfer implementation (OUT xfers not functional yet).
Diffstat (limited to 'src')
-rw-r--r--src/portable/stm/stm32f4/dcd_stm32f4.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/src/portable/stm/stm32f4/dcd_stm32f4.c b/src/portable/stm/stm32f4/dcd_stm32f4.c
index a98a0ed53..b4e34453a 100644
--- a/src/portable/stm/stm32f4/dcd_stm32f4.c
+++ b/src/portable/stm/stm32f4/dcd_stm32f4.c
@@ -233,7 +233,7 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
{
(void) rhport;
USB_OTG_DeviceTypeDef * dev = DEVICE_BASE;
- //USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE;
+ USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE;
USB_OTG_INEndpointTypeDef * in_ep = IN_EP_BASE;
uint8_t const epnum = tu_edpt_number(ep_addr);
@@ -260,35 +260,10 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
in_ep[epnum].DIEPCTL |= USB_OTG_DIEPCTL_EPENA | USB_OTG_DIEPCTL_CNAK;
dev->DIEPEMPMSK |= (1 << epnum);
} else {
-
+ out_ep[epnum].DOEPCTL |= USB_OTG_DOEPCTL_EPENA | USB_OTG_DOEPCTL_CNAK;
}
- //
- // UsbDeviceDescBank* bank = &sram_registers[epnum][dir];
- // UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
- //
- // // A setup token can occur immediately after an OUT STATUS packet so make sure we have a valid
- // // buffer for the control endpoint.
- // if (epnum == 0 && dir == 0 && buffer == NULL) {
- // buffer = _setup_packet;
- // }
- //
- // bank->ADDR.reg = (uint32_t) buffer;
- // if ( dir == TUSB_DIR_OUT )
- // {
- // bank->PCKSIZE.bit.MULTI_PACKET_SIZE = total_bytes;
- // bank->PCKSIZE.bit.BYTE_COUNT = 0;
- // ep->EPSTATUSCLR.reg |= USB_DEVICE_EPSTATUSCLR_BK0RDY;
- // ep->EPINTFLAG.reg |= USB_DEVICE_EPINTFLAG_TRFAIL0;
- // } else
- // {
- // bank->PCKSIZE.bit.MULTI_PACKET_SIZE = 0;
- // bank->PCKSIZE.bit.BYTE_COUNT = total_bytes;
- // ep->EPSTATUSSET.reg |= USB_DEVICE_EPSTATUSSET_BK1RDY;
- // ep->EPINTFLAG.reg |= USB_DEVICE_EPINTFLAG_TRFAIL1;
- // }
- // return true;
- return false;
+ return true;
}
bool dcd_edpt_stalled (uint8_t rhport, uint8_t ep_addr)