summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2008-12-06 13:35:43 +0000
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2008-12-06 13:35:43 +0000
commit9af0581ab40aaebd699b45a76bfe6d2f62052654 (patch)
treef105a6079c40bf01aa897ccc4aeef2f676243c0e /Source
parenta95a56096fa671e4251fbddc46ba5e39e7b5c4a5 (diff)
downloadfreertos-9af0581ab40aaebd699b45a76bfe6d2f62052654.tar.gz
freertos-9af0581ab40aaebd699b45a76bfe6d2f62052654.tar.bz2
freertos-9af0581ab40aaebd699b45a76bfe6d2f62052654.tar.xz
Minor updates only.
git-svn-id: https://freertos.svn.sourceforge.net/svnroot/freertos/trunk@596 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
Diffstat (limited to 'Source')
-rw-r--r--Source/portable/IAR/AtmelSAM9XE/port.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/portable/IAR/AtmelSAM9XE/port.c b/Source/portable/IAR/AtmelSAM9XE/port.c
index 32eef0e7..0ecb0ebf 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