PER Firmware
Loading...
Searching...
No Matches
FreeRTOSConfig.h
1
/*
2
* FreeRTOS Kernel V10.2.1
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
6
* of this software and associated documentation files (the "Software"), to deal
7
* in the Software without restriction, including without limitation the rights
8
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
* copies of the Software, and to permit persons to whom the Software is
10
* furnished to do so, subject to the following conditions:
11
*
12
* The above copyright notice and this permission notice shall be included in
13
* all 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,
17
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
* SOFTWARE.
22
*
23
* http://www.FreeRTOS.org
24
* http://aws.amazon.com/freertos
25
*
26
* 1 tab == 4 spaces!
27
*/
28
29
#ifndef FREERTOS_CONFIG_H
30
#define FREERTOS_CONFIG_H
31
32
/*-----------------------------------------------------------
33
* this is a template configuration files
34
*
35
* These definitions should be adjusted for your particular hardware and
36
* application requirements.
37
*
38
* These parameters and more are described within the 'configuration' section of
39
*the FreeRTOS API documentation available on the FreeRTOS.org web site.
40
*
41
* See http://www.freertos.org/a00110.html
42
*----------------------------------------------------------*/
43
44
/* Ensure stdint is only used by the compiler, and not the assembler. */
45
#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
46
#include <stdint.h>
47
extern
uint32_t SystemCoreClock;
48
#endif
49
50
#ifdef CMSIS_device_header
51
#undef CMSIS_device_header
52
#endif
53
54
#if defined(STM32F407xx)
55
#define CMSIS_device_header "stm32f4xx.h"
56
#elif defined(STM32G474xx)
57
#define CMSIS_device_header "stm32g4xx.h"
58
#else
59
#error "MCU Arch not supported"
60
#endif
61
62
/* CMSIS-RTOSv2 defines 56 levels of priorities. To be able to use them
63
* all and avoid application misbehavior,
64
* configUSE_PORT_OPTIMISED_TASK_SELECTION must be set to 0 and
65
* configMAX_PRIORITIES to 56
66
*
67
*/
68
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
69
#define configMAX_PRIORITIES (56)
70
#define configRECORD_STACK_HIGH_ADDRESS 1
71
72
#define configUSE_PREEMPTION 1
73
#define configUSE_TIME_SLICING 1
74
#define configUSE_IDLE_HOOK 1
75
#define configUSE_TICK_HOOK 0
76
#define configSUPPORT_STATIC_ALLOCATION 1
77
#define configSUPPORT_DYNAMIC_ALLOCATION 0
78
#define configCPU_CLOCK_HZ (SystemCoreClock)
79
// ! IMPORTANT DO NOT CHANGE TICK RATE. MANY SYSTEMS DEPEND ON THIS BEING 1ms
80
#define configTICK_RATE_HZ ((TickType_t) 1000)
81
#define configMINIMAL_STACK_SIZE ((uint16_t) 128)
82
#define configTOTAL_HEAP_SIZE (0)
83
#define configMAX_TASK_NAME_LEN (16)
84
#define configUSE_TRACE_FACILITY 1
85
#define configUSE_16_BIT_TICKS 0
86
#define configIDLE_SHOULD_YIELD 1
87
#define configUSE_MUTEXES 1
88
#define configQUEUE_REGISTRY_SIZE 8
89
#define configCHECK_FOR_STACK_OVERFLOW 0
90
#define configUSE_RECURSIVE_MUTEXES 1
91
#define configUSE_MALLOC_FAILED_HOOK 0
92
#define configUSE_APPLICATION_TASK_TAG 0
93
#define configUSE_COUNTING_SEMAPHORES 1
94
95
/* Run time stats gathering definitions. */
96
#define configGENERATE_RUN_TIME_STATS 1
97
#ifdef CMSIS_device_header
98
#include CMSIS_device_header
99
#endif
100
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() do { \
101
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; \
102
DWT->CYCCNT = 0; \
103
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; \
104
} while(0)
105
#define portGET_RUN_TIME_COUNTER_VALUE() (DWT->CYCCNT)
106
107
/* Co-routine definitions. */
108
#define configUSE_CO_ROUTINES 0
109
#define configMAX_CO_ROUTINE_PRIORITIES (2)
110
111
/* Software timer definitions. */
112
#define configUSE_TIMERS 1
113
#define configTIMER_TASK_PRIORITY (2)
114
#define configTIMER_QUEUE_LENGTH 10
115
#define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2)
116
117
/* Set the following definitions to 1 to include the API function, or zero
118
to exclude the API function. */
119
#define INCLUDE_vTaskPrioritySet 1
120
#define INCLUDE_uxTaskPriorityGet 1
121
#define INCLUDE_vTaskDelete 1
122
#define INCLUDE_vTaskCleanUpResources 0
123
#define INCLUDE_vTaskSuspend 1
124
#define INCLUDE_vTaskDelayUntil 1
125
#define INCLUDE_vTaskDelay 1
126
#define INCLUDE_xTaskGetSchedulerState 1
127
#define INCLUDE_xTaskGetCurrentTaskHandle 1
128
#define INCLUDE_uxTaskGetStackHighWaterMark 1
129
#define INCLUDE_eTaskGetState 1
130
#define INCLUDE_xTimerPendFunctionCall 1
131
132
#define INCLUDE_xSemaphoreGetMutexHolder 1
133
134
/*------------- CMSIS-RTOS V2 specific defines -----------*/
135
/* When using CMSIS-RTOSv2 set configSUPPORT_STATIC_ALLOCATION to 1
136
* is mandatory to avoid compile errors.
137
* CMSIS-RTOS V2 implmentation requires the following defines
138
*
139
#define configSUPPORT_STATIC_ALLOCATION 1 <-- cmsis_os threads are
140
created using xTaskCreateStatic() API
141
#define configMAX_PRIORITIES (56) <-- Priority range in CMSIS-RTOS V2 is [0 ..
142
56]
143
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 <-- when set to 1,
144
configMAX_PRIORITIES can't be more than 32 which is not suitable for the new
145
CMSIS-RTOS v2 priority range
146
*/
147
148
/* the CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation
149
used
150
* by the application thus the correct define need to be enabled from the list
151
* below
152
*
153
//define USE_FreeRTOS_HEAP_1
154
//define USE_FreeRTOS_HEAP_2
155
//define USE_FreeRTOS_HEAP_3
156
//define USE_FreeRTOS_HEAP_4
157
//define USE_FreeRTOS_HEAP_5
158
159
*/
160
161
/* Cortex-M specific definitions. */
162
163
#ifdef __NVIC_PRIO_BITS
164
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
165
#define configPRIO_BITS __NVIC_PRIO_BITS
166
#else
167
#define configPRIO_BITS 4
/* 15 priority levels */
168
#endif
169
170
/* The lowest interrupt priority that can be used in a call to a "set priority"
171
function. */
172
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf
173
174
/* The highest interrupt priority that can be used by any interrupt service
175
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
176
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
177
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
178
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
179
180
/* Interrupt priorities used by the kernel port layer itself. These are generic
181
to all Cortex-M ports, and do not rely on any particular library functions. */
182
#define configKERNEL_INTERRUPT_PRIORITY \
183
(configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
184
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
185
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
186
#define configMAX_SYSCALL_INTERRUPT_PRIORITY \
187
(configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS))
188
189
/* Normal assert() semantics without relying on the provision of an assert.h
190
header file. */
191
#define configASSERT(x) \
192
if ((x) == 0) \
193
{ \
194
taskDISABLE_INTERRUPTS(); \
195
for (;;) \
196
; \
197
}
198
199
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
200
standard names. */
201
#define vPortSVCHandler SVC_Handler
202
#define xPortPendSVHandler PendSV_Handler
203
204
/* IMPORTANT: FreeRTOS is using the SysTick as internal time base, thus make
205
sure the system and peripherials are using a different time base (TIM based
206
for example).
207
*/
208
209
#endif
/* FREERTOS_CONFIG_H */
common
freertos
FreeRTOSConfig.h
Generated by
1.12.0