add TUP_MCU_STRICT_ALIGN macro that manually pick bytes for lpc55 port1 that is m4 but cannot unaligned acces on usb ram

This commit is contained in:
hathach
2021-04-26 17:42:49 +07:00
parent a8e109cb3d
commit c26875e70d
3 changed files with 69 additions and 24 deletions

View File

@@ -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
//------------------------------------------------------------------