From c72473d225d66ddb9880b72bb677862ceb3e47b6 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Fri, 9 Sep 2011 10:10:01 +0000 Subject: [PATCH] Complete the RL78 demo. main.c still requires documentation in the comments at the top of the file. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1588 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/portable/IAR/RL78/ISR_Support.h | 4 ++-- Source/portable/IAR/RL78/port.c | 2 +- Source/portable/IAR/RL78/portmacro.h | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Source/portable/IAR/RL78/ISR_Support.h b/Source/portable/IAR/RL78/ISR_Support.h index c93cdaba4..4e6f70c12 100644 --- a/Source/portable/IAR/RL78/ISR_Support.h +++ b/Source/portable/IAR/RL78/ISR_Support.h @@ -69,7 +69,7 @@ portSAVE_CONTEXT MACRO PUSH AX ; Save AX Register to stack. PUSH HL -#if configMEMORY_MODE == 1 +#if __DATA_MODEL__ == __DATA_MODEL_FAR__ MOV A, CS ; Save CS register. XCH A, X MOV A, ES ; Save ES register. @@ -104,7 +104,7 @@ portRESTORE_CONTEXT MACRO MOVW usCriticalNesting, AX POP BC ; Restore the necessary general purpose registers. POP DE -#if configMEMORY_MODE == 1 +#if __DATA_MODEL__ == __DATA_MODEL_FAR__ POP AX ; Restore the ES register. MOV ES, A XCH A, X ; Restore the CS register. diff --git a/Source/portable/IAR/RL78/port.c b/Source/portable/IAR/RL78/port.c index 5a6f6c499..29bf14f08 100644 --- a/Source/portable/IAR/RL78/port.c +++ b/Source/portable/IAR/RL78/port.c @@ -117,7 +117,7 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE { unsigned long *pulLocal; - #if configMEMORY_MODE == 1 + #if __DATA_MODEL__ == __DATA_MODEL_FAR__ { /* Parameters are passed in on the stack, and written using a 32bit value hence a space is left for the second two bytes. */ diff --git a/Source/portable/IAR/RL78/portmacro.h b/Source/portable/IAR/RL78/portmacro.h index 1ab8112ec..ec873d120 100644 --- a/Source/portable/IAR/RL78/portmacro.h +++ b/Source/portable/IAR/RL78/portmacro.h @@ -83,8 +83,13 @@ extern "C" { #define portSHORT short #define portSTACK_TYPE unsigned short #define portBASE_TYPE short -#define portPOINTER_SIZE_TYPE unsigned short -#warning pointer size type will depend on data model. + +#if __DATA_MODEL__ == __DATA_MODEL_FAR__ + #define portPOINTER_SIZE_TYPE unsigned long +#else + #define portPOINTER_SIZE_TYPE unsigned short +#endif + #if (configUSE_16_BIT_TICKS==1) typedef unsigned int portTickType; -- 2.39.5