--- /dev/null
+; FreeRTOS.org V5.1.1 - Copyright (C) 2003-2008 Richard Barry.\r
+;\r
+; This file is part of the FreeRTOS.org distribution.\r
+;\r
+; FreeRTOS.org is free software; you can redistribute it and/or modify\r
+; it under the terms of the GNU General Public License as published by\r
+; the Free Software Foundation; either version 2 of the License, or\r
+; (at your option) any later version.\r
+;\r
+; FreeRTOS.org is distributed in the hope that it will be useful,\r
+; but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+; GNU General Public License for more details.\r
+;\r
+; You should have received a copy of the GNU General Public License\r
+; along with FreeRTOS.org; if not, write to the Free Software\r
+; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+;\r
+; A special exception to the GPL can be applied should you wish to distribute\r
+; a combined work that includes FreeRTOS.org, without being obliged to provide\r
+; the source code for any proprietary components. See the licensing section\r
+; of http://www.FreeRTOS.org for full details of how and when the exception\r
+; can be applied.\r
+;\r
+; ***************************************************************************\r
+; See http://www.FreeRTOS.org for documentation, latest information, license\r
+; and contact details. Please ensure to read the configuration and relevant\r
+; port sections of the online documentation.\r
+; ***************************************************************************\r
+;\r
+;------------------------------------------------------------------------------\r
+; Note: Select the correct include files for the device used by the application. \r
+#include "FreeRTOSConfig.h"\r
+;------------------------------------------------------------------------------\r
+\r
+#if __CORE__ != __78K0R__\r
+ #error "This file is only for 78K0R Devices"\r
+#endif\r
+\r
+#define CS 0xFFFFC\r
+#define ES 0xFFFFD\r
+\r
+; Functions implemented in this file\r
+;------------------------------------------------------------------------------\r
+\r
+ PUBLIC vPortYield\r
+ PUBLIC vPortStart\r
+\r
+; Functions used by scheduler\r
+;------------------------------------------------------------------------------ \r
+ EXTERN vTaskSwitchContext\r
+ EXTERN vTaskIncrementTick\r
+\r
+; Variables used by scheduler\r
+;------------------------------------------------------------------------------ \r
+ EXTERN pxCurrentTCB\r
+ EXTERN usCriticalNesting\r
+ \r
+ \r
+; Tick ISR Prototype\r
+;------------------------------------------------------------------------------\r
+ EXTERN ?CL78K0R_V2_L00 \r
+\r
+ PUBWEAK `??MD_INTTM05??INTVEC 68`\r
+ PUBLIC MD_INTTM05\r
+\r
+MD_INTTM05 SYMBOL "MD_INTTM05"\r
+`??MD_INTTM05??INTVEC 68` SYMBOL "??INTVEC 68", MD_INTTM05\r
+\r
+\r
+;------------------------------------------------------------------------------\r
+; portSAVE_CONTEXT MACRO\r
+; Saves the context of the remaining general purpose registers, CS and ES\r
+; (only in far memory mode) registers\r
+; the usCriticalNesting Value and the Stack Pointer \r
+; of the active Task onto the task stack\r
+;------------------------------------------------------------------------------\r
+portSAVE_CONTEXT MACRO \r
+\r
+ PUSH HL\r
+#if configMEMORY_MODE == 1 \r
+ MOV A, CS ; save CS register\r
+ XCH A, X\r
+ MOV A, ES ; save ES register\r
+ PUSH AX\r
+#else \r
+ MOV A, CS ; save CS register\r
+ PUSH AX\r
+#endif \r
+ PUSH DE ; save the remaining general purpose registers\r
+ PUSH BC\r
+ MOVW AX, usCriticalNesting ; save the usCriticalNesting value \r
+ PUSH AX \r
+ MOVW AX, pxCurrentTCB ; save the Stack pointer \r
+ MOVW HL, AX \r
+ MOVW AX, SP \r
+ MOVW [HL], AX \r
+ ENDM\r
+;------------------------------------------------------------------------------\r
+\r
+;------------------------------------------------------------------------------\r
+; portRESTORE_CONTEXT MACRO\r
+; Restores the context of the Stack Pointer, usCriticalNesting\r
+; value, general purpose registers and the CS and ES (only in far memory mode)\r
+; of the selected task from the task stack \r
+;------------------------------------------------------------------------------\r
+\r
+portRESTORE_CONTEXT MACRO\r
+ MOVW AX, pxCurrentTCB ; restore the Stack pointer\r
+ MOVW HL, AX\r
+ MOVW AX, [HL]\r
+ MOVW SP, AX\r
+ POP AX ; restore usCriticalNesting value\r
+ MOVW usCriticalNesting, AX\r
+ POP BC ; restore the necessary general purpose registers\r
+ POP DE\r
+#if configMEMORY_MODE == 1 \r
+ POP AX ; restore the ES register\r
+ MOV ES, A \r
+ XCH A, X ; restore the CS register\r
+ MOV CS, A\r
+#else \r
+ POP AX\r
+ MOV CS, A ; restore CS register\r
+#endif \r
+ POP HL ; restore general purpose register HL\r
+ ENDM\r
+;------------------------------------------------------------------------------\r
+\r
+;------------------------------------------------------------------------------\r
+; Port Yield function to check for a Task switch in the cooperative mode\r
+;\r
+; Input: NONE\r
+;\r
+; Call: CALL vPortYield\r
+;\r
+; Output: NONE\r
+;\r
+;------------------------------------------------------------------------------\r
+ RSEG CODE:CODE\r
+vPortYield:\r
+ PUSH PSW ; save Task PSW (Program Status Word)\r
+ DI ; global disable interrupt\r
+ PUSH AX\r
+ portSAVE_CONTEXT ; Save the context of the current task.\r
+ CALL vTaskSwitchContext ; Call the scheduler.\r
+ portRESTORE_CONTEXT ; Restore the context of whichever task the ...\r
+ POP AX\r
+ EI ; (re-)enable global interrupts\r
+ POP PSW ; restore active task PSW \r
+ RET ; ... scheduler decided should run.\r
+\r
+ \r
+;------------------------------------------------------------------------------\r
+; Restore the context of the first task that is going to run.\r
+;\r
+; Input: NONE\r
+;\r
+; Call: CALL vPortStart\r
+;\r
+; Output: NONE\r
+;\r
+;------------------------------------------------------------------------------ \r
+ RSEG CODE:CODE\r
+vPortStart:\r
+ portRESTORE_CONTEXT ; Restore the context of whichever task the ...\r
+ POP AX\r
+ EI ; enable global interrupts \r
+ POP PSW ; restore active task PSW\r
+ ret ; ... scheduler decided should run.\r
+\r
+;------------------------------------------------------------------------------\r
+; Perform the necessary steps of the Tick Count Increment and Task Switch\r
+; depending on the chosen kernel configuration \r
+;\r
+; Input: NONE\r
+;\r
+; Call: ISR \r
+;\r
+; Output: NONE\r
+;\r
+;------------------------------------------------------------------------------ \r
+#if configUSE_PREEMPTION == 1\r
+\r
+MD_INTTM05:\r
+ PUSH AX ; create temporary dummy area on stack\r
+ PUSH AX ; save AX Register to stack\r
+ MOVW AX, [SP+6] ; get PSW \r
+ MOVW [SP+2], AX ; write PSW into dummy area on the stack\r
+\r
+ portSAVE_CONTEXT ; Save the context of the current task.\r
+ call vTaskIncrementTick ; Call the timer tick function.\r
+ call vTaskSwitchContext ; Call the scheduler.\r
+ portRESTORE_CONTEXT ; Restore the context of whichever task the ...\r
+ ; ... scheduler decided should run.\r
+\r
+ MOVW AX, [SP+2] ; get PSW from stack\r
+ MOVW [SP+6], AX ; write PSW to expected location for reti\r
+ POP AX ; restore AX\r
+ MOVW [SP+0], AX ; rewrite dummy stack area to expected value\r
+ POP AX \r
+ RETI \r
+#else\r
+\r
+MD_INTTM05:\r
+ PUSH AX ; save necessary general purpose register... \r
+ PUSH HL ; ...used by the ISR\r
+ MOVW AX, CS ; save CS register\r
+ PUSH AX\r
+ CALL vTaskIncrementTick ; Call the timer tick function.\r
+ POP AX\r
+ MOVW CS, AX ; restore CS register\r
+ POP HL ; restore used general purpose registers\r
+ POP AX\r
+ RETI \r
+#endif\r
+\r
+ REQUIRE ?CL78K0R_V2_L00\r
+ COMMON INTVEC:CODE:ROOT(1) ; set ISR location to the Interrupt vector table\r
+ ORG 68\r
+`??MD_INTTM05??INTVEC 68`:\r
+ DW MD_INTTM05\r
+ ; set value for the usCriticalNesting\r
+ RSEG NEAR_ID:CONST:SORT:NOROOT(1)\r
+`?<Initializer for usCriticalNesting>`:\r
+ DW 10\r
+ \r
+;#endif\r
+\r
+ END
\ No newline at end of file
\r
A special exception to the GPL can be applied should you wish to distribute\r
a combined work that includes FreeRTOS.org, without being obliged to provide\r
- the source code for any proprietary components. See the licensing section \r
+ the source code for any proprietary components. See the licensing section\r
of http://www.FreeRTOS.org for full details of how and when the exception\r
can be applied.\r
\r
Please ensure to read the configuration and relevant port sections of the\r
online documentation.\r
\r
- http://www.FreeRTOS.org - Documentation, latest information, license and \r
+ http://www.FreeRTOS.org - Documentation, latest information, license and\r
contact details.\r
\r
- http://www.SafeRTOS.com - A version that is certified for use in safety \r
+ http://www.SafeRTOS.com - A version that is certified for use in safety\r
critical systems.\r
\r
- http://www.OpenRTOS.com - Commercial support, development, porting, \r
+ http://www.OpenRTOS.com - Commercial support, development, porting,\r
licensing and training services.\r
*/\r
\r
#endif\r
\r
/*-----------------------------------------------------------\r
- * Port specific definitions. \r
+ * Port specific definitions.\r
*\r
* The settings in this file configure FreeRTOS correctly for the\r
* given hardware and compiler.\r
*/\r
\r
/* Type definitions. */\r
- \r
+\r
#define portCHAR char\r
#define portFLOAT float\r
#define portDOUBLE double\r
#define portLONG long\r
#define portSHORT short\r
-#define portSTACK_TYPE unsigned int \r
+#define portSTACK_TYPE unsigned short\r
#define portBASE_TYPE int\r
\r
#if (configUSE_16_BIT_TICKS==1)\r
\r
static __interrupt void P0_isr (void);\r
\r
-/* --------------------------------------------------------------------------*/ \r
+/* --------------------------------------------------------------------------*/\r
/* Option-bytes and security ID */\r
-/* --------------------------------------------------------------------------*/ \r
+/* --------------------------------------------------------------------------*/\r
#define OPT_BYTES_SIZE 4\r
#define SECU_ID_SIZE 10\r
#define WATCHDOG_DISABLED 0x00\r
+++ /dev/null
-; FreeRTOS.org V5.1.1 - Copyright (C) 2003-2008 Richard Barry.\r
-;\r
-; This file is part of the FreeRTOS.org distribution.\r
-;\r
-; FreeRTOS.org is free software; you can redistribute it and/or modify\r
-; it under the terms of the GNU General Public License as published by\r
-; the Free Software Foundation; either version 2 of the License, or\r
-; (at your option) any later version.\r
-;\r
-; FreeRTOS.org is distributed in the hope that it will be useful,\r
-; but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-; GNU General Public License for more details.\r
-;\r
-; You should have received a copy of the GNU General Public License\r
-; along with FreeRTOS.org; if not, write to the Free Software\r
-; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-;\r
-; A special exception to the GPL can be applied should you wish to distribute\r
-; a combined work that includes FreeRTOS.org, without being obliged to provide\r
-; the source code for any proprietary components. See the licensing section\r
-; of http://www.FreeRTOS.org for full details of how and when the exception\r
-; can be applied.\r
-;\r
-; ***************************************************************************\r
-; See http://www.FreeRTOS.org for documentation, latest information, license\r
-; and contact details. Please ensure to read the configuration and relevant\r
-; port sections of the online documentation.\r
-; ***************************************************************************\r
-;\r
-;------------------------------------------------------------------------------\r
-; Note: Select the correct include files for the device used by the application. \r
-#include "FreeRTOSConfig.h"\r
-;------------------------------------------------------------------------------\r
-\r
-#if __CORE__ != __78K0R__\r
- #error "This file is only for 78K0R Devices"\r
-#endif\r
-\r
-#define CS 0xFFFFC\r
-#define ES 0xFFFFD\r
-\r
-; Functions implemented in this file\r
-;------------------------------------------------------------------------------\r
-\r
- PUBLIC vPortYield\r
- PUBLIC vPortStart\r
-\r
-; Functions used by scheduler\r
-;------------------------------------------------------------------------------ \r
- EXTERN vTaskSwitchContext\r
- EXTERN vTaskIncrementTick\r
-\r
-; Variables used by scheduler\r
-;------------------------------------------------------------------------------ \r
- EXTERN pxCurrentTCB\r
- EXTERN usCriticalNesting\r
- \r
- \r
-; Tick ISR Prototype\r
-;------------------------------------------------------------------------------\r
- EXTERN ?CL78K0R_V2_L00 \r
-\r
- PUBWEAK `??MD_INTTM05??INTVEC 68`\r
- PUBLIC MD_INTTM05\r
-\r
-MD_INTTM05 SYMBOL "MD_INTTM05"\r
-`??MD_INTTM05??INTVEC 68` SYMBOL "??INTVEC 68", MD_INTTM05\r
-\r
-\r
-;------------------------------------------------------------------------------\r
-; portSAVE_CONTEXT MACRO\r
-; Saves the context of the remaining general purpose registers, CS and ES\r
-; (only in far memory mode) registers\r
-; the usCriticalNesting Value and the Stack Pointer \r
-; of the active Task onto the task stack\r
-;------------------------------------------------------------------------------\r
-portSAVE_CONTEXT MACRO \r
-\r
- PUSH HL\r
-#if configMEMORY_MODE == 1 \r
- MOV A, CS ; save CS register\r
- XCH A, X\r
- MOV A, ES ; save ES register\r
- PUSH AX\r
-#else \r
- MOV A, CS ; save CS register\r
- PUSH AX\r
-#endif \r
- PUSH DE ; save the remaining general purpose registers\r
- PUSH BC\r
- MOVW AX, usCriticalNesting ; save the usCriticalNesting value \r
- PUSH AX \r
- MOVW AX, pxCurrentTCB ; save the Stack pointer \r
- MOVW HL, AX \r
- MOVW AX, SP \r
- MOVW [HL], AX \r
- ENDM\r
-;------------------------------------------------------------------------------\r
-\r
-;------------------------------------------------------------------------------\r
-; portRESTORE_CONTEXT MACRO\r
-; Restores the context of the Stack Pointer, usCriticalNesting\r
-; value, general purpose registers and the CS and ES (only in far memory mode)\r
-; of the selected task from the task stack \r
-;------------------------------------------------------------------------------\r
-\r
-portRESTORE_CONTEXT MACRO\r
- MOVW AX, pxCurrentTCB ; restore the Stack pointer\r
- MOVW HL, AX\r
- MOVW AX, [HL]\r
- MOVW SP, AX\r
- POP AX ; restore usCriticalNesting value\r
- MOVW usCriticalNesting, AX\r
- POP BC ; restore the necessary general purpose registers\r
- POP DE\r
-#if configMEMORY_MODE == 1 \r
- POP AX ; restore the ES register\r
- MOV ES, A \r
- XCH A, X ; restore the CS register\r
- MOV CS, A\r
-#else \r
- POP AX\r
- MOV CS, A ; restore CS register\r
-#endif \r
- POP HL ; restore general purpose register HL\r
- ENDM\r
-;------------------------------------------------------------------------------\r
-\r
-;------------------------------------------------------------------------------\r
-; Port Yield function to check for a Task switch in the cooperative mode\r
-;\r
-; Input: NONE\r
-;\r
-; Call: CALL vPortYield\r
-;\r
-; Output: NONE\r
-;\r
-;------------------------------------------------------------------------------\r
- RSEG CODE:CODE\r
-vPortYield:\r
- PUSH PSW ; save Task PSW (Program Status Word)\r
- DI ; global disable interrupt\r
- PUSH AX\r
- portSAVE_CONTEXT ; Save the context of the current task.\r
- CALL vTaskSwitchContext ; Call the scheduler.\r
- portRESTORE_CONTEXT ; Restore the context of whichever task the ...\r
- POP AX\r
- EI ; (re-)enable global interrupts\r
- POP PSW ; restore active task PSW \r
- RET ; ... scheduler decided should run.\r
-\r
- \r
-;------------------------------------------------------------------------------\r
-; Restore the context of the first task that is going to run.\r
-;\r
-; Input: NONE\r
-;\r
-; Call: CALL vPortStart\r
-;\r
-; Output: NONE\r
-;\r
-;------------------------------------------------------------------------------ \r
- RSEG CODE:CODE\r
-vPortStart:\r
- portRESTORE_CONTEXT ; Restore the context of whichever task the ...\r
- POP AX\r
- EI ; enable global interrupts \r
- POP PSW ; restore active task PSW\r
- ret ; ... scheduler decided should run.\r
-\r
-;------------------------------------------------------------------------------\r
-; Perform the necessary steps of the Tick Count Increment and Task Switch\r
-; depending on the chosen kernel configuration \r
-;\r
-; Input: NONE\r
-;\r
-; Call: ISR \r
-;\r
-; Output: NONE\r
-;\r
-;------------------------------------------------------------------------------ \r
-#if configUSE_PREEMPTION == 1\r
-\r
-MD_INTTM05:\r
- PUSH AX ; create temporary dummy area on stack\r
- PUSH AX ; save AX Register to stack\r
- MOVW AX, [SP+6] ; get PSW \r
- MOVW [SP+2], AX ; write PSW into dummy area on the stack\r
-\r
- portSAVE_CONTEXT ; Save the context of the current task.\r
- call vTaskIncrementTick ; Call the timer tick function.\r
- call vTaskSwitchContext ; Call the scheduler.\r
- portRESTORE_CONTEXT ; Restore the context of whichever task the ...\r
- ; ... scheduler decided should run.\r
-\r
- MOVW AX, [SP+2] ; get PSW from stack\r
- MOVW [SP+6], AX ; write PSW to expected location for reti\r
- POP AX ; restore AX\r
- MOVW [SP+0], AX ; rewrite dummy stack area to expected value\r
- POP AX \r
- RETI \r
-#else\r
-\r
-MD_INTTM05:\r
- PUSH AX ; save necessary general purpose register... \r
- PUSH HL ; ...used by the ISR\r
- MOVW AX, CS ; save CS register\r
- PUSH AX\r
- CALL vTaskIncrementTick ; Call the timer tick function.\r
- POP AX\r
- MOVW CS, AX ; restore CS register\r
- POP HL ; restore used general purpose registers\r
- POP AX\r
- RETI \r
-#endif\r
-\r
- REQUIRE ?CL78K0R_V2_L00\r
- COMMON INTVEC:CODE:ROOT(1) ; set ISR location to the Interrupt vector table\r
- ORG 68\r
-`??MD_INTTM05??INTVEC 68`:\r
- DW MD_INTTM05\r
- ; set value for the usCriticalNesting\r
- RSEG NEAR_ID:CONST:SORT:NOROOT(1)\r
-`?<Initializer for usCriticalNesting>`:\r
- DW 10\r
- \r
-;#endif\r
-\r
- END
\ No newline at end of file