diff options
| author | hathach <[email protected]> | 2020-05-17 14:24:15 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-05-17 14:24:15 +0700 |
| commit | 1a8ce043ed937012454e5b79396455f9c5568a68 (patch) | |
| tree | 517f9a593b69c11f09aeef46af1ee202d3475996 /src | |
| parent | 17869f0999d275ec6a8830c95999998f0f84fd03 (diff) | |
enable -Wcast-align
suppress vendor sdk driver at board.mk
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/tusb_common.h | 2 | ||||
| -rw-r--r-- | src/portable/nxp/transdimension/dcd_transdimension.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index 2389bfcd4..f144cda73 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -106,7 +106,7 @@ static inline uint16_t tu_max16 (uint16_t x, uint16_t y) { return (x > y) ? x : static inline uint32_t tu_max32 (uint32_t x, uint32_t y) { return (x > y) ? x : y; } // Align -static inline uint32_t tu_align_n(uint32_t value, uint32_t alignment) +static inline uint32_t tu_align(uint32_t value, uint32_t alignment) { return value & ((uint32_t) ~(alignment-1)); } diff --git a/src/portable/nxp/transdimension/dcd_transdimension.c b/src/portable/nxp/transdimension/dcd_transdimension.c index fcedc1c0c..7baf43e23 100644 --- a/src/portable/nxp/transdimension/dcd_transdimension.c +++ b/src/portable/nxp/transdimension/dcd_transdimension.c @@ -273,7 +273,8 @@ typedef struct { dcd_qtd_t qtd[QHD_MAX] TU_ATTR_ALIGNED(32); // for portability, TinyUSB only queue 1 TD for each Qhd }dcd_data_t; -static dcd_data_t _dcd_data CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(2048); +CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(2048) +static dcd_data_t _dcd_data; //--------------------------------------------------------------------+ // CONTROLLER API @@ -478,7 +479,8 @@ bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t t // Force the CPU to flush the buffer. We increase the size by 32 because the call aligns the // address to 32-byte boundaries. - CleanInvalidateDCache_by_Addr((uint32_t*) buffer, total_bytes + 31); + // void* cast to suppress cast-align warning, buffer must be + CleanInvalidateDCache_by_Addr((uint32_t*) tu_align((uint32_t) buffer, 4), total_bytes + 31); //------------- Prepare qtd -------------// qtd_init(p_qtd, buffer, total_bytes); |
