]> begriffs open source - cmsis-freertos/blob - Demo/IA32_flat_GCC_Galileo_Gen_2/FreeRTOSConfig.h
Update README.md - branch main is now the base branch
[cmsis-freertos] / Demo / IA32_flat_GCC_Galileo_Gen_2 / FreeRTOSConfig.h
1 /*
2  * FreeRTOS V202111.00
3  * Copyright (C) 2020 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 FREERTOS_CONFIG_H
29 #define FREERTOS_CONFIG_H
30
31 /*-----------------------------------------------------------
32  * Application specific definitions.
33  *
34  * These definitions should be adjusted for your particular hardware and
35  * application requirements.
36  *
37  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
38  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
39  *
40  * See http://www.freertos.org/a00110.html
41  *----------------------------------------------------------*/
42
43 /*
44  * The FreeRTOS Quark port implements a full interrupt nesting model.
45  *
46  * Interrupts that are assigned a priority at or below
47  * configMAX_API_CALL_INTERRUPT_PRIORITY can call interrupt safe API functions
48  * and will nest.
49  *
50  * Interrupts that are assigned a priority above
51  * configMAX_API_CALL_INTERRUPT_PRIORITY cannot call any FreeRTOS API functions,
52  * will nest, and will not be masked by FreeRTOS critical sections (although all
53  * interrupts are briefly masked by the hardware itself on interrupt entry).
54  *
55  * FreeRTOS functions that can be called from an interrupt are those that end in
56  * "FromISR".  FreeRTOS maintains a separate interrupt safe API to enable
57  * interrupt entry to be shorter, faster, simpler and smaller.
58  *
59  * User definable interrupt priorities range from 2 (the lowest) to 15 (the
60  * highest).
61  */
62 #define configMAX_API_CALL_INTERRUPT_PRIORITY   10
63
64 /*
65  * Interrupt entry code will switch the stack in use to a dedicated system 
66  * stack.
67  *
68  * configISR_STACK_SIZE defines the number of 32-bit values that can be stored
69  * on the system stack, and must be large enough to hold a potentially nested
70  * interrupt stack frame.
71  *
72  * Changing this parameter necessitates a complete rebuild so the assembly files
73  * also get rebuilt.
74  */
75 #define configISR_STACK_SIZE                                    350
76
77 /*
78  * If configSUPPORT_FPU is set to 1 then tasks can optionally have a floating
79  * point context (the floating point registers will be saved as part of the task
80  * context).  If configSUPPORT_FPU is set to 1 then a task must *not* use any
81  * floating point instructions until after it has called vPortTaskUsesFPU().
82  *
83  * If configSUPPORT_FPU is set to 0 then floating point instructions must never
84  * be used.
85  */
86 #define configSUPPORT_FPU                                               1
87
88 /* There are two ways of implementing interrupt handlers:
89  *
90  *      1) As standard C functions -
91  *
92  *      This method can only be used if configUSE_COMMON_INTERRUPT_ENTRY_POINT
93  *      is set to 1.  The C function is installed using
94  *      xPortRegisterCInterruptHandler().
95  *
96  *      This is the simplest of the two methods but incurs a slightly longer
97  *      interrupt entry time.
98  *
99  *      2) By using an assembly stub that wraps the handler in the FreeRTOS
100  *      portFREERTOS_INTERRUPT_ENTRY and portFREERTOS_INTERRUPT_EXIT macros.  The handler is installed
101  *      using xPortInstallInterruptHandler().
102  *
103  * This method can always be used.  It is slightly more complex than
104  * method 1 but benefits from a faster interrupt entry time.
105  *
106  * Changing this parameter necessitates a complete clean build.
107  */
108 #define configUSE_COMMON_INTERRUPT_ENTRY_POINT  1
109
110 #define configCPU_CLOCK_HZ                                              ( 400000000UL )
111 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
112 #define configMINIMAL_STACK_SIZE                                ( 125 )
113 #define configUSE_TICKLESS_IDLE                                 0
114 #define configTICK_RATE_HZ                                              ( ( TickType_t ) 1000 )
115 #define configUSE_PREEMPTION                                    1
116 #define configUSE_IDLE_HOOK                                             1
117 #define configUSE_TICK_HOOK                                             1
118 #define configMAX_PRIORITIES                                    ( 7 )
119 #define configTOTAL_HEAP_SIZE                                   ( ( size_t ) ( 55 * 1024 ) )
120 #define configMAX_TASK_NAME_LEN                                 ( 10 )
121 #define configUSE_TRACE_FACILITY                                0
122 #define configUSE_16_BIT_TICKS                                  0
123 #define configIDLE_SHOULD_YIELD                                 1
124 #define configUSE_MUTEXES                                               1
125 #define configQUEUE_REGISTRY_SIZE                               8
126 #define configCHECK_FOR_STACK_OVERFLOW                  2
127 #define configUSE_RECURSIVE_MUTEXES                             1
128 #define configUSE_MALLOC_FAILED_HOOK                    1
129 #define configUSE_APPLICATION_TASK_TAG                  0
130 #define configUSE_COUNTING_SEMAPHORES                   1
131 #define configUSE_QUEUE_SETS                                    1
132 #define configUSE_TASK_NOTIFICATIONS                    1
133
134 /* Co-routine definitions. */
135 #define configUSE_CO_ROUTINES                                   0
136 #define configMAX_CO_ROUTINE_PRIORITIES                 ( 2 )
137
138 /* Software timer definitions. */
139 #define configUSE_TIMERS                                                1
140 #define configTIMER_TASK_PRIORITY                               ( configMAX_PRIORITIES - 1 )
141 #define configTIMER_QUEUE_LENGTH                                8
142 #define configTIMER_TASK_STACK_DEPTH                    ( configMINIMAL_STACK_SIZE * 2 )
143
144 /* Set the following definitions to 1 to include the API function, or zero
145 to exclude the API function. */
146 #define INCLUDE_vTaskPrioritySet                                1
147 #define INCLUDE_uxTaskPriorityGet                               1
148 #define INCLUDE_vTaskDelete                                             1
149 #define INCLUDE_vTaskCleanUpResources                   1
150 #define INCLUDE_vTaskSuspend                                    1
151 #define INCLUDE_vTaskDelayUntil                                 1
152 #define INCLUDE_vTaskDelay                                              1
153 #define INCLUDE_xTimerPendFunctionCall                  1
154 #define INCLUDE_eTaskGetState                                   1
155
156 /* This demo makes use of one or more example stats formatting functions.  These
157 format the raw data provided by the uxTaskGetSystemState() function in to human
158 readable ASCII form.  See the notes in the implementation of vTaskList() within
159 FreeRTOS/Source/tasks.c for limitations. */
160 #define configUSE_STATS_FORMATTING_FUNCTIONS    1
161
162 /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS is not required because the time base
163 comes from the ulHighFrequencyTimerCounts variable which is incremented in a
164 high frequency timer that is already being started as part of the interrupt
165 nesting test. */
166 #define configGENERATE_RUN_TIME_STATS   0
167
168 /* The size of the global output buffer that is available for use when there
169 are multiple command interpreters running at once (for example, one on a UART
170 and one on TCP/IP).  This is done to prevent an output buffer being defined by
171 each implementation - which would waste RAM.  In this case, there is only one
172 command interpreter running. */
173 #define configCOMMAND_INT_MAX_OUTPUT_SIZE 2096
174
175 /* This file is included from assembler files - make sure C code is not included
176 in assembler files. */
177 #ifndef __ASSEMBLER__
178         void vAssertCalled( const char * pcFile, unsigned long ulLine );
179         void vConfigureTickInterrupt( void );
180         void vClearTickInterrupt( void );
181 #endif /* __ASSEMBLER__ */
182
183
184
185 /* Normal assert() semantics without relying on the provision of an assert.h
186 header file. */
187 #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ );
188
189
190
191 /****** Hardware/compiler specific settings. *******************************************/
192
193 /*
194  * The application must provide a function that configures a peripheral to
195  * create the FreeRTOS tick interrupt, then define configSETUP_TICK_INTERRUPT()
196  * in FreeRTOSConfig.h to call the function.  This file contains a function
197  * that is suitable for use on the Zynq MPU.  FreeRTOS_Tick_Handler() must
198  * be installed as the peripheral's interrupt handler.
199  */
200 #define configSETUP_TICK_INTERRUPT() vConfigureTickInterrupt()
201 #define configCLEAR_TICK_INTERRUPT() vClearTickInterrupt()
202
203
204 /* Compiler specifics. */
205 #define fabs( x )                       __builtin_fabs( ( x ) )
206
207 #endif /* FREERTOS_CONFIG_H */
208