2 FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
\r
4 This file is part of the FreeRTOS distribution.
\r
6 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
7 the terms of the GNU General Public License (version 2) as published by the
\r
8 Free Software Foundation and modified by the FreeRTOS exception.
\r
9 **NOTE** The exception to the GPL is included to allow you to distribute a
\r
10 combined work that includes FreeRTOS without being obliged to provide the
\r
11 source code for proprietary components outside of the FreeRTOS kernel.
\r
12 Alternative commercial license and support terms are also available upon
\r
13 request. See the licensing section of http://www.FreeRTOS.org for full
\r
16 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
\r
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
\r
21 You should have received a copy of the GNU General Public License along
\r
22 with FreeRTOS; if not, write to the Free Software Foundation, Inc., 59
\r
23 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
\r
26 ***************************************************************************
\r
28 * The FreeRTOS eBook and reference manual are available to purchase for a *
\r
29 * small fee. Help yourself get started quickly while also helping the *
\r
30 * FreeRTOS project! See http://www.FreeRTOS.org/Documentation for details *
\r
32 ***************************************************************************
\r
36 Please ensure to read the configuration and relevant port sections of the
\r
37 online documentation.
\r
39 http://www.FreeRTOS.org - Documentation, latest information, license and
\r
42 http://www.SafeRTOS.com - A version that is certified for use in safety
\r
45 http://www.OpenRTOS.com - Commercial support, development, porting,
\r
46 licensing and training services.
\r
52 /*-----------------------------------------------------------
\r
53 * Port specific definitions.
\r
55 * The settings in this file configure FreeRTOS correctly for the
\r
56 * given hardware and compiler.
\r
58 * These settings should not be altered.
\r
59 *-----------------------------------------------------------
\r
62 /* Type definitions. */
\r
63 #define portCHAR char
\r
64 #define portFLOAT long
\r
65 #define portDOUBLE long
\r
66 #define portLONG long
\r
67 #define portSHORT int
\r
68 #define portSTACK_TYPE unsigned portSHORT
\r
69 #define portBASE_TYPE portSHORT
\r
71 #if( configUSE_16_BIT_TICKS == 1 )
\r
72 typedef unsigned portSHORT portTickType;
\r
73 #define portMAX_DELAY ( portTickType ) 0xffff
\r
75 typedef unsigned portLONG portTickType;
\r
76 #define portMAX_DELAY ( portTickType ) 0xffffffff
\r
78 /*-----------------------------------------------------------*/
\r
80 /* Critical section management. */
\r
81 #define portENTER_CRITICAL() __asm{ pushf } \
\r
84 #define portEXIT_CRITICAL() __asm{ popf }
\r
86 #define portDISABLE_INTERRUPTS() __asm{ cli }
\r
88 #define portENABLE_INTERRUPTS() __asm{ sti }
\r
89 /*-----------------------------------------------------------*/
\r
91 /* Hardware specifics. */
\r
92 #define portNOP() __asm{ nop }
\r
93 #define portSTACK_GROWTH ( -1 )
\r
94 #define portSWITCH_INT_NUMBER 0x80
\r
95 #define portYIELD() __asm{ int portSWITCH_INT_NUMBER }
\r
96 #define portDOS_TICK_RATE ( 18.20648 )
\r
97 #define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ )
\r
98 #define portTICKS_PER_DOS_TICK ( ( unsigned portSHORT ) ( ( ( portDOUBLE ) configTICK_RATE_HZ / portDOS_TICK_RATE ) + 0.5 ) )
\r
99 #define portINITIAL_SW ( ( portSTACK_TYPE ) 0x0202 ) /* Start the tasks with interrupts enabled. */
\r
100 #define portBYTE_ALIGNMENT ( 2 )
\r
101 /*-----------------------------------------------------------*/
\r
103 /* Compiler specifics. */
\r
104 #define portINPUT_BYTE( xAddr ) inp( xAddr )
\r
105 #define portOUTPUT_BYTE( xAddr, ucValue ) outp( xAddr, ucValue )
\r
107 /*-----------------------------------------------------------*/
\r
109 /* Task function macros as described on the FreeRTOS.org WEB site. */
\r
110 #define portTASK_FUNCTION_PROTO( vTaskFunction, pvParameters ) void vTaskFunction( void *pvParameters )
\r
111 #define portTASK_FUNCTION( vTaskFunction, pvParameters ) void vTaskFunction( void *pvParameters )
\r
113 #endif /* PORTMACRO_H */
\r