diff --git a/Source/portable/RVDS/ARM7_LPC21xx/port.c b/Source/portable/RVDS/ARM7_LPC21xx/port.c index 8b6d462ec5..500cee1a84 100644 --- a/Source/portable/RVDS/ARM7_LPC21xx/port.c +++ b/Source/portable/RVDS/ARM7_LPC21xx/port.c @@ -153,12 +153,11 @@ portSTACK_TYPE *pxOriginalTOS; system mode, with interrupts enabled. */ *pxTopOfStack = ( portSTACK_TYPE ) portINITIAL_SPSR; - #ifdef KEIL_THUMB_INTERWORK - { + if( ( ( unsigned long ) pxCode & 0x01UL ) != 0x00UL ) + { /* We want the task to start in thumb mode. */ *pxTopOfStack |= portTHUMB_MODE_BIT; } - #endif pxTopOfStack--; diff --git a/Source/portable/RVDS/ARM7_LPC21xx/portmacro.h b/Source/portable/RVDS/ARM7_LPC21xx/portmacro.h index e978bcb8fb..4b2b0f9e0f 100644 --- a/Source/portable/RVDS/ARM7_LPC21xx/portmacro.h +++ b/Source/portable/RVDS/ARM7_LPC21xx/portmacro.h @@ -84,7 +84,7 @@ extern "C" { /* Hardware specifics. */ #define portSTACK_GROWTH ( -1 ) #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) -#define portBYTE_ALIGNMENT 4 +#define portBYTE_ALIGNMENT 8 /*-----------------------------------------------------------*/ /* Task utilities. */ diff --git a/Source/portable/RVDS/ARM_CM3/portmacro.h b/Source/portable/RVDS/ARM_CM3/portmacro.h index a8010ed07e..c0dd260988 100644 --- a/Source/portable/RVDS/ARM_CM3/portmacro.h +++ b/Source/portable/RVDS/ARM_CM3/portmacro.h @@ -84,7 +84,7 @@ extern "C" { /* Architecture specifics. */ #define portSTACK_GROWTH ( -1 ) #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) -#define portBYTE_ALIGNMENT 4 +#define portBYTE_ALIGNMENT 8 /*-----------------------------------------------------------*/