diff --git a/portable/XCC/Xtensa/portmacro.h b/portable/XCC/Xtensa/portmacro.h index d5b2c673044..9b22236895c 100644 --- a/portable/XCC/Xtensa/portmacro.h +++ b/portable/XCC/Xtensa/portmacro.h @@ -195,7 +195,13 @@ BaseType_t xPortRaisePrivilege( void ); /* Architecture specifics. */ #define portSTACK_GROWTH ( -1 ) #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) -#define portBYTE_ALIGNMENT 4 +#ifdef configBYTE_ALIGNMENT +#define portBYTE_ALIGNMENT configBYTE_ALIGNMENT +#elif XCHAL_DATA_WIDTH < 16 +#define portBYTE_ALIGNMENT XCHAL_DATA_WIDTH +#else +#define portBYTE_ALIGNMENT 16 +#endif #define portNOP() XT_NOP() /*-----------------------------------------------------------*/