--- /dev/null
+;/*\r
+; FreeRTOS V7.1.0 - 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
+ .if $DEFINED( __LARGE_DATA_MODEL__ )\r
+ .define "pushm.a", pushm_x\r
+ .define "popm.a", popm_x\r
+ .define "push.a", push_x\r
+ .define "pop.a", pop_x\r
+ .define "mov.a", mov_x\r
+ .else\r
+ .define "pushm.w", pushm_x\r
+ .define "popm.w", popm_x\r
+ .define "push.w", push_x\r
+ .define "pop.w", pop_x\r
+ .define "mov.w", mov_x\r
+ .endif\r
+ \r
+ .if $DEFINED( __LARGE_CODE_MODEL__ )\r
+ .define "calla", call_x\r
+ .define "reta", ret_x\r
+ .else\r
+ .define "call", call_x\r
+ .define "ret", ret_x\r
+ .endif\r
+ \r
+\r
+\r
+\r
+\r
--- /dev/null
+/*\r
+ FreeRTOS V7.1.0 - 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
+/* Scheduler includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+\r
+/*-----------------------------------------------------------\r
+ * Implementation of functions defined in portable.h for the MSP430X port.\r
+ *----------------------------------------------------------*/\r
+\r
+/* Constants required for hardware setup. The tick ISR runs off the ACLK,\r
+not the MCLK. */\r
+#define portACLK_FREQUENCY_HZ ( ( portTickType ) 32768 )\r
+#define portINITIAL_CRITICAL_NESTING ( ( unsigned short ) 10 )\r
+#define portFLAGS_INT_ENABLED ( ( portSTACK_TYPE ) 0x08 )\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
+/* Each task maintains a count of the critical section nesting depth. Each\r
+time a critical section is entered the count is incremented. Each time a\r
+critical section is exited the count is decremented - with interrupts only\r
+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
+/*\r
+ * Sets up the periodic ISR used for the RTOS tick. This uses timer 0, but\r
+ * could have alternatively used the watchdog timer or timer 1.\r
+ */\r
+void vPortSetupTimerInterrupt( 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 short *pusTopOfStack;\r
+unsigned long *pulTopOfStack, ulTemp;\r
+\r
+ /*\r
+ Place a few bytes of known values on the bottom of the stack.\r
+ This is just useful for debugging and can be included if required.\r
+\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x1111;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x2222;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x3333;\r
+ pxTopOfStack--;\r
+ */\r
+\r
+ /* Data types are need either 16 bits or 32 bits depending on the data \r
+ and code model used. */\r
+ if( sizeof( pxCode ) == sizeof( unsigned short ) )\r
+ {\r
+ pusTopOfStack = ( unsigned short * ) pxTopOfStack;\r
+ ulTemp = ( unsigned long ) pxCode;\r
+ *pusTopOfStack = ( unsigned short ) ulTemp;\r
+ }\r
+ else\r
+ {\r
+ /* Make room for a 20 bit value stored as a 32 bit value. */\r
+ pusTopOfStack = ( unsigned short * ) pxTopOfStack; \r
+ pusTopOfStack--;\r
+ pulTopOfStack = ( unsigned long * ) pusTopOfStack;\r
+ *pulTopOfStack = ( unsigned long ) pxCode;\r
+ }\r
+\r
+ pusTopOfStack--;\r
+ *pusTopOfStack = portFLAGS_INT_ENABLED;\r
+ pusTopOfStack -= ( sizeof( portSTACK_TYPE ) / 2 );\r
+ \r
+ /* From here on the size of stacked items depends on the memory model. */\r
+ pxTopOfStack = ( portSTACK_TYPE * ) pusTopOfStack;\r
+\r
+ /* Next the general purpose registers. */\r
+ #ifdef PRELOAD_REGISTER_VALUES\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0xffff;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0xeeee;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0xdddd;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) pvParameters;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0xbbbb;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0xaaaa;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x9999;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x8888;\r
+ pxTopOfStack--; \r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x5555;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x6666;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x5555;\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) 0x4444;\r
+ pxTopOfStack--;\r
+ #else\r
+ pxTopOfStack -= 3;\r
+ *pxTopOfStack = ( portSTACK_TYPE ) pvParameters;\r
+ pxTopOfStack -= 9;\r
+ #endif\r
+\r
+ /* A variable is used to keep track of the critical section nesting.\r
+ This variable has to be stored as part of the task context and is\r
+ initially set to zero. */\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
+void vPortEndScheduler( void )\r
+{\r
+ /* It is unlikely that the MSP430 port will get stopped. If required simply\r
+ disable the tick interrupt here. */\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * Hardware initialisation to generate the RTOS tick.\r
+ */\r
+void vPortSetupTimerInterrupt( void )\r
+{\r
+ vApplicationSetupTimerInterrupt();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+#pragma vector=configTICK_VECTOR\r
+interrupt void vTickISREntry( void )\r
+{\r
+extern void vPortTickISR( void );\r
+\r
+ #if configUSE_PREEMPTION == 1\r
+ extern void vPortPreemptiveTickISR( void );\r
+ vPortPreemptiveTickISR();\r
+ #else\r
+ extern void vPortCooperativeTickISR( void );\r
+ vPortCooperativeTickISR();\r
+ #endif\r
+}\r
+\r
+ \r
--- /dev/null
+;\r
+;/*\r
+; FreeRTOS V7.1.0 - 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
+; * The definition of the "register test" tasks, as described at the top of\r
+; * main.c\r
+\r
+ .include data_model.h\r
+\r
+ .global vTaskIncrementTick\r
+ .global vTaskSwitchContext\r
+ .global vPortSetupTimerInterrupt\r
+ .global pxCurrentTCB\r
+ .global usCriticalNesting\r
+\r
+ .def vPortPreemptiveTickISR\r
+ .def vPortCooperativeTickISR\r
+ .def vPortYield\r
+ .def xPortStartScheduler\r
+\r
+;-----------------------------------------------------------\r
+\r
+portSAVE_CONTEXT .macro\r
+\r
+ ;Save the remaining registers.\r
+ pushm_x #12, r15\r
+ mov.w &usCriticalNesting, r14\r
+ push_x r14\r
+ mov_x &pxCurrentTCB, r12\r
+ mov_x sp, 0( r12 )\r
+ .endm\r
+;-----------------------------------------------------------\r
+ \r
+portRESTORE_CONTEXT .macro\r
+\r
+ mov_x &pxCurrentTCB, r12\r
+ mov_x @r12, sp\r
+ pop_x r15\r
+ mov.w r15, &usCriticalNesting\r
+ popm_x #12, r15\r
+ \r
+ ;The last thing on the stack will be the status register.\r
+ ;Ensure the power down bits are clear ready for the next\r
+ ;time this power down register is popped from the stack.\r
+ bic.w #0xf0, 0( sp )\r
+ \r
+ pop.w sr\r
+ ret_x\r
+ .endm\r
+;-----------------------------------------------------------\r
+\r
+;*\r
+;* The RTOS tick ISR.\r
+;*\r
+;* If the cooperative scheduler is in use this simply increments the tick\r
+;* count.\r
+;*\r
+;* If the preemptive scheduler is in use a context switch can also occur.\r
+;*/\r
+ \r
+ .text\r
+ .align 2\r
+ \r
+vPortPreemptiveTickISR: .asmfunc\r
+ \r
+ ; The sr is not saved in portSAVE_CONTEXT() because vPortYield() needs\r
+ ;to save it manually before it gets modified (interrupts get disabled).\r
+ push.w sr\r
+ portSAVE_CONTEXT\r
+ \r
+ call_x #vTaskIncrementTick\r
+ call_x #vTaskSwitchContext\r
+ \r
+ portRESTORE_CONTEXT\r
+ .endasmfunc\r
+;-----------------------------------------------------------\r
+\r
+ .align 2\r
+ \r
+vPortCooperativeTickISR: .asmfunc\r
+ \r
+ ; The sr is not saved in portSAVE_CONTEXT() because vPortYield() needs\r
+ ;to save it manually before it gets modified (interrupts get disabled).\r
+ push.w sr\r
+ portSAVE_CONTEXT\r
+ \r
+ call_x #vTaskIncrementTick\r
+ \r
+ portRESTORE_CONTEXT\r
+ \r
+ .endasmfunc\r
+;-----------------------------------------------------------\r
+\r
+;\r
+; Manual context switch called by the portYIELD() macro.\r
+;\r
+\r
+ .align 2\r
+\r
+vPortYield: .asmfunc\r
+\r
+ ; The sr needs saving before it is modified.\r
+ push.w sr\r
+ \r
+ ; Now the SR is stacked we can disable interrupts.\r
+ dint \r
+ nop\r
+ \r
+ ; Save the context of the current task.\r
+ portSAVE_CONTEXT \r
+\r
+ ; Select the next task to run.\r
+ call_x #vTaskSwitchContext \r
+\r
+ ; Restore the context of the new task.\r
+ portRESTORE_CONTEXT\r
+ .endasmfunc\r
+;-----------------------------------------------------------\r
+\r
+\r
+;\r
+; Start off the scheduler by initialising the RTOS tick timer, then restoring\r
+; the context of the first task.\r
+;\r
+\r
+ .align 2\r
+ \r
+xPortStartScheduler: .asmfunc\r
+\r
+ ; Setup the hardware to generate the tick. Interrupts are disabled\r
+ ; when this function is called.\r
+ call_x #vPortSetupTimerInterrupt\r
+\r
+ ; Restore the context of the first task that is going to run.\r
+ portRESTORE_CONTEXT\r
+ .endasmfunc\r
+;-----------------------------------------------------------\r
+ \r
+ .end\r
+ \r
--- /dev/null
+/*\r
+ FreeRTOS V7.1.0 - 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
+#ifndef PORTMACRO_H\r
+#define PORTMACRO_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
+/* Hardware includes. */\r
+#include "msp430.h"\r
+\r
+/* Type definitions. */\r
+#define portCHAR char\r
+#define portFLOAT float\r
+#define portDOUBLE double\r
+#define portLONG long\r
+#define portSHORT int\r
+#define portBASE_TYPE portSHORT\r
+\r
+/* The stack type changes depending on the data model. */\r
+#ifdef __LARGE_DATA_MODEL__\r
+ #define portSTACK_TYPE unsigned long\r
+#else\r
+ #define portSTACK_TYPE unsigned short\r
+#endif\r
+\r
+#if( configUSE_16_BIT_TICKS == 1 )\r
+ typedef unsigned portSHORT portTickType;\r
+ #define portMAX_DELAY ( portTickType ) 0xffff\r
+#else\r
+ typedef unsigned portLONG portTickType;\r
+ #define portMAX_DELAY ( portTickType ) 0xffffffff\r
+#endif\r
+\r
+/*-----------------------------------------------------------*/ \r
+\r
+/* Interrupt control macros. */\r
+#define portDISABLE_INTERRUPTS() _disable_interrupt(); _nop()\r
+#define portENABLE_INTERRUPTS() _enable_interrupt()\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 usCriticalNesting 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
+\r
+/*\r
+ * Manual context switch called by portYIELD or taskYIELD.\r
+ */\r
+extern void vPortYield( void );\r
+#define portYIELD() vPortYield()\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Hardware specifics. */\r
+#define portBYTE_ALIGNMENT 2\r
+#define portSTACK_GROWTH ( -1 )\r
+#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) \r
+#define portNOP() __no_operation() \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
+extern void vTaskSwitchContext( void );\r
+#define portYIELD_FROM_ISR( x ) if( x ) vPortYield()\r
+ \r
+void vApplicationSetupTimerInterrupt( void );\r
+\r
+/* sizeof( int ) != sizeof( long ) so a full printf() library is required if\r
+run time stats information is to be displayed. */\r
+#define portLU_PRINTF_SPECIFIER_REQUIRED\r
+\r
+#endif /* PORTMACRO_H */\r
+\r
+++ /dev/null
-;/*\r
-; FreeRTOS V7.1.0 - 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
- .if $DEFINED( __LARGE_DATA_MODEL__ )\r
- .define "pushm.a", pushm_x\r
- .define "popm.a", popm_x\r
- .define "push.a", push_x\r
- .define "pop.a", pop_x\r
- .define "mov.a", mov_x\r
- .else\r
- .define "pushm.w", pushm_x\r
- .define "popm.w", popm_x\r
- .define "push.w", push_x\r
- .define "pop.w", pop_x\r
- .define "mov.w", mov_x\r
- .endif\r
- \r
- .if $DEFINED( __LARGE_CODE_MODEL__ )\r
- .define "calla", call_x\r
- .define "reta", ret_x\r
- .else\r
- .define "call", call_x\r
- .define "ret", ret_x\r
- .endif\r
- \r
-\r
-\r
-\r
-\r
+++ /dev/null
-/*\r
- FreeRTOS V7.1.0 - 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
-/* Scheduler includes. */\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-\r
-/*-----------------------------------------------------------\r
- * Implementation of functions defined in portable.h for the MSP430X port.\r
- *----------------------------------------------------------*/\r
-\r
-/* Constants required for hardware setup. The tick ISR runs off the ACLK,\r
-not the MCLK. */\r
-#define portACLK_FREQUENCY_HZ ( ( portTickType ) 32768 )\r
-#define portINITIAL_CRITICAL_NESTING ( ( unsigned short ) 10 )\r
-#define portFLAGS_INT_ENABLED ( ( portSTACK_TYPE ) 0x08 )\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
-/* Each task maintains a count of the critical section nesting depth. Each\r
-time a critical section is entered the count is incremented. Each time a\r
-critical section is exited the count is decremented - with interrupts only\r
-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
-/*\r
- * Sets up the periodic ISR used for the RTOS tick. This uses timer 0, but\r
- * could have alternatively used the watchdog timer or timer 1.\r
- */\r
-void vPortSetupTimerInterrupt( 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 short *pusTopOfStack;\r
-unsigned long *pulTopOfStack, ulTemp;\r
-\r
- /*\r
- Place a few bytes of known values on the bottom of the stack.\r
- This is just useful for debugging and can be included if required.\r
-\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x1111;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x2222;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x3333;\r
- pxTopOfStack--;\r
- */\r
-\r
- /* Data types are need either 16 bits or 32 bits depending on the data \r
- and code model used. */\r
- if( sizeof( pxCode ) == sizeof( unsigned short ) )\r
- {\r
- pusTopOfStack = ( unsigned short * ) pxTopOfStack;\r
- ulTemp = ( unsigned long ) pxCode;\r
- *pusTopOfStack = ( unsigned short ) ulTemp;\r
- }\r
- else\r
- {\r
- /* Make room for a 20 bit value stored as a 32 bit value. */\r
- pusTopOfStack = ( unsigned short * ) pxTopOfStack; \r
- pusTopOfStack--;\r
- pulTopOfStack = ( unsigned long * ) pusTopOfStack;\r
- *pulTopOfStack = ( unsigned long ) pxCode;\r
- }\r
-\r
- pusTopOfStack--;\r
- *pusTopOfStack = portFLAGS_INT_ENABLED;\r
- pusTopOfStack -= ( sizeof( portSTACK_TYPE ) / 2 );\r
- \r
- /* From here on the size of stacked items depends on the memory model. */\r
- pxTopOfStack = ( portSTACK_TYPE * ) pusTopOfStack;\r
-\r
- /* Next the general purpose registers. */\r
- #ifdef PRELOAD_REGISTER_VALUES\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xffff;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xeeee;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xdddd;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) pvParameters;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xbbbb;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0xaaaa;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x9999;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x8888;\r
- pxTopOfStack--; \r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x5555;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x6666;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x5555;\r
- pxTopOfStack--;\r
- *pxTopOfStack = ( portSTACK_TYPE ) 0x4444;\r
- pxTopOfStack--;\r
- #else\r
- pxTopOfStack -= 3;\r
- *pxTopOfStack = ( portSTACK_TYPE ) pvParameters;\r
- pxTopOfStack -= 9;\r
- #endif\r
-\r
- /* A variable is used to keep track of the critical section nesting.\r
- This variable has to be stored as part of the task context and is\r
- initially set to zero. */\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
-void vPortEndScheduler( void )\r
-{\r
- /* It is unlikely that the MSP430 port will get stopped. If required simply\r
- disable the tick interrupt here. */\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-/*\r
- * Hardware initialisation to generate the RTOS tick.\r
- */\r
-void vPortSetupTimerInterrupt( void )\r
-{\r
- vApplicationSetupTimerInterrupt();\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-#pragma vector=configTICK_VECTOR\r
-interrupt void vTickISREntry( void )\r
-{\r
-extern void vPortTickISR( void );\r
-\r
- #if configUSE_PREEMPTION == 1\r
- extern void vPortPreemptiveTickISR( void );\r
- vPortPreemptiveTickISR();\r
- #else\r
- extern void vPortCooperativeTickISR( void );\r
- vPortCooperativeTickISR();\r
- #endif\r
-}\r
-\r
- \r
+++ /dev/null
-;\r
-;/*\r
-; FreeRTOS V7.1.0 - 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
-; * The definition of the "register test" tasks, as described at the top of\r
-; * main.c\r
-\r
- .include data_model.h\r
-\r
- .global vTaskIncrementTick\r
- .global vTaskSwitchContext\r
- .global vPortSetupTimerInterrupt\r
- .global pxCurrentTCB\r
- .global usCriticalNesting\r
-\r
- .def vPortPreemptiveTickISR\r
- .def vPortCooperativeTickISR\r
- .def vPortYield\r
- .def xPortStartScheduler\r
-\r
-;-----------------------------------------------------------\r
-\r
-portSAVE_CONTEXT .macro\r
-\r
- ;Save the remaining registers.\r
- pushm_x #12, r15\r
- mov.w &usCriticalNesting, r14\r
- push_x r14\r
- mov_x &pxCurrentTCB, r12\r
- mov_x sp, 0( r12 )\r
- .endm\r
-;-----------------------------------------------------------\r
- \r
-portRESTORE_CONTEXT .macro\r
-\r
- mov_x &pxCurrentTCB, r12\r
- mov_x @r12, sp\r
- pop_x r15\r
- mov.w r15, &usCriticalNesting\r
- popm_x #12, r15\r
- \r
- ;The last thing on the stack will be the status register.\r
- ;Ensure the power down bits are clear ready for the next\r
- ;time this power down register is popped from the stack.\r
- bic.w #0xf0, 0( sp )\r
- \r
- pop.w sr\r
- ret_x\r
- .endm\r
-;-----------------------------------------------------------\r
-\r
-;*\r
-;* The RTOS tick ISR.\r
-;*\r
-;* If the cooperative scheduler is in use this simply increments the tick\r
-;* count.\r
-;*\r
-;* If the preemptive scheduler is in use a context switch can also occur.\r
-;*/\r
- \r
- .text\r
- .align 2\r
- \r
-vPortPreemptiveTickISR: .asmfunc\r
- \r
- ; The sr is not saved in portSAVE_CONTEXT() because vPortYield() needs\r
- ;to save it manually before it gets modified (interrupts get disabled).\r
- push.w sr\r
- portSAVE_CONTEXT\r
- \r
- call_x #vTaskIncrementTick\r
- call_x #vTaskSwitchContext\r
- \r
- portRESTORE_CONTEXT\r
- .endasmfunc\r
-;-----------------------------------------------------------\r
-\r
- .align 2\r
- \r
-vPortCooperativeTickISR: .asmfunc\r
- \r
- ; The sr is not saved in portSAVE_CONTEXT() because vPortYield() needs\r
- ;to save it manually before it gets modified (interrupts get disabled).\r
- push.w sr\r
- portSAVE_CONTEXT\r
- \r
- call_x #vTaskIncrementTick\r
- \r
- portRESTORE_CONTEXT\r
- \r
- .endasmfunc\r
-;-----------------------------------------------------------\r
-\r
-;\r
-; Manual context switch called by the portYIELD() macro.\r
-;\r
-\r
- .align 2\r
-\r
-vPortYield: .asmfunc\r
-\r
- ; The sr needs saving before it is modified.\r
- push.w sr\r
- \r
- ; Now the SR is stacked we can disable interrupts.\r
- dint \r
- nop\r
- \r
- ; Save the context of the current task.\r
- portSAVE_CONTEXT \r
-\r
- ; Select the next task to run.\r
- call_x #vTaskSwitchContext \r
-\r
- ; Restore the context of the new task.\r
- portRESTORE_CONTEXT\r
- .endasmfunc\r
-;-----------------------------------------------------------\r
-\r
-\r
-;\r
-; Start off the scheduler by initialising the RTOS tick timer, then restoring\r
-; the context of the first task.\r
-;\r
-\r
- .align 2\r
- \r
-xPortStartScheduler: .asmfunc\r
-\r
- ; Setup the hardware to generate the tick. Interrupts are disabled\r
- ; when this function is called.\r
- call_x #vPortSetupTimerInterrupt\r
-\r
- ; Restore the context of the first task that is going to run.\r
- portRESTORE_CONTEXT\r
- .endasmfunc\r
-;-----------------------------------------------------------\r
- \r
- .end\r
- \r
+++ /dev/null
-/*\r
- FreeRTOS V7.1.0 - 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
-#ifndef PORTMACRO_H\r
-#define PORTMACRO_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
-/* Hardware includes. */\r
-#include "msp430.h"\r
-\r
-/* Type definitions. */\r
-#define portCHAR char\r
-#define portFLOAT float\r
-#define portDOUBLE double\r
-#define portLONG long\r
-#define portSHORT int\r
-#define portBASE_TYPE portSHORT\r
-\r
-/* The stack type changes depending on the data model. */\r
-#ifdef __LARGE_DATA_MODEL__\r
- #define portSTACK_TYPE unsigned long\r
-#else\r
- #define portSTACK_TYPE unsigned short\r
-#endif\r
-\r
-#if( configUSE_16_BIT_TICKS == 1 )\r
- typedef unsigned portSHORT portTickType;\r
- #define portMAX_DELAY ( portTickType ) 0xffff\r
-#else\r
- typedef unsigned portLONG portTickType;\r
- #define portMAX_DELAY ( portTickType ) 0xffffffff\r
-#endif\r
-\r
-/*-----------------------------------------------------------*/ \r
-\r
-/* Interrupt control macros. */\r
-#define portDISABLE_INTERRUPTS() _disable_interrupt(); _nop()\r
-#define portENABLE_INTERRUPTS() _enable_interrupt()\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 usCriticalNesting 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
-\r
-/*\r
- * Manual context switch called by portYIELD or taskYIELD.\r
- */\r
-extern void vPortYield( void );\r
-#define portYIELD() vPortYield()\r
-/*-----------------------------------------------------------*/\r
-\r
-/* Hardware specifics. */\r
-#define portBYTE_ALIGNMENT 2\r
-#define portSTACK_GROWTH ( -1 )\r
-#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) \r
-#define portNOP() __no_operation() \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
-extern void vTaskSwitchContext( void );\r
-#define portYIELD_FROM_ISR( x ) if( x ) vPortYield()\r
- \r
-void vApplicationSetupTimerInterrupt( void );\r
-\r
-/* sizeof( int ) != sizeof( long ) so a full printf() library is required if\r
-run time stats information is to be displayed. */\r
-#define portLU_PRINTF_SPECIFIER_REQUIRED\r
-\r
-#endif /* PORTMACRO_H */\r
-\r