--- /dev/null
+;/*\r
+; FreeRTOS V7.0.1 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+; \r
+;\r
+; ***************************************************************************\r
+; * *\r
+; * FreeRTOS tutorial books are available in pdf and paperback. *\r
+; * Complete, revised, and edited pdf reference manuals are also *\r
+; * available. *\r
+; * *\r
+; * Purchasing FreeRTOS documentation will not only help you, by *\r
+; * ensuring you get running as quickly as possible and with an *\r
+; * in-depth knowledge of how to use FreeRTOS, it will also help *\r
+; * the FreeRTOS project to continue with its mission of providing *\r
+; * professional grade, cross platform, de facto standard solutions *\r
+; * for microcontrollers - completely free of charge! *\r
+; * *\r
+; * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *\r
+; * *\r
+; * Thank you for using FreeRTOS, and thank you for your support! *\r
+; * *\r
+; ***************************************************************************\r
+;\r
+;\r
+; This file is part of the FreeRTOS distribution.\r
+;\r
+; FreeRTOS is free software; you can redistribute it and/or modify it under\r
+; the terms of the GNU General Public License (version 2) as published by the\r
+; Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+; >>>NOTE<<< The modification to the GPL is included to allow you to\r
+; distribute a combined work that includes FreeRTOS without being obliged to\r
+; provide the source code for proprietary components outside of the FreeRTOS\r
+; kernel. FreeRTOS is distributed in the hope that it will be useful, but\r
+; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
+; more details. You should have received a copy of the GNU General Public\r
+; License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+; can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+; by writing to Richard Barry, contact details for whom are available on the\r
+; FreeRTOS WEB site.\r
+;\r
+; 1 tab == 4 spaces!\r
+;\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
+; critical systems.\r
+;\r
+; http://www.OpenRTOS.com - Commercial support, development, porting,\r
+; licensing and training services.\r
+;*/\r
+\r
+\r
+#include "FreeRTOSConfig.h"\r
+\r
+; Variables used by scheduler\r
+;------------------------------------------------------------------------------\r
+ EXTERN pxCurrentTCB\r
+ EXTERN usCriticalNesting\r
+\r
+;------------------------------------------------------------------------------\r
+; portSAVE_CONTEXT MACRO\r
+; Saves the context of the general purpose registers, CS and ES (only in far \r
+; memory mode) registers the usCriticalNesting Value and the Stack Pointer\r
+; of the active Task onto the task stack\r
+;------------------------------------------------------------------------------\r
+portSAVE_CONTEXT MACRO\r
+\r
+ PUSH AX ; Save AX Register to stack.\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 task Stack Pointer then use this to restore usCriticalNesting,\r
+; general purpose registers and the CS and ES (only in far memory mode)\r
+; of the selected task from the task stack\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
+ POP AX ; Restore AX.\r
+ ENDM\r
+;------------------------------------------------------------------------------\r
--- /dev/null
+/*\r
+ FreeRTOS V7.0.1 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+ \r
+\r
+ FreeRTOS supports many tools and architectures. V7.0.0 is sponsored by:\r
+ Atollic AB - Atollic provides professional embedded systems development\r
+ tools for C/C++ development, code analysis and test automation.\r
+ See http://www.atollic.com\r
+ \r
+\r
+ ***************************************************************************\r
+ * *\r
+ * FreeRTOS tutorial books are available in pdf and paperback. *\r
+ * Complete, revised, and edited pdf reference manuals are also *\r
+ * available. *\r
+ * *\r
+ * Purchasing FreeRTOS documentation will not only help you, by *\r
+ * ensuring you get running as quickly as possible and with an *\r
+ * in-depth knowledge of how to use FreeRTOS, it will also help *\r
+ * the FreeRTOS project to continue with its mission of providing *\r
+ * professional grade, cross platform, de facto standard solutions *\r
+ * for microcontrollers - completely free of charge! *\r
+ * *\r
+ * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *\r
+ * *\r
+ * Thank you for using FreeRTOS, and thank you for your support! *\r
+ * *\r
+ ***************************************************************************\r
+\r
+\r
+ This file is part of the FreeRTOS distribution.\r
+\r
+ FreeRTOS is free software; you can redistribute it and/or modify it under\r
+ the terms of the GNU General Public License (version 2) as published by the\r
+ Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+ >>>NOTE<<< The modification to the GPL is included to allow you to\r
+ distribute a combined work that includes FreeRTOS without being obliged to\r
+ provide the source code for proprietary components outside of the FreeRTOS\r
+ kernel. FreeRTOS is distributed in the hope that it will be useful, but\r
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
+ more details. You should have received a copy of the GNU General Public\r
+ License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+ can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+ by writing to Richard Barry, contact details for whom are available on the\r
+ FreeRTOS WEB site.\r
+\r
+ 1 tab == 4 spaces!\r
+\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
+ critical systems.\r
+\r
+ http://www.OpenRTOS.com - Commercial support, development, porting,\r
+ licensing and training services.\r
+*/\r
+\r
+/* Standard includes. */\r
+#include <stdlib.h>\r
+\r
+/* Scheduler includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* The critical nesting value is initialised to a non zero value to ensure\r
+interrupts don't accidentally become enabled before the scheduler is started. */\r
+#define portINITIAL_CRITICAL_NESTING (( unsigned short ) 10)\r
+\r
+/* Initial PSW value allocated to a newly created task.\r
+ * 1100011000000000\r
+ * ||||||||-------------- Fill byte\r
+ * |||||||--------------- Carry Flag cleared\r
+ * |||||----------------- In-service priority Flags set to low level\r
+ * ||||------------------ Register bank Select 0 Flag cleared\r
+ * |||------------------- Auxiliary Carry Flag cleared\r
+ * ||-------------------- Register bank Select 1 Flag cleared\r
+ * |--------------------- Zero Flag set\r
+ * ---------------------- Global Interrupt Flag set (enabled)\r
+ */\r
+#define portPSW (0xc6UL)\r
+\r
+/* We require the address of the pxCurrentTCB variable, but don't want to know\r
+any details of its type. */\r
+typedef void tskTCB;\r
+extern volatile tskTCB * volatile pxCurrentTCB;\r
+\r
+/* Most ports implement critical sections by placing the interrupt flags on\r
+the stack before disabling interrupts. Exiting the critical section is then\r
+simply a case of popping the flags from the stack. As 78K0 IAR does not use\r
+a frame pointer this cannot be done as modifying the stack will clobber all\r
+the stack variables. Instead each task maintains a count of the critical\r
+section nesting depth. Each time a critical section is entered the count is\r
+incremented. Each time a critical section is left the count is decremented -\r
+with interrupts only being re-enabled if the count is zero.\r
+\r
+usCriticalNesting will get set to zero when the scheduler starts, but must\r
+not be initialised to zero as this will cause problems during the startup\r
+sequence. */\r
+volatile unsigned short usCriticalNesting = portINITIAL_CRITICAL_NESTING;\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Sets up the periodic ISR used for the RTOS tick.\r
+ */\r
+static void prvSetupTimerInterrupt( void );\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Initialise the stack of a task to look exactly as if a call to\r
+ * portSAVE_CONTEXT had been called.\r
+ *\r
+ * See the header file portable.h.\r
+ */\r
+portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )\r
+{\r
+unsigned long *pulLocal;\r
+\r
+ #if configMEMORY_MODE == 1\r
+ {\r
+ /* Parameters are passed in on the stack, and written using a 32bit value\r
+ hence a space is left for the second two bytes. */\r
+ pxTopOfStack--;\r
+\r
+ /* Write in the parameter value. */\r
+ pulLocal = ( unsigned long * ) pxTopOfStack;\r
+ *pulLocal = ( unsigned long ) pvParameters;\r
+ pxTopOfStack--;\r
+\r
+ /* These values are just spacers. The return address of the function\r
+ would normally be written here. */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0xcdcd;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0xcdcd;\r
+ pxTopOfStack--;\r
+\r
+ /* The start address / PSW value is also written in as a 32bit value,\r
+ so leave a space for the second two bytes. */\r
+ pxTopOfStack--;\r
+ \r
+ /* Task function start address combined with the PSW. */\r
+ pulLocal = ( unsigned long * ) pxTopOfStack;\r
+ *pulLocal = ( ( ( unsigned long ) pxCode ) | ( portPSW << 24UL ) );\r
+ pxTopOfStack--;\r
+\r
+ /* An initial value for the AX register. */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x1111;\r
+ pxTopOfStack--;\r
+ }\r
+ #else\r
+ {\r
+ /* Task function address is written to the stack first. As it is\r
+ written as a 32bit value a space is left on the stack for the second\r
+ two bytes. */\r
+ pxTopOfStack--;\r
+\r
+ /* Task function start address combined with the PSW. */\r
+ pulLocal = ( unsigned long * ) pxTopOfStack;\r
+ *pulLocal = ( ( ( unsigned long ) pxCode ) | ( portPSW << 24UL ) );\r
+ pxTopOfStack--;\r
+\r
+ /* The parameter is passed in AX. */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) pvParameters;\r
+ pxTopOfStack--;\r
+ }\r
+ #endif\r
+\r
+ /* An initial value for the HL register. */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x2222;\r
+ pxTopOfStack--;\r
+\r
+ /* CS and ES registers. */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x0F00;\r
+ pxTopOfStack--;\r
+\r
+ /* Finally the remaining general purpose registers DE and BC */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0xDEDE;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0xBCBC;\r
+ pxTopOfStack--;\r
+\r
+ /* Finally the critical section nesting count is set to zero when the task\r
+ first starts. */\r
+ *pxTopOfStack = ( portSTACK_TYPE ) portNO_CRITICAL_SECTION_NESTING; \r
+\r
+ /* Return a pointer to the top of the stack we have generated so this can\r
+ be stored in the task control block for the task. */\r
+ return pxTopOfStack;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xPortStartScheduler( void )\r
+{\r
+ /* Setup the hardware to generate the tick. Interrupts are disabled when\r
+ this function is called. */\r
+ prvSetupTimerInterrupt();\r
+\r
+ /* Restore the context of the first task that is going to run. */\r
+ vPortStart();\r
+\r
+ /* Should not get here as the tasks are now running! */\r
+ return pdTRUE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vPortEndScheduler( void )\r
+{\r
+ /* It is unlikely that the RL78/G13 port will get stopped. If required simply\r
+ disable the tick interrupt here. */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvSetupTimerInterrupt( void )\r
+{\r
+const unsigned short usClockHz = 15000UL; /* Internal clock. */\r
+const unsigned short usCompareMatch = ( usClockHz / configTICK_RATE_HZ ) + 1UL;\r
+\r
+ /* Use the internal 15K clock. */\r
+ OSMC = 0x16U;\r
+\r
+ /* Supply the RTC clock. */\r
+ RTCEN = 1U;\r
+ \r
+ /* Disable ITMC operation. */\r
+ ITMC = 0x0000;\r
+ \r
+ /* Disable INTIT interrupt. */\r
+ ITMK = 1U;\r
+ \r
+ /* Set INTIT high priority */\r
+ ITPR1 = 1U;\r
+ ITPR0 = 1U;\r
+ \r
+ /* Set interval. */\r
+ ITMC = usCompareMatch;\r
+\r
+ /* Clear INIT interrupt. */\r
+ ITIF = 0U;\r
+ \r
+ /* Enable INTIT interrupt. */\r
+ ITMK = 0U;\r
+ \r
+ /* Enable IT operation. */\r
+ ITMC |= 0x8000;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
--- /dev/null
+;/*\r
+; FreeRTOS V7.0.1 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+; \r
+;\r
+; ***************************************************************************\r
+; * *\r
+; * FreeRTOS tutorial books are available in pdf and paperback. *\r
+; * Complete, revised, and edited pdf reference manuals are also *\r
+; * available. *\r
+; * *\r
+; * Purchasing FreeRTOS documentation will not only help you, by *\r
+; * ensuring you get running as quickly as possible and with an *\r
+; * in-depth knowledge of how to use FreeRTOS, it will also help *\r
+; * the FreeRTOS project to continue with its mission of providing *\r
+; * professional grade, cross platform, de facto standard solutions *\r
+; * for microcontrollers - completely free of charge! *\r
+; * *\r
+; * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *\r
+; * *\r
+; * Thank you for using FreeRTOS, and thank you for your support! *\r
+; * *\r
+; ***************************************************************************\r
+;\r
+;\r
+; This file is part of the FreeRTOS distribution.\r
+;\r
+; FreeRTOS is free software; you can redistribute it and/or modify it under\r
+; the terms of the GNU General Public License (version 2) as published by the\r
+; Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+; >>>NOTE<<< The modification to the GPL is included to allow you to\r
+; distribute a combined work that includes FreeRTOS without being obliged to\r
+; provide the source code for proprietary components outside of the FreeRTOS\r
+; kernel. FreeRTOS is distributed in the hope that it will be useful, but\r
+; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
+; more details. You should have received a copy of the GNU General Public\r
+; License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+; can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+; by writing to Richard Barry, contact details for whom are available on the\r
+; FreeRTOS WEB site.\r
+;\r
+; 1 tab == 4 spaces!\r
+;\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
+; critical systems.\r
+;\r
+; http://www.OpenRTOS.com - Commercial support, development, porting,\r
+; licensing and training services.\r
+;*/\r
+\r
+#include "ISR_Support.h"\r
+;------------------------------------------------------------------------------\r
+\r
+#if __CORE__ != __RL78_1__\r
+ #error "This file is only for RL78 Devices"\r
+#endif\r
+\r
+#define CS 0xFFFFC\r
+#define ES 0xFFFFD\r
+\r
+; Functions implemented in this file\r
+;------------------------------------------------------------------------------\r
+ PUBLIC vPortYield\r
+ PUBLIC vPortStart\r
+\r
+; Functions used by scheduler\r
+;------------------------------------------------------------------------------\r
+ EXTERN vTaskSwitchContext\r
+ EXTERN vTaskIncrementTick\r
+\r
+; Tick ISR Prototype\r
+;------------------------------------------------------------------------------\r
+ EXTERN ?CLRL78_V1_0_L00\r
+\r
+ PUBWEAK `??MD_INTIT??INTVEC 56`\r
+ PUBLIC MD_INTIT\r
+\r
+MD_INTIT SYMBOL "MD_INTIT"\r
+`??MD_INTIT??INTVEC 56` SYMBOL "??INTVEC 56", MD_INTIT\r
+\r
+\r
+\r
+;------------------------------------------------------------------------------\r
+; Yield to another task. Implemented as a software interrupt. The return\r
+; address and PSW will have been saved to the stack automatically before\r
+; this code runs.\r
+;\r
+; Input: NONE\r
+;\r
+; Call: CALL vPortYield\r
+;\r
+; Output: NONE\r
+;\r
+;------------------------------------------------------------------------------\r
+ RSEG CODE:CODE\r
+vPortYield:\r
+ portSAVE_CONTEXT ; Save the context of the current task.\r
+ call vTaskSwitchContext ; Call the scheduler to select the next task.\r
+ portRESTORE_CONTEXT ; Restore the context of the next task to run.\r
+ retb\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
+ reti ; An interrupt stack frame is used so the task\r
+ ; is started using a RETI instruction.\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
+\r
+MD_INTIT:\r
+\r
+ portSAVE_CONTEXT ; Save the context of the current task.\r
+ call vTaskIncrementTick ; Call the timer tick function.\r
+#if configUSE_PREEMPTION == 1\r
+ call vTaskSwitchContext ; Call the scheduler to select the next task.\r
+#endif\r
+ portRESTORE_CONTEXT ; Restore the context of the next task to run.\r
+ reti\r
+\r
+\r
+\r
+ REQUIRE ?CLRL78_V1_0_L00\r
+ COMMON INTVEC:CODE:ROOT(1) ; Set ISR location to the Interrupt vector table.\r
+ ORG 56\r
+`??MD_INTIT??INTVEC 56`:\r
+ DW MD_INTIT\r
+\r
+ COMMON INTVEC:CODE:ROOT(1) ; Set ISR location to the Interrupt vector table.\r
+ ORG 126\r
+`??vPortYield??INTVEC 126`:\r
+ DW vPortYield\r
+\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
--- /dev/null
+/*\r
+ FreeRTOS V7.0.1 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+ \r
+\r
+ FreeRTOS supports many tools and architectures. V7.0.0 is sponsored by:\r
+ Atollic AB - Atollic provides professional embedded systems development\r
+ tools for C/C++ development, code analysis and test automation.\r
+ See http://www.atollic.com\r
+ \r
+\r
+ ***************************************************************************\r
+ * *\r
+ * FreeRTOS tutorial books are available in pdf and paperback. *\r
+ * Complete, revised, and edited pdf reference manuals are also *\r
+ * available. *\r
+ * *\r
+ * Purchasing FreeRTOS documentation will not only help you, by *\r
+ * ensuring you get running as quickly as possible and with an *\r
+ * in-depth knowledge of how to use FreeRTOS, it will also help *\r
+ * the FreeRTOS project to continue with its mission of providing *\r
+ * professional grade, cross platform, de facto standard solutions *\r
+ * for microcontrollers - completely free of charge! *\r
+ * *\r
+ * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *\r
+ * *\r
+ * Thank you for using FreeRTOS, and thank you for your support! *\r
+ * *\r
+ ***************************************************************************\r
+\r
+\r
+ This file is part of the FreeRTOS distribution.\r
+\r
+ FreeRTOS is free software; you can redistribute it and/or modify it under\r
+ the terms of the GNU General Public License (version 2) as published by the\r
+ Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+ >>>NOTE<<< The modification to the GPL is included to allow you to\r
+ distribute a combined work that includes FreeRTOS without being obliged to\r
+ provide the source code for proprietary components outside of the FreeRTOS\r
+ kernel. FreeRTOS is distributed in the hope that it will be useful, but\r
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
+ more details. You should have received a copy of the GNU General Public\r
+ License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+ can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+ by writing to Richard Barry, contact details for whom are available on the\r
+ FreeRTOS WEB site.\r
+\r
+ 1 tab == 4 spaces!\r
+\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
+ critical systems.\r
+\r
+ http://www.OpenRTOS.com - Commercial support, development, porting,\r
+ licensing and training services.\r
+*/\r
+\r
+#ifndef PORTMACRO_H\r
+#define PORTMACRO_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*-----------------------------------------------------------\r
+ * Port specific definitions.\r
+ *\r
+ * The settings in this file configure FreeRTOS correctly for the\r
+ * given hardware and compiler.\r
+ *\r
+ * These settings should not be altered.\r
+ *-----------------------------------------------------------\r
+ */\r
+\r
+/* Type definitions. */\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 short\r
+#define portBASE_TYPE short\r
+#define portPOINTER_SIZE_TYPE unsigned short\r
+#warning pointer size type will depend on data model.\r
+ \r
+#if (configUSE_16_BIT_TICKS==1)\r
+ typedef unsigned int portTickType;\r
+ #define portMAX_DELAY ( portTickType ) 0xffff\r
+#else\r
+ typedef unsigned long portTickType;\r
+ #define portMAX_DELAY ( portTickType ) 0xffffffff\r
+#endif\r
+/*-----------------------------------------------------------*/ \r
+\r
+/* Interrupt control macros. */\r
+#define portDISABLE_INTERRUPTS() __asm ( "DI" )\r
+#define portENABLE_INTERRUPTS() __asm ( "EI" )\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Critical section control macros. */\r
+#define portNO_CRITICAL_SECTION_NESTING ( ( unsigned portSHORT ) 0 )\r
+\r
+#define portENTER_CRITICAL() \\r
+{ \\r
+extern volatile unsigned short usCriticalNesting; \\r
+ \\r
+ portDISABLE_INTERRUPTS(); \\r
+ \\r
+ /* Now interrupts are disabled ulCriticalNesting can be accessed */ \\r
+ /* directly. Increment ulCriticalNesting to keep a count of how many */ \\r
+ /* times portENTER_CRITICAL() has been called. */ \\r
+ usCriticalNesting++; \\r
+}\r
+\r
+#define portEXIT_CRITICAL() \\r
+{ \\r
+extern volatile unsigned short usCriticalNesting; \\r
+ \\r
+ if( usCriticalNesting > portNO_CRITICAL_SECTION_NESTING ) \\r
+ { \\r
+ /* Decrement the nesting count as we are leaving a critical section. */ \\r
+ usCriticalNesting--; \\r
+ \\r
+ /* If the nesting level has reached zero then interrupts should be */ \\r
+ /* re-enabled. */ \\r
+ if( usCriticalNesting == portNO_CRITICAL_SECTION_NESTING ) \\r
+ { \\r
+ portENABLE_INTERRUPTS(); \\r
+ } \\r
+ } \\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Task utilities. */\r
+extern void vPortStart( void );\r
+#define portYIELD() __asm( "BRK" )\r
+#define portYIELD_FROM_ISR( xHigherPriorityTaskWoken ) if( xHigherPriorityTaskWoken ) vTaskSwitchContext()\r
+#define portNOP() __asm( "NOP" )\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Hardwware specifics. */\r
+#define portBYTE_ALIGNMENT 2\r
+#define portSTACK_GROWTH ( -1 )\r
+#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) \r
+/*-----------------------------------------------------------*/\r
+\r
+/* Task function macros as described on the FreeRTOS.org WEB site. */\r
+#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )\r
+#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )\r
+\r
+/* --------------------------------------------------------------------------*/\r
+/* Option-bytes and security ID */\r
+/* --------------------------------------------------------------------------*/\r
+#define OPT_BYTES_SIZE 4\r
+#define SECU_ID_SIZE 10\r
+#define WATCHDOG_DISABLED 0x00\r
+#define LVI_ENABLED 0xFE\r
+#define LVI_DISABLED 0xFF\r
+#define RESERVED_FF 0xFF\r
+#define OCD_DISABLED 0x04\r
+#define OCD_ENABLED 0x81\r
+#define OCD_ENABLED_ERASE 0x80\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* PORTMACRO_H */\r
+\r