ODeV framework  v2
FreeRTOSConfig.h
1 /*
2  FreeRTOS V10.0.1 - 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  ***************************************************************************
8  * *
9  * FreeRTOS provides completely free yet professionally developed, *
10  * robust, strictly quality controlled, supported, and cross *
11  * platform software that has become a de facto standard. *
12  * *
13  * Help yourself get started quickly and support the FreeRTOS *
14  * project by purchasing a FreeRTOS tutorial book, reference *
15  * manual, or both from: http://www.FreeRTOS.org/Documentation *
16  * *
17  * Thank you! *
18  * *
19  ***************************************************************************
20 
21  This file is part of the FreeRTOS distribution.
22 
23  FreeRTOS is free software; you can redistribute it and/or modify it under
24  the terms of the GNU General Public License (version 2) as published by the
25  Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
26 
27  >>! NOTE: The modification to the GPL is included to allow you to !<<
28  >>! distribute a combined work that includes FreeRTOS without being !<<
29  >>! obliged to provide the source code for proprietary components !<<
30  >>! outside of the FreeRTOS kernel. !<<
31 
32  FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
33  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
34  FOR A PARTICULAR PURPOSE. Full license text is available from the following
35  link: http://www.freertos.org/a00114.html
36 
37  1 tab == 4 spaces!
38 
39  ***************************************************************************
40  * *
41  * Having a problem? Start by reading the FAQ "My application does *
42  * not run, what could be wrong?" *
43  * *
44  * http://www.FreeRTOS.org/FAQHelp.html *
45  * *
46  ***************************************************************************
47 
48  http://www.FreeRTOS.org - Documentation, books, training, latest versions,
49  license and Real Time Engineers Ltd. contact details.
50 
51  http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
52  including FreeRTOS+Trace - an indispensable productivity tool, a DOS
53  compatible FAT file system, and our tiny thread aware UDP/IP stack.
54 
55  http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
56  Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
57  licenses offer ticketed support, indemnification and middleware.
58 
59  http://www.SafeRTOS.com - High Integrity Systems also provide a safety
60  engineered and independently SIL3 certified version for use in safety and
61  mission critical applications that require provable dependability.
62 
63  1 tab == 4 spaces!
64 */
65 
66 
67 #ifndef FREERTOS_CONFIG_H
68 #define FREERTOS_CONFIG_H
69 
70 /*-----------------------------------------------------------
71  * Application specific definitions.
72  *
73  * These definitions should be adjusted for your particular hardware and
74  * application requirements.
75  *
76  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
77  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
78  *
79  * See http://www.freertos.org/a00110.html.
80  *----------------------------------------------------------*/
81 
82 /* Ensure stdint is only used by the compiler, and not the assembler. */
83 #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
84  #include <stdint.h>
85  extern uint32_t SystemCoreClock;
86 #endif
87 
88 #define configUSE_PREEMPTION 1
89 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
90 #define configUSE_TICKLESS_IDLE 0
91 #define configCPU_CLOCK_HZ ( SystemCoreClock )
92 #define configTICK_RATE_HZ ((TickType_t)1000)
93 #define configMAX_PRIORITIES ( 5 )
94 #define configMAX_TASK_NAME_LEN ( 5 )
95 #define configMINIMAL_STACK_SIZE ((uint16_t)70)
96 #define configUSE_16_BIT_TICKS 0
97 #define configIDLE_SHOULD_YIELD 1
98 #define configUSE_TASK_NOTIFICATIONS 0
99 #if defined(DEBUG) || defined(SYS_DEBUG)
100 #define configUSE_MUTEXES 1
101 #else
102 #define configUSE_MUTEXES 0
103 #endif
104 #define configUSE_RECURSIVE_MUTEXES 0
105 #define configUSE_COUNTING_SEMAPHORES 0
106 #define configQUEUE_REGISTRY_SIZE 7
107 #define configUSE_QUEUE_SETS 0
108 #define configENABLE_BACKWARD_COMPATIBILITY 0
109 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
110 
111 /* Memory allocation related definitions. */
112 #define configSUPPORT_STATIC_ALLOCATION 0
113 #define configSUPPORT_DYNAMIC_ALLOCATION 1
114 #if defined(DEBUG) || (SYS_DBG_ENABLE_TA4>=1)
115 #define configTOTAL_HEAP_SIZE ((size_t)4000)
116 #else
117 #define configTOTAL_HEAP_SIZE ((size_t)3000)
118 #endif
119 #define configAPPLICATION_ALLOCATED_HEAP 1
120 
121 /* Hook function related definitions. */
122 #define configUSE_IDLE_HOOK 1
123 #define configUSE_TICK_HOOK 0
124 #ifdef DEBUG
125 #define configCHECK_FOR_STACK_OVERFLOW 2
126 #else
127 #define configCHECK_FOR_STACK_OVERFLOW 0
128 #endif
129 #ifdef DEBUG
130 #define configUSE_MALLOC_FAILED_HOOK 1
131 #else
132 #define configUSE_MALLOC_FAILED_HOOK 0
133 #endif
134 #define configUSE_DAEMON_TASK_STARTUP_HOOK 0
135 
136 /* Run time and task stats gathering related definitions. */
137 #ifdef DEBUG
138 #define configGENERATE_RUN_TIME_STATS 1
139 #define configUSE_TRACE_FACILITY 1
140 #else
141 #define configGENERATE_RUN_TIME_STATS 0
142 #if (SYS_DBG_ENABLE_TA4>=1)
143 #define configUSE_TRACE_FACILITY 1
144 #else
145 #define configUSE_TRACE_FACILITY 0
146 #endif
147 #endif
148 #define configUSE_STATS_FORMATTING_FUNCTIONS 0
149 
150 /* Co-routine definitions. */
151 #define configUSE_CO_ROUTINES 0
152 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
153 
154 /* Software timer related definitions. */
155 #define configUSE_TIMERS 1
156 #define configTIMER_TASK_PRIORITY 3
157 #define configTIMER_QUEUE_LENGTH 10
158 #define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
159 
160 /* Other. */
161 #define configUSE_APPLICATION_TASK_TAG 0
162 
163 /* Set the following definitions to 1 to include the API function, or zero
164 to exclude the API function. */
165 #define INCLUDE_vTaskPrioritySet 0
166 #define INCLUDE_uxTaskPriorityGet 0
167 #define INCLUDE_vTaskDelete 0
168 #define INCLUDE_vTaskSuspend 1
169 #define INCLUDE_vTaskDelayUntil 0
170 #define INCLUDE_vTaskDelay 1
171 #define INCLUDE_vTaskCleanUpResources 0
172 #define INCLUDE_xTaskGetSchedulerState 1
173 #define INCLUDE_xTaskGetCurrentTaskHandle 1
174 #define INCLUDE_uxTaskGetStackHighWaterMark 0
175 #define INCLUDE_xTaskGetIdleTaskHandle 0
176 #define INCLUDE_eTaskGetState 0
177 #define INCLUDE_xEventGroupSetBitFromISR 0
178 #define INCLUDE_xTimerPendFunctionCall 0
179 #define INCLUDE_xTaskAbortDelay 0
180 #define INCLUDE_xTaskGetHandle 0
181 #define INCLUDE_xTaskResumeFromISR 1
182 
183 /* Cortex-M specific definitions. */
184 #ifdef __NVIC_PRIO_BITS
185  /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
186  #define configPRIO_BITS __NVIC_PRIO_BITS
187 #else
188  #define configPRIO_BITS 4 /* 15 priority levels */
189 #endif
190 
191 /* The lowest interrupt priority that can be used in a call to a "set priority"
192 function. */
193 #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf
194 
195 /* The highest interrupt priority that can be used by any interrupt service
196 routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
197 INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
198 PRIORITY THAN THIS! (higher priorities are lower numeric values. */
199 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
200 
201 /* Interrupt priorities used by the kernel port layer itself. These are generic
202 to all Cortex-M ports, and do not rely on any particular library functions. */
203 #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
204 /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
205 See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
206 #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
207 
208 /* Normal assert() semantics without relying on the provision of an assert.h
209 header file. */
210 #if defined(__ICCARM__) || defined(__GNUC__)
211  // We put the forward declaration of vFreeRTOSAssertCalled function between define in order to prevent and error from the assembly
212  // when it compiles the port.asm file that include FreeTOSConfig.h.
213  void vFreeRTOSAssertCalled( unsigned long ulLine, const char * const pcFileName );
214 #elif
215 #define vFreeRTOSAssertCalled(line, file) { taskDISABLE_INTERRUPTS(); for( ;; ); }
216 #endif
217 #define configASSERT( x ) if ((x) == 0) vFreeRTOSAssertCalled(__LINE__, __FILE__)
218 
219 /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
220  standard names. */
221 #define vPortSVCHandler SVC_Handler
222 #define xPortPendSVHandler PendSV_Handler
223 
224 /* IMPORTANT: This define MUST be commented when used with STM32Cube firmware,
225  to prevent overwriting SysTick_Handler defined within STM32Cube HAL */
226 /* #define xPortSysTickHandler SysTick_Handler */
227 
228 #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
229 void SysPreSleepProcessing(uint32_t *ulExpectedIdleTime);
230 void SysPostSleepProcessing(uint32_t *ulExpectedIdleTime);
231 #endif /* defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) */
232 
233 /* The configPRE_SLEEP_PROCESSING() and configPOST_SLEEP_PROCESSING() macros
234 allow the application writer to add additional code before and after the MCU is
235 placed into the low power state respectively. */
236 #if configUSE_TICKLESS_IDLE == 1
237 #define configPRE_SLEEP_PROCESSING SysPreSleepProcessing
238 #define configPOST_SLEEP_PROCESSING SysPostSleepProcessing
239 #endif /* configUSE_TICKLESS_IDLE == 1 */
240 
241 // Enable the RTOS-aware debugging support provided by Atollic TruSTUDIO 8.1.0.
242 #if configGENERATE_RUN_TIME_STATS == 1
243 // forward declaration
244 extern void SysDebugStartRunTimeStatsTimer();
245 extern uint32_t g_ulHighFrequencyTimerTicks;
246 
247 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() SysDebugStartRunTimeStatsTimer()
248 #define portGET_RUN_TIME_COUNTER_VALUE() g_ulHighFrequencyTimerTicks
249 #endif
250 
251 // Tracealyzer recorder library
252 #if (SYS_DBG_ENABLE_TA4>=1)
253 #include "trcRecorder.h"
254 #endif
255 
256 #endif /* FREERTOS_CONFIG_H */
257 
void SysPreSleepProcessing(uint32_t *ulExpectedIdleTime)
void SysDebugStartRunTimeStatsTimer()
void SysPostSleepProcessing(uint32_t *ulExpectedIdleTime)