summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-04-24 15:04:58 +0700
committerhathach <[email protected]>2021-04-24 15:04:58 +0700
commitf14daf208135802f45d9f1c4276f3655e12dd123 (patch)
treed0ca83a0c47ce1085f90a8a8fbe3fa18da783c57 /src
parentb15d126d594630e8ad75780f54a9218ccb5ad7b9 (diff)
fix unaligned access with port1 hs
Diffstat (limited to 'src')
-rw-r--r--src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c b/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
index d7efd8066..2be14084b 100644
--- a/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
+++ b/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
@@ -136,6 +136,9 @@ typedef struct
uint16_t xferred_bytes;
uint16_t nbytes;
+
+ // prevent unaligned access on Highspeed port on USB_SRAM
+ uint16_t TU_RESERVED;
}xfer_dma_t;
// Absolute max of endpoints pairs for all port
@@ -324,7 +327,7 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t* buffer, uint16_t to
uint8_t const ep_id = ep_addr2id(ep_addr);
- tu_varclr(&_dcd.dma[ep_id]);
+ tu_memclr(&_dcd.dma[ep_id], sizeof(xfer_dma_t));
_dcd.dma[ep_id].total_bytes = total_bytes;
prepare_ep_xfer(ep_id, get_buf_offset(buffer), total_bytes);