From 97bee57daadee50159052bf8bf44a29d3200d6c4 Mon Sep 17 00:00:00 2001 From: Richard Barry Date: Tue, 12 Feb 2008 21:50:24 +0000 Subject: [PATCH] Work in progress still. --- Source/portable/Softune/MB96340/port.c | 19 ++++++++----------- Source/portable/Softune/MB96340/portmacro.h | 5 +++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Source/portable/Softune/MB96340/port.c b/Source/portable/Softune/MB96340/port.c index bece34f9b..6ab130b80 100644 --- a/Source/portable/Softune/MB96340/port.c +++ b/Source/portable/Softune/MB96340/port.c @@ -48,14 +48,6 @@ * Implementation of functions defined in portable.h for the 16FX port. *----------------------------------------------------------*/ -/* - * The below define should be same as the option selected by the Memory - * Model (Project->Setup Project->C Compiler->Catagory->Target Depend ) - */ -#define configMEMMODEL portMEDIUM - -/*-----------------------------------------------------------*/ - /* * Get current value of DPR and ADB registers */ @@ -77,7 +69,7 @@ portCHAR xGet_RP( void ); */ static void prvSetupRLT0Interrupt( void ); -/*-----------------------------------------------------------*/ +/*-----------------------------------------------------------*/ /* * We require the address of the pxCurrentTCB variable, but don't want to know @@ -87,7 +79,7 @@ typedef void tskTCB; extern volatile tskTCB * volatile pxCurrentTCB; /* Constants required to handle critical sections. */ -#define portNO_CRITICAL_NESTING ( ( unsigned portBASE_TYPE ) 0x1234 ) +#define portNO_CRITICAL_NESTING ( ( unsigned portBASE_TYPE ) 0 ) volatile unsigned portBASE_TYPE uxCriticalNesting = 9999UL; /*-----------------------------------------------------------*/ @@ -130,6 +122,11 @@ volatile unsigned portBASE_TYPE uxCriticalNesting = 9999UL; __asm(" AND CCR,#H'DF "); \ __asm(" PUSHW A "); \ __asm(" PUSHW (RW0,RW1,RW2,RW3,RW4,RW5,RW6,RW7) "); \ + \ + /* Save the critical nesting count to the stack. */ \ + __asm(" MOVW RW0, _uxCriticalNesting "); \ + __asm(" PUSHW (RW0) "); \ + \ __asm(" MOVW A, _pxCurrentTCB "); \ __asm(" MOVW A, SP "); \ __asm(" SWAPW "); \ @@ -153,7 +150,7 @@ volatile unsigned portBASE_TYPE uxCriticalNesting = 9999UL; __asm(" AND CCR,#H'DF "); \ __asm(" MOVW SP, A "); \ \ - /* Load the saves uxCriticalNesting value into RW0. */ \ + /* Load the saved uxCriticalNesting value into RW0. */ \ __asm(" POPW (RW0) "); \ \ /* Save the loaded value into the uxCriticalNesting variable. */ \ diff --git a/Source/portable/Softune/MB96340/portmacro.h b/Source/portable/Softune/MB96340/portmacro.h index 09f1df19a..cd7b60fa2 100644 --- a/Source/portable/Softune/MB96340/portmacro.h +++ b/Source/portable/Softune/MB96340/portmacro.h @@ -47,6 +47,11 @@ #include "mb96348hs.h" #include +#define portSMALL 0 +#define portMEDIUM 1 +#define portCOMPACT 2 +#define portLARGE 3 + /*----------------------------------------------------------- * Port specific definitions.