--- /dev/null
+/*\r
+ FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd.\r
+ All rights reserved\r
+\r
+ VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+ ***************************************************************************\r
+ * *\r
+ * FreeRTOS provides completely free yet professionally developed, *\r
+ * robust, strictly quality controlled, supported, and cross *\r
+ * platform software that has become a de facto standard. *\r
+ * *\r
+ * Help yourself get started quickly and support the FreeRTOS *\r
+ * project by purchasing a FreeRTOS tutorial book, reference *\r
+ * manual, or both from: http://www.FreeRTOS.org/Documentation *\r
+ * *\r
+ * Thank you! *\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
+\r
+ >>! NOTE: The modification to the GPL is included to allow you to distribute\r
+ >>! a combined work that includes FreeRTOS without being obliged to provide\r
+ >>! the source code for proprietary components outside of the FreeRTOS\r
+ >>! kernel.\r
+\r
+ FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+ FOR A PARTICULAR PURPOSE. Full license text is available from the following\r
+ link: http://www.freertos.org/a00114.html\r
+\r
+ 1 tab == 4 spaces!\r
+\r
+ ***************************************************************************\r
+ * *\r
+ * Having a problem? Start by reading the FAQ "My application does *\r
+ * not run, what could be wrong?" *\r
+ * *\r
+ * http://www.FreeRTOS.org/FAQHelp.html *\r
+ * *\r
+ ***************************************************************************\r
+\r
+ http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
+ license and Real Time Engineers Ltd. contact details.\r
+\r
+ http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+ including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+ compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+ http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+ Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS\r
+ licenses offer ticketed support, indemnification and middleware.\r
+\r
+ http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+ engineered and independently SIL3 certified version for use in safety and\r
+ mission critical applications that require provable dependability.\r
+\r
+ 1 tab == 4 spaces!\r
+*/\r
+\r
+/*-----------------------------------------------------------\r
+ * Implementation of functions defined in portable.h for the RX600 port.\r
+ *----------------------------------------------------------*/\r
+\r
+/* Scheduler includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/* Library includes. */\r
+#include "string.h"\r
+\r
+/* Hardware specifics. */\r
+#include "r_cg_iodefine.h"\r
+\r
+/*-----------------------------------------------------------*/\r
+#define USE_FULL_REGISTER_INITIALISATION\r
+\r
+/* Tasks should start with interrupts enabled and in Supervisor mode, therefore\r
+PSW is set with U and I set, and PM and IPL clear. */\r
+#define portINITIAL_PSW ( ( StackType_t ) 0x00030000 )\r
+#define portINITIAL_FPSW ( ( StackType_t ) 0x00000100 )\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* The following lines are to ensure vSoftwareInterruptEntry can be referenced,\r
+ and therefore installed in the vector table, when the FreeRTOS code is built\r
+as a library. */\r
+extern BaseType_t vSoftwareInterruptEntry;\r
+const BaseType_t * p_vSoftwareInterruptEntry = &vSoftwareInterruptEntry;\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Function to start the first task executing - written in asm code as direct\r
+ * access to registers is required.\r
+ */\r
+static void prvStartFirstTask( void );\r
+\r
+/*\r
+ * Software interrupt handler. Performs the actual context switch (saving and\r
+ * restoring of registers). Written in asm code as direct register access is\r
+ * required.\r
+ */\r
+static void prvYieldHandler( void );\r
+\r
+/*\r
+ * The entry point for the software interrupt handler. This is the function\r
+ * that calls the inline asm function prvYieldHandler(). It is installed in\r
+ * the vector table, but the code that installs it is in prvYieldHandler rather\r
+ * than using a #pragma.\r
+ */\r
+void vSoftwareInterruptISR( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* This is accessed by the inline assembler functions so is file scope for\r
+convenience. */\r
+extern void *pxCurrentTCB;\r
+extern void vTaskSwitchContext( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * See header file for description.\r
+ */\r
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )\r
+{\r
+ /* R0 is not included as it is the stack pointer. */\r
+\r
+ *pxTopOfStack = 0x00;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = portINITIAL_PSW;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( StackType_t ) pxCode;\r
+\r
+ /* When debugging it can be useful if every register is set to a known\r
+ value. Otherwise code space can be saved by just setting the registers\r
+ that need to be set. */\r
+ #ifdef USE_FULL_REGISTER_INITIALISATION\r
+ {\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0xffffffff; /* r15. */\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0xeeeeeeee;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0xdddddddd;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0xcccccccc;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0xbbbbbbbb;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0xaaaaaaaa;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x99999999;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x88888888;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x77777777;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x66666666;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x55555555;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x44444444;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x33333333;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x22222222;\r
+ pxTopOfStack--;\r
+ }\r
+ #else\r
+ {\r
+ pxTopOfStack -= 15;\r
+ }\r
+ #endif\r
+\r
+ *pxTopOfStack = ( StackType_t ) pvParameters; /* R1 */\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = portINITIAL_FPSW;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x11111111; /* Accumulator 0. */\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x22222222; /* Accumulator 0. */\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x33333333; /* Accumulator 0. */\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x44444444; /* Accumulator 1. */\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x55555555; /* Accumulator 1. */\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = 0x66666666; /* Accumulator 1. */\r
+\r
+ return pxTopOfStack;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+BaseType_t xPortStartScheduler( void )\r
+{\r
+extern void vApplicationSetupTimerInterrupt( void );\r
+\r
+ /* Use pxCurrentTCB just so it does not get optimised away. */\r
+ if( pxCurrentTCB != NULL )\r
+ {\r
+ /* Call an application function to set up the timer that will generate the\r
+ tick interrupt. This way the application can decide which peripheral to\r
+ use. A demo application is provided to show a suitable example. */\r
+ vApplicationSetupTimerInterrupt();\r
+\r
+ /* Enable the software interrupt. */\r
+ _IEN( _ICU_SWINT ) = 1;\r
+\r
+ /* Ensure the software interrupt is clear. */\r
+ _IR( _ICU_SWINT ) = 0;\r
+\r
+ /* Ensure the software interrupt is set to the kernel priority. */\r
+ _IPR( _ICU_SWINT ) = configKERNEL_INTERRUPT_PRIORITY;\r
+\r
+ /* Start the first task. */\r
+ prvStartFirstTask();\r
+ }\r
+\r
+ /* Just to make sure the function is not optimised away. */\r
+ ( void ) vSoftwareInterruptISR();\r
+\r
+ /* Should not get here. */\r
+ return pdFAIL;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#pragma inline_asm prvStartFirstTask\r
+static void prvStartFirstTask( void )\r
+{\r
+ /* When starting the scheduler there is nothing that needs moving to the\r
+ interrupt stack because the function is not called from an interrupt.\r
+ Just ensure the current stack is the user stack. */\r
+ SETPSW U\r
+\r
+ /* Obtain the location of the stack associated with which ever task\r
+ pxCurrentTCB is currently pointing to. */\r
+ MOV.L #_pxCurrentTCB, R15\r
+ MOV.L [R15], R15\r
+ MOV.L [R15], R0\r
+\r
+ /* Restore the registers from the stack of the task pointed to by\r
+ pxCurrentTCB. */\r
+ POP R15\r
+ MVTACLO R15, A0 /* Accumulator low 32 bits. */\r
+ POP R15\r
+ MVTACHI R15, A0 /* Accumulator high 32 bits. */\r
+ POP R15\r
+ MVTACGU R15, A0 /* Accumulator guard. */\r
+ POP R15\r
+ MVTACLO R15, A1 /* Accumulator low 32 bits. */\r
+ POP R15\r
+ MVTACHI R15, A1 /* Accumulator high 32 bits. */\r
+ POP R15\r
+ MVTACGU R15, A1 /* Accumulator guard. */\r
+ POP R15\r
+ MVTC R15,FPSW /* Floating point status word. */\r
+ POPM R1-R15 /* R1 to R15 - R0 is not included as it is the SP. */\r
+ RTE /* This pops the remaining registers. */\r
+ NOP\r
+ NOP\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#pragma interrupt ( vTickISR( vect = _VECT( configTICK_VECTOR ), enable ) )\r
+void vTickISR( void )\r
+{\r
+ /* Increment the tick, and perform any processing the new tick value\r
+ necessitates. */\r
+ set_ipl( configMAX_SYSCALL_INTERRUPT_PRIORITY );\r
+ {\r
+ if( xTaskIncrementTick() != pdFALSE )\r
+ {\r
+ taskYIELD();\r
+ }\r
+ }\r
+ set_ipl( configKERNEL_INTERRUPT_PRIORITY );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vSoftwareInterruptISR( void )\r
+{\r
+ prvYieldHandler();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#pragma inline_asm prvYieldHandler\r
+static void prvYieldHandler( void )\r
+{\r
+ /* Re-enable interrupts. */\r
+ SETPSW I\r
+\r
+ /* Move the data that was automatically pushed onto the interrupt stack when\r
+ the interrupt occurred from the interrupt stack to the user stack.\r
+\r
+ R15 is saved before it is clobbered. */\r
+ PUSH.L R15\r
+\r
+ /* Read the user stack pointer. */\r
+ MVFC USP, R15\r
+\r
+ /* Move the address down to the data being moved. */\r
+ SUB #12, R15\r
+ MVTC R15, USP\r
+\r
+ /* Copy the data across. */\r
+ MOV.L [ R0 ], [ R15 ] ; R15\r
+ MOV.L 4[ R0 ], 4[ R15 ] ; PC\r
+ MOV.L 8[ R0 ], 8[ R15 ] ; PSW\r
+\r
+ /* Move the interrupt stack pointer to its new correct position. */\r
+ ADD #12, R0\r
+\r
+ /* All the rest of the registers are saved directly to the user stack. */\r
+ SETPSW U\r
+\r
+ /* Save the rest of the general registers (R15 has been saved already). */\r
+ PUSHM R1-R14\r
+\r
+ /* Save the FPSW and accumulator. */\r
+ MVFC FPSW, R15\r
+ PUSH.L R15\r
+ MVFACGU #0, A1, R15\r
+ PUSH.L R15\r
+ MVFACHI #0, A1, R15\r
+ PUSH.L R15\r
+ MVFACLO #0, A1, R15 ; Low order word.\r
+ PUSH.L R15\r
+ MVFACGU #0, A0, R15\r
+ PUSH.L R15\r
+ MVFACHI #0, A0, R15\r
+ PUSH.L R15\r
+ MVFACLO #0, A0, R15 ; Low order word.\r
+ PUSH.L R15\r
+\r
+ /* Save the stack pointer to the TCB. */\r
+ MOV.L #_pxCurrentTCB, R15\r
+ MOV.L [ R15 ], R15\r
+ MOV.L R0, [ R15 ]\r
+\r
+ /* Ensure the interrupt mask is set to the syscall priority while the kernel\r
+ structures are being accessed. */\r
+ MVTIPL #configMAX_SYSCALL_INTERRUPT_PRIORITY\r
+\r
+ /* Select the next task to run. */\r
+ BSR.A _vTaskSwitchContext\r
+\r
+ /* Reset the interrupt mask as no more data structure access is required. */\r
+ MVTIPL #configKERNEL_INTERRUPT_PRIORITY\r
+\r
+ /* Load the stack pointer of the task that is now selected as the Running\r
+ state task from its TCB. */\r
+ MOV.L #_pxCurrentTCB,R15\r
+ MOV.L [ R15 ], R15\r
+ MOV.L [ R15 ], R0\r
+\r
+ /* Restore the context of the new task. The PSW (Program Status Word) and\r
+ PC will be popped by the RTE instruction. */\r
+ POP R15\r
+ MVTACLO R15, A0 /* Accumulator low 32 bits. */\r
+ POP R15\r
+ MVTACHI R15, A0 /* Accumulator high 32 bits. */\r
+ POP R15\r
+ MVTACGU R15, A0 /* Accumulator guard. */\r
+ POP R15\r
+ MVTACLO R15, A1 /* Accumulator low 32 bits. */\r
+ POP R15\r
+ MVTACHI R15, A1 /* Accumulator high 32 bits. */\r
+ POP R15\r
+ MVTACGU R15, A1 /* Accumulator guard. */\r
+ POP R15\r
+ MVTC R15,FPSW\r
+ POPM R1-R15\r
+ RTE\r
+ NOP\r
+ NOP\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vPortEndScheduler( void )\r
+{\r
+ /* Not implemented in ports where there is nothing to return to.\r
+ Artificially force an assert. */\r
+ configASSERT( pxCurrentTCB == NULL );\r
+\r
+ /* The following line is just to prevent the symbol getting optimised away. */\r
+ ( void ) vTaskSwitchContext();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+\r
+\r
--- /dev/null
+;/*\r
+; FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd.\r
+; All rights reserved\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
+ .GLB _vSoftwareInterruptISR\r
+ .GLB _vSoftwareInterruptEntry\r
+\r
+ .SECTION P,CODE\r
+ \r
+_vSoftwareInterruptEntry:\r
+\r
+ BRA _vSoftwareInterruptISR\r
+\r
+ .RVECTOR 27, _vSoftwareInterruptEntry\r
+\r
+ .END\r
+\r
+\r
+\r
--- /dev/null
+/*\r
+ FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd.\r
+ All rights reserved\r
+\r
+ VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+ ***************************************************************************\r
+ * *\r
+ * FreeRTOS provides completely free yet professionally developed, *\r
+ * robust, strictly quality controlled, supported, and cross *\r
+ * platform software that has become a de facto standard. *\r
+ * *\r
+ * Help yourself get started quickly and support the FreeRTOS *\r
+ * project by purchasing a FreeRTOS tutorial book, reference *\r
+ * manual, or both from: http://www.FreeRTOS.org/Documentation *\r
+ * *\r
+ * Thank you! *\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
+\r
+ >>! NOTE: The modification to the GPL is included to allow you to distribute\r
+ >>! a combined work that includes FreeRTOS without being obliged to provide\r
+ >>! the source code for proprietary components outside of the FreeRTOS\r
+ >>! kernel.\r
+\r
+ FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+ FOR A PARTICULAR PURPOSE. Full license text is available from the following\r
+ link: http://www.freertos.org/a00114.html\r
+\r
+ 1 tab == 4 spaces!\r
+\r
+ ***************************************************************************\r
+ * *\r
+ * Having a problem? Start by reading the FAQ "My application does *\r
+ * not run, what could be wrong?" *\r
+ * *\r
+ * http://www.FreeRTOS.org/FAQHelp.html *\r
+ * *\r
+ ***************************************************************************\r
+\r
+ http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
+ license and Real Time Engineers Ltd. contact details.\r
+\r
+ http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+ including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+ compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+ http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
+ Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS\r
+ licenses offer ticketed support, indemnification and middleware.\r
+\r
+ http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+ engineered and independently SIL3 certified version for use in safety and\r
+ mission critical applications that require provable dependability.\r
+\r
+ 1 tab == 4 spaces!\r
+*/\r
+\r
+\r
+#ifndef PORTMACRO_H\r
+#define PORTMACRO_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Hardware specifics. */\r
+#include "machine.h"\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 - these are a bit legacy and not really used now, other than\r
+portSTACK_TYPE and portBASE_TYPE. */\r
+#define portCHAR char\r
+#define portFLOAT float\r
+#define portDOUBLE double\r
+#define portLONG long\r
+#define portSHORT short\r
+#define portSTACK_TYPE uint32_t\r
+#define portBASE_TYPE long\r
+\r
+typedef portSTACK_TYPE StackType_t;\r
+typedef long BaseType_t;\r
+typedef unsigned long UBaseType_t;\r
+\r
+#if( configUSE_16_BIT_TICKS == 1 )\r
+ typedef uint16_t TickType_t;\r
+ #define portMAX_DELAY ( TickType_t ) 0xffff\r
+#else\r
+ typedef uint32_t TickType_t;\r
+ #define portMAX_DELAY ( TickType_t ) 0xffffffffUL\r
+#endif\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Hardware specifics. */\r
+#define portBYTE_ALIGNMENT 8 /* Could make four, according to manual. */\r
+#define portSTACK_GROWTH -1\r
+#define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )\r
+#define portNOP() nop()\r
+\r
+\r
+#pragma inline_asm vPortYield\r
+static void vPortYield( void )\r
+{\r
+ /* Save clobbered register - may not actually be necessary if inline asm\r
+ functions are considered to use the same rules as function calls by the\r
+ compiler. */\r
+ PUSH.L R5\r
+ /* Set ITU SWINTR. */\r
+ MOV.L #553696, R5\r
+ MOV.B #1, [R5]\r
+ /* Read back to ensure the value is taken before proceeding. */\r
+ MOV.L [R5], R5\r
+ /* Restore clobbered register to its previous value. */\r
+ POP R5\r
+}\r
+#define portYIELD() vPortYield()\r
+#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) portYIELD()\r
+\r
+/* These macros should not be called directly, but through the\r
+taskENTER_CRITICAL() and taskEXIT_CRITICAL() macros. An extra check is\r
+performed if configASSERT() is defined to ensure an assertion handler does not\r
+inadvertently attempt to lower the IPL when the call to assert was triggered\r
+because the IPL value was found to be above configMAX_SYSCALL_INTERRUPT_PRIORITY\r
+when an ISR safe FreeRTOS API function was executed. ISR safe FreeRTOS API\r
+functions are those that end in FromISR. FreeRTOS maintains a separate\r
+interrupt API to ensure API function and interrupt entry is as fast and as\r
+simple as possible. */\r
+#define portENABLE_INTERRUPTS() set_ipl( ( long ) 0 )\r
+#ifdef configASSERT\r
+ #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() configASSERT( ( get_ipl() <= configMAX_SYSCALL_INTERRUPT_PRIORITY ) )\r
+ #define portDISABLE_INTERRUPTS() if( get_ipl() < configMAX_SYSCALL_INTERRUPT_PRIORITY ) set_ipl( ( long ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#else\r
+ #define portDISABLE_INTERRUPTS() set_ipl( ( long ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#endif\r
+\r
+/* Critical nesting counts are stored in the TCB. */\r
+#define portCRITICAL_NESTING_IN_TCB ( 1 )\r
+\r
+/* The critical nesting functions defined within tasks.c. */\r
+extern void vTaskEnterCritical( void );\r
+extern void vTaskExitCritical( void );\r
+#define portENTER_CRITICAL() vTaskEnterCritical()\r
+#define portEXIT_CRITICAL() vTaskExitCritical()\r
+\r
+/* As this port allows interrupt nesting... */\r
+#define portSET_INTERRUPT_MASK_FROM_ISR() ( UBaseType_t ) get_ipl(); set_ipl( ( long ) configMAX_SYSCALL_INTERRUPT_PRIORITY )\r
+#define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus ) set_ipl( ( long ) uxSavedInterruptStatus )\r
+\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
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+#endif /* PORTMACRO_H */\r
+\r