2 * FreeRTOS Kernel V10.0.1
3 * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * http://www.FreeRTOS.org
23 * http://aws.amazon.com/freertos
31 /*-----------------------------------------------------------
32 * Port specific definitions.
34 * The settings in this file configure FreeRTOS correctly for the
35 * given hardware and compiler.
37 * These settings should not be altered.
38 *-----------------------------------------------------------
41 /* Type definitions. */
43 #define portFLOAT float
44 #define portDOUBLE long
47 #define portSTACK_TYPE uint16_t
48 #define portBASE_TYPE portSHORT
50 typedef portSTACK_TYPE StackType_t;
51 typedef short BaseType_t;
52 typedef unsigned short UBaseType_t;
54 #if( configUSE_16_BIT_TICKS == 1 )
55 typedef uint16_t TickType_t;
56 #define portMAX_DELAY ( TickType_t ) 0xffff
58 typedef uint32_t TickType_t;
59 #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
61 /*-----------------------------------------------------------*/
63 /* Critical section handling. */
64 #define portENTER_CRITICAL() __asm{ pushf } \
67 #define portEXIT_CRITICAL() __asm{ popf }
69 #define portDISABLE_INTERRUPTS() __asm{ cli }
71 #define portENABLE_INTERRUPTS() __asm{ sti }
72 /*-----------------------------------------------------------*/
74 /* Hardware specifics. */
75 #define portNOP() __asm{ nop }
76 #define portSTACK_GROWTH ( -1 )
77 #define portSWITCH_INT_NUMBER 0x80
78 #define portYIELD() __asm{ int portSWITCH_INT_NUMBER }
79 #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
80 #define portBYTE_ALIGNMENT 2
81 #define portINITIAL_SW ( ( portSTACK_TYPE ) 0x0202 ) /* Start the tasks with interrupts enabled. */
82 /*-----------------------------------------------------------*/
84 /* Compiler specifics. */
85 #define portINPUT_BYTE( xAddr ) inp( xAddr )
86 #define portOUTPUT_BYTE( xAddr, ucValue ) outp( xAddr, ucValue )
87 #define portINPUT_WORD( xAddr ) inpw( xAddr )
88 #define portOUTPUT_WORD( xAddr, usValue ) outpw( xAddr, usValue )
90 /*-----------------------------------------------------------*/
92 /* Task function macros as described on the FreeRTOS.org WEB site. */
93 #define portTASK_FUNCTION_PROTO( vTaskFunction, vParameters ) void vTaskFunction( void *pvParameters )
94 #define portTASK_FUNCTION( vTaskFunction, vParameters ) void vTaskFunction( void *pvParameters )
96 #endif /* PORTMACRO_H */