diff options
Diffstat (limited to 'src/tusb_option.h')
| -rw-r--r-- | src/tusb_option.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tusb_option.h b/src/tusb_option.h index 9fcc6c565..b59c7cb22 100644 --- a/src/tusb_option.h +++ b/src/tusb_option.h @@ -283,6 +283,7 @@ // TUP_ARCH_STRICT_ALIGN if arch cannot access unaligned memory + // ARMv7+ (M3-M7, M23-M33) can access unaligned memory #if (defined(__ARM_ARCH) && (__ARM_ARCH >= 7)) #define TUP_ARCH_STRICT_ALIGN 0 @@ -290,6 +291,16 @@ #define TUP_ARCH_STRICT_ALIGN 1 #endif +// TUP_MCU_STRICT_ALIGN will overwrite TUP_ARCH_STRICT_ALIGN. +// In case TUP_MCU_STRICT_ALIGN = 1 and TUP_ARCH_STRICT_ALIGN =0, we will not reply on compiler +// to generate unaligned access code. +// LPC_IP3511 Highspeed cannot access unaligned memory on USB_RAM +#if TUD_OPT_HIGH_SPEED && (CFG_TUSB_MCU == OPT_MCU_LPC54XXX || CFG_TUSB_MCU == OPT_MCU_LPC55XX) + #define TUP_MCU_STRICT_ALIGN 1 +#else + #define TUP_MCU_STRICT_ALIGN 0 +#endif + //------------------------------------------------------------------ // Configuration Validation //------------------------------------------------------------------ |
