]> begriffs open source - cmsis-freertos/blob - CMSIS/RTOS2/FreeRTOS/Config/ARMCA/FreeRTOSConfig.h
Update cmsis_os2.c
[cmsis-freertos] / CMSIS / RTOS2 / FreeRTOS / Config / ARMCA / FreeRTOSConfig.h
1 /*
2     FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
3     All rights reserved
4
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6
7     This file is part of the FreeRTOS distribution.
8
9     FreeRTOS is free software; you can redistribute it and/or modify it under
10     the terms of the GNU General Public License (version 2) as published by the
11     Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12
13     ***************************************************************************
14     >>!   NOTE: The modification to the GPL is included to allow you to     !<<
15     >>!   distribute a combined work that includes FreeRTOS without being   !<<
16     >>!   obliged to provide the source code for proprietary components     !<<
17     >>!   outside of the FreeRTOS kernel.                                   !<<
18     ***************************************************************************
19
20     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22     FOR A PARTICULAR PURPOSE.  Full license text is available on the following
23     link: http://www.freertos.org/a00114.html
24
25     ***************************************************************************
26      *                                                                       *
27      *    FreeRTOS provides completely free yet professionally developed,    *
28      *    robust, strictly quality controlled, supported, and cross          *
29      *    platform software that is more than just the market leader, it     *
30      *    is the industry's de facto standard.                               *
31      *                                                                       *
32      *    Help yourself get started quickly while simultaneously helping     *
33      *    to support the FreeRTOS project by purchasing a FreeRTOS           *
34      *    tutorial book, reference manual, or both:                          *
35      *    http://www.FreeRTOS.org/Documentation                              *
36      *                                                                       *
37     ***************************************************************************
38
39     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading
40     the FAQ page "My application does not run, what could be wrong?".  Have you
41     defined configASSERT()?
42
43     http://www.FreeRTOS.org/support - In return for receiving this top quality
44     embedded software for free we request you assist our global community by
45     participating in the support forum.
46
47     http://www.FreeRTOS.org/training - Investing in training allows your team to
48     be as productive as possible as early as possible.  Now you can receive
49     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50     Ltd, and the world's leading authority on the world's leading RTOS.
51
52     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53     including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54     compatible FAT file system, and our tiny thread aware UDP/IP stack.
55
56     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58
59     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS
61     licenses offer ticketed support, indemnification and commercial middleware.
62
63     http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64     engineered and independently SIL3 certified version for use in safety and
65     mission critical applications that require provable dependability.
66
67     1 tab == 4 spaces!
68 */
69
70 #ifndef FREERTOS_CONFIG_H
71 #define FREERTOS_CONFIG_H
72
73 /*-----------------------------------------------------------
74  * Application specific definitions.
75  *
76  * These definitions should be adjusted for your particular hardware and
77  * application requirements.
78  *
79  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
80  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
81  *
82  * See http://www.freertos.org/a00110.html.
83  *----------------------------------------------------------*/
84
85 #include <stdint.h>
86
87 #include "RTE_Components.h"
88 #include CMSIS_device_header
89
90 #include "os_tick.h"
91
92
93 //-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
94
95 //  <o>Minimal stack size [words] <0-65535>
96 //  <i> Stack for idle task and default task stack in words.
97 //  <i> Default: 128
98 #define configMINIMAL_STACK_SIZE                ((uint16_t)(128))
99
100 //  <o>Total heap size [bytes] <0-0xFFFFFFFF>
101 //  <i> Heap memory size in bytes.
102 //  <i> Default: 8192
103 #define configTOTAL_HEAP_SIZE                   ((size_t)8192)
104
105 //  <o>Kernel tick frequency [Hz] <0-0xFFFFFFFF>
106 //  <i> Kernel tick rate in Hz.
107 //  <i> Default: 1000
108 #define configTICK_RATE_HZ                      ((TickType_t)1000)
109
110 //  <o>Timer task stack depth [words] <0-65535>
111 //  <i> Stack for timer task in words.
112 //  <i> Default: 80
113 #define configTIMER_TASK_STACK_DEPTH            80
114
115 //  <o>Timer task priority <0-56>
116 //  <i> Timer task priority.
117 //  <i> Default: 40 (High)
118 #define configTIMER_TASK_PRIORITY               40
119
120 //  <o>Timer queue length <0-1024>
121 //  <i> Timer command queue length.
122 //  <i> Default: 5
123 #define configTIMER_QUEUE_LENGTH                5
124
125 //  <q>Use time slicing
126 //  <i> Enable setting to use timeslicing.
127 //  <i> Default: 1
128 #define configUSE_TIME_SLICING                  1
129
130 //  <q>Idle should yield
131 //  <i> Control Yield behaviour of the idle task.
132 //  <i> Default: 1
133 #define configIDLE_SHOULD_YIELD                 1
134
135 //  <o>Check for stack overflow
136 //    <0=>Disable <1=>Method one <2=>Method two
137 //  <i> Enable or disable stack overflow checking.
138 //  <i> Callback function vApplicationStackOverflowHook implementation is required when stack checking is enabled.
139 //  <i> Default: 0
140 #define configCHECK_FOR_STACK_OVERFLOW          2
141
142 //  <q>Use idle hook
143 //  <i> Enable callback function call on each idle task iteration.
144 //  <i> Callback function vApplicationIdleHook implementation is required when idle hook is enabled.
145 //  <i> Default: 0
146 #define configUSE_IDLE_HOOK                     0
147
148 //  <q>Use tick hook
149 //  <i> Enable callback function call during each tick interrupt.
150 //  <i> Callback function vApplicationTickHook implementation is required when tick hook is enabled.
151 //  <i> Default: 0
152 #define configUSE_TICK_HOOK                     0
153
154 //  <q>Use deamon task startup hook
155 //  <i> Enable callback function call when timer service starts.
156 //  <i> Callback function vApplicationDaemonTaskStartupHook implementation is required when deamon task startup hook is enabled.
157 //  <i> Default: 0
158 #define configUSE_DAEMON_TASK_STARTUP_HOOK      0
159
160 //  <q>Use malloc failed hook
161 //  <i> Enable callback function call when out of dynamic memory.
162 //  <i> Callback function vApplicationMallocFailedHook implementation is required when malloc failed hook is enabled.
163 //  <i> Default: 0
164 #define configUSE_MALLOC_FAILED_HOOK            0
165
166 //  <q>Interrupt controller base address
167 //  <i> Must be set to the base address of the ARM Generic Interrupt Controller (GIC).
168 //  <i> Default: 0x2C000000
169 #define configINTERRUPT_CONTROLLER_BASE_ADDRESS 0x2C000000UL
170
171 //  <q>Interrupt controller CPU interface offset
172 //  <i> Must be set to the offset from interrupt controller base address at which the CPU interface starts.
173 //  <i> Default: 0x1000
174 #define configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET 0x00000100UL
175
176 //  <q>Interrupt controller unique priorities
177 //  <i> The number of unique priorities that can be specified in the ARM Generic Interrupt Controller (GIC).
178 //  <i> Default: 32
179 #define configUNIQUE_INTERRUPT_PRIORITIES       32
180
181 //  <q>Maximum API call interrupt priority
182 //  <i> Interrupts assigned a priority at or below this priority can call interrupt safe FreeRTOS API function, and will nest.
183 //  <i> Interrupts assigned a priority above this priority will not be effected by RTOS critical sections, and will nest,
184 //  <i> but cannot call any FreeRTOS API functions.
185 //  <i> Default: 32
186 #define configMAX_API_CALL_INTERRUPT_PRIORITY   32
187
188 //------------- <<< end of configuration section >>> ---------------------------
189
190 /* Defines needed by FreeRTOS to implement CMSIS RTOS2 API. Do not change! */
191 #define configCPU_CLOCK_HZ                      (SystemCoreClock)
192 #define configSUPPORT_STATIC_ALLOCATION         1
193 #define configSUPPORT_DYNAMIC_ALLOCATION        1
194 #define configUSE_PREEMPTION                    1
195 #define configUSE_TIMERS                        1
196 #define configUSE_MUTEXES                       1
197 #define configUSE_RECURSIVE_MUTEXES             1
198 #define configUSE_COUNTING_SEMAPHORES           1
199 #define configUSE_TASK_NOTIFICATIONS            1
200 #define configUSE_TRACE_FACILITY                1
201 #define configUSE_16_BIT_TICKS                  0
202 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
203 #define configMAX_PRIORITIES                    56
204 #define configMAX_SYSCALL_INTERRUPT_PRIORITY    16
205 #define configKERNEL_INTERRUPT_PRIORITY         255
206
207 /* Defines that include FreeRTOS functions which implement CMSIS RTOS2 API. Do not change! */
208 #define INCLUDE_xEventGroupSetBitsFromISR       1
209 #define INCLUDE_xSemaphoreGetMutexHolder        1
210 #define INCLUDE_vTaskDelay                      1
211 #define INCLUDE_vTaskDelayUntil                 1
212 #define INCLUDE_vTaskDelete                     1
213 #define INCLUDE_xTaskGetCurrentTaskHandle       1
214 #define INCLUDE_xTaskGetSchedulerState          1
215 #define INCLUDE_uxTaskGetStackHighWaterMark     1
216 #define INCLUDE_uxTaskPriorityGet               1
217 #define INCLUDE_vTaskPrioritySet                1
218 #define INCLUDE_eTaskGetState                   1
219 #define INCLUDE_vTaskSuspend                    1
220 #define INCLUDE_xTimerPendFunctionCall          1
221
222 /* Map the FreeRTOS port timer configuration functions to their implementations */
223 #define configSETUP_TICK_INTERRUPT()                         \
224   OS_Tick_Setup (configTICK_RATE_HZ, FreeRTOS_Tick_Handler); \
225   OS_Tick_Enable();
226
227 #define configCLEAR_TICK_INTERRUPT()                         \
228     OS_Tick_AcknowledgeIRQ()
229
230 #endif /* FREERTOS_CONFIG_H */