2 * FreeRTOS Kernel <DEVELOPMENT BRANCH>
3 * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * SPDX-License-Identifier: MIT
7 * Permission is hereby granted, free of charge, to any person obtaining a copy of
8 * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 * https://www.FreeRTOS.org
25 * https://github.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 double
47 #define portSTACK_TYPE uint8_t
48 #define portBASE_TYPE char
50 #define portSTACK_GROWTH ( -1 )
51 #define portBYTE_ALIGNMENT 4
52 #define portPOINTER_SIZE_TYPE size_t
53 typedef portSTACK_TYPE StackType_t;
54 typedef signed char BaseType_t;
55 typedef unsigned char UBaseType_t;
57 #if ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_16_BITS )
58 typedef uint16_t TickType_t;
59 #define portMAX_DELAY ( TickType_t ) 0xffff
60 #elif ( configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_32_BITS )
61 typedef uint32_t TickType_t;
62 #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
64 #error configTICK_TYPE_WIDTH_IN_BITS set to unsupported tick type width.
67 /* Architecture specific optimisations. */
68 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
69 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
72 #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
74 /* Check the configuration. */
75 #if ( configMAX_PRIORITIES > 32 )
76 #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
79 /* Store/clear the ready priorities in a bit map. */
80 #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
81 #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
83 /*-----------------------------------------------------------*/
85 #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) \
91 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
93 #define portDISABLE_INTERRUPTS() \
94 { /* Disable the interrupts */ \
96 #define portENABLE_INTERRUPTS() \
97 { /* Enable the interrupts */ \
100 #define portENTER_CRITICAL() \
101 { /* preserve current interrupt state and then disable interrupts */ \
103 #define portEXIT_CRITICAL() \
104 { /* restore previously preserved interrupt state */ \
107 extern void vPortYield( void );
108 #define portYIELD() vPortYield()
110 /* Task function macros as described on the FreeRTOS.org WEB site. */
111 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void * pvParameters )
112 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void * pvParameters )
114 #endif /* PORTMACRO_H */