/*-----------------------------------------------------------*/\r
\r
/* Constants required to setup the initial stack. */\r
-#define portINITIAL_SPSR ( ( portSTACK_TYPE ) 0x3f ) /* System mode, THUMB mode, interrupts enabled. */\r
+#define portINITIAL_SPSR ( ( portSTACK_TYPE ) 0x1f ) /* System mode, ARM mode, interrupts enabled. */\r
+#define portTHUMB_MODE_BIT ( ( portSTACK_TYPE ) 0x20 )\r
#define portINSTRUCTION_SIZE ( ( portSTACK_TYPE ) 4 )\r
\r
/* Constants required to setup the PIT. */\r
\r
/* The status register is set for system mode, with interrupts enabled. */\r
*pxTopOfStack = ( portSTACK_TYPE ) portINITIAL_SPSR;\r
+ \r
+ #ifdef THUMB_INTERWORK\r
+ {\r
+ /* We want the task to start in thumb mode. */\r
+ *pxTopOfStack |= portTHUMB_MODE_BIT;\r
+ }\r
+ #endif\r
+ \r
pxTopOfStack--;\r
\r
/* Interrupt flags cannot always be stored on the stack and will\r