From: richardbarry Date: Sat, 6 Dec 2008 13:35:43 +0000 (+0000) Subject: Minor updates only. X-Git-Tag: V5.1.2~100 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0dce91538f3d9e095a4625185871beebc2211b4a;p=freertos Minor updates only. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@596 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/portable/IAR/AtmelSAM9XE/port.c b/Source/portable/IAR/AtmelSAM9XE/port.c index 32eef0e76..0ecb0ebfc 100644 --- a/Source/portable/IAR/AtmelSAM9XE/port.c +++ b/Source/portable/IAR/AtmelSAM9XE/port.c @@ -72,7 +72,8 @@ /*-----------------------------------------------------------*/ /* Constants required to setup the initial stack. */ -#define portINITIAL_SPSR ( ( portSTACK_TYPE ) 0x3f ) /* System mode, THUMB mode, interrupts enabled. */ +#define portINITIAL_SPSR ( ( portSTACK_TYPE ) 0x1f ) /* System mode, ARM mode, interrupts enabled. */ +#define portTHUMB_MODE_BIT ( ( portSTACK_TYPE ) 0x20 ) #define portINSTRUCTION_SIZE ( ( portSTACK_TYPE ) 4 ) /* Constants required to setup the PIT. */ @@ -158,6 +159,14 @@ portSTACK_TYPE *pxOriginalTOS; /* The status register is set for system mode, with interrupts enabled. */ *pxTopOfStack = ( portSTACK_TYPE ) portINITIAL_SPSR; + + #ifdef THUMB_INTERWORK + { + /* We want the task to start in thumb mode. */ + *pxTopOfStack |= portTHUMB_MODE_BIT; + } + #endif + pxTopOfStack--; /* Interrupt flags cannot always be stored on the stack and will