From de519dd34e91f968db0c7e2bdf9273867d2fcbf7 Mon Sep 17 00:00:00 2001 From: Richard Barry Date: Sun, 19 Oct 2008 18:52:04 +0000 Subject: [PATCH] Update to allow low power mode to be used with the RTOS. --- Source/portable/GCC/MSP430F449/port.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/portable/GCC/MSP430F449/port.c b/Source/portable/GCC/MSP430F449/port.c index b07867df7..4c92e9fdd 100644 --- a/Source/portable/GCC/MSP430F449/port.c +++ b/Source/portable/GCC/MSP430F449/port.c @@ -123,6 +123,9 @@ volatile unsigned portSHORT usCriticalNesting = portINITIAL_CRITICAL_NESTING; * loaded from the task control block. Next the value for usCriticalNesting * used by the task is retrieved from the stack - followed by the value of all * the general purpose msp430 registers. + * + * The bic instruction ensures there are no low power bits set in the status + * register that is about to be popped from the stack. */ #define portRESTORE_CONTEXT() \ asm volatile ( "mov.w pxCurrentTCB, r12 \n\t" \ @@ -141,6 +144,7 @@ volatile unsigned portSHORT usCriticalNesting = portINITIAL_CRITICAL_NESTING; "pop r6 \n\t" \ "pop r5 \n\t" \ "pop r4 \n\t" \ + "bic #(0xf0),0(r1) \n\t" \ "reti \n\t" \ ); /*-----------------------------------------------------------*/