]> begriffs open source - cmsis-freertos/blob - Source/portable/BCC/16BitDOS/Flsh186/prtmacro.h
Sources updated to FreeRTOS 10.2.0
[cmsis-freertos] / Source / portable / BCC / 16BitDOS / Flsh186 / prtmacro.h
1 /*
2  * FreeRTOS Kernel V10.2.0
3  * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
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:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
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.
21  *
22  * http://www.FreeRTOS.org
23  * http://aws.amazon.com/freertos
24  *
25  * 1 tab == 4 spaces!
26  */
27
28 #ifndef PORTMACRO_H
29 #define PORTMACRO_H
30
31 /*-----------------------------------------------------------
32  * Port specific definitions.
33  *
34  * The settings in this file configure FreeRTOS correctly for the
35  * given hardware and compiler.
36  *
37  * These settings should not be altered.
38  *-----------------------------------------------------------
39  */
40
41 /* Type definitions. */
42 #define portCHAR                char
43 #define portFLOAT               float
44 #define portDOUBLE              long
45 #define portLONG                long
46 #define portSHORT               int
47 #define portSTACK_TYPE  uint16_t
48 #define portBASE_TYPE   portSHORT
49
50 typedef portSTACK_TYPE StackType_t;
51 typedef short BaseType_t;
52 typedef unsigned short UBaseType_t;
53
54 #if( configUSE_16_BIT_TICKS == 1 )
55         typedef uint16_t TickType_t;
56         #define portMAX_DELAY ( TickType_t ) 0xffff
57 #else
58         typedef uint32_t TickType_t;
59         #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
60 #endif
61 /*-----------------------------------------------------------*/
62
63 /* Critical section handling. */
64 #define portENTER_CRITICAL()                    __asm{ pushf }  \
65                                                                                 __asm{ cli       }      \
66
67 #define portEXIT_CRITICAL()                             __asm{ popf }
68
69 #define portDISABLE_INTERRUPTS()                __asm{ cli }
70
71 #define portENABLE_INTERRUPTS()                 __asm{ sti }
72 /*-----------------------------------------------------------*/
73
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 /*-----------------------------------------------------------*/
83
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 )
89
90 /*-----------------------------------------------------------*/
91
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 )
95
96 #endif /* PORTMACRO_H */
97