]> begriffs open source - cmsis-freertos/blob - Demo/CORTEX_EFM32_Giant_Gecko_Simplicity_Studio/FreeRTOSConfig.h
Initial commit
[cmsis-freertos] / Demo / CORTEX_EFM32_Giant_Gecko_Simplicity_Studio / 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 #ifdef __cplusplus
74 extern "C" {
75 #endif
76
77 /*-----------------------------------------------------------
78  * Application specific definitions.
79  *
80  * These definitions should be adjusted for your particular hardware and
81  * application requirements.
82  *
83  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
84  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
85  *
86  * See http://www.freertos.org/a00110.html.
87  *----------------------------------------------------------*/
88
89
90 /* Set configCREATE_LOW_POWER_DEMO as follows:
91  *
92  * 0: Build the full test and demo application.
93  * 1: Build the simple blinky tickless low power demo, generating the tick
94  *    interrupt from the BURTC.  EM3 will be entered, but use of the ULFRCO
95  *    clock means timing will be inaccurate.
96  * 2: Build the simple blinky tickless low power demo, generating the tick from
97  *    the RTC.  EM2 will be entered.  The LXFO clock is used, which is more
98  *    accurate than the ULFRCO clock.
99  *  See the comments at the top of main.c, main_full.c and main_low_power.c for
100  *  more information.
101  */
102 #define configCREATE_LOW_POWER_DEMO             0
103
104 /* Some configuration is dependent on the demo being built. */
105 #if( configCREATE_LOW_POWER_DEMO == 0 )
106
107         /* Tickless mode is not used. */
108
109         /* Some of the standard demo test tasks assume a tick rate of 1KHz, even
110         though that is faster than would normally be warranted by a real
111         application. */
112         #define configTICK_RATE_HZ                              ( 1000 )
113
114         /* The full demo always has tasks to run so the tick will never be turned
115         off.  The blinky demo will use the default tickless idle implementation to
116         turn the tick off. */
117         #define configUSE_TICKLESS_IDLE                 0
118
119         /* Hook function related definitions. */
120         #define configUSE_TICK_HOOK                             ( 1 )
121         #define configCHECK_FOR_STACK_OVERFLOW  ( 1 )
122         #define configUSE_MALLOC_FAILED_HOOK    ( 1 )
123         #define configUSE_IDLE_HOOK                     ( 1 )
124
125         #define configENERGY_MODE                               ( sleepEM3 )
126
127 #elif( configCREATE_LOW_POWER_DEMO == 1 )
128
129         /* Tickless idle mode, generating RTOS tick interrupts from the BURTC, fed
130         by the [inaccurate] ULFRCO clock. */
131
132         /* The slow clock used to generate the tick interrupt in the low power demo
133         runs at 2KHz.  Ensure the tick rate is a multiple of the clock. */
134         #define configTICK_RATE_HZ                              ( 100 )
135
136         /* The low power demo uses the tickless idle feature. */
137         #define configUSE_TICKLESS_IDLE                 1
138
139         /* Hook function related definitions. */
140         #define configUSE_TICK_HOOK                             ( 0 )
141         #define configCHECK_FOR_STACK_OVERFLOW  ( 0 )
142         #define configUSE_MALLOC_FAILED_HOOK    ( 0 )
143         #define configUSE_IDLE_HOOK                             ( 0 )
144
145         #define configENERGY_MODE                               ( sleepEM3 )
146
147 #elif( configCREATE_LOW_POWER_DEMO == 2 )
148
149         /* Tickless idle mode, generating RTOS tick interrupts from the RTC, fed
150         by the LXFO clock. */
151
152         /* The slow clock used to generate the tick interrupt in the low power demo
153         runs at 32768/8=4096Hz.  Ensure the tick rate is a multiple of the clock. */
154         #define configTICK_RATE_HZ                              ( 128 )
155
156         /* The low power demo uses the tickless idle feature. */
157         #define configUSE_TICKLESS_IDLE                 1
158
159         /* Hook function related definitions. */
160         #define configUSE_TICK_HOOK                             ( 0 )
161         #define configCHECK_FOR_STACK_OVERFLOW  ( 0 )
162         #define configUSE_MALLOC_FAILED_HOOK    ( 0 )
163         #define configUSE_IDLE_HOOK                             ( 0 )
164
165         #define configENERGY_MODE                               ( sleepEM3 )
166
167 #endif
168
169 /* Main functions*/
170 #define configUSE_PREEMPTION                                    ( 1 )
171 #define configUSE_PORT_OPTIMISED_TASK_SELECTION ( 1 )
172 #define configSUPPORT_STATIC_ALLOCATION                 ( 1 )
173 #define configCPU_CLOCK_HZ                                              (( unsigned long ) 14000000)
174 #define configMAX_PRIORITIES                                    ( 6 )
175 #define configMINIMAL_STACK_SIZE                                (( unsigned short ) 130)
176 #define configTOTAL_HEAP_SIZE                                   (( size_t )(24000))
177 #define configMAX_TASK_NAME_LEN                                 ( 10 )
178 #define configUSE_TRACE_FACILITY                                ( 0 )
179 #define configUSE_16_BIT_TICKS                                  ( 0 )
180 #define configIDLE_SHOULD_YIELD                                 ( 0 )
181 #define configUSE_MUTEXES                                               ( 1 )
182 #define configUSE_RECURSIVE_MUTEXES                             ( 1 )
183 #define configUSE_COUNTING_SEMAPHORES                   ( 1 )
184 #define configUSE_ALTERNATIVE_API                               ( 0 )/* Deprecated! */
185 #define configQUEUE_REGISTRY_SIZE                               ( 10 )
186 #define configUSE_QUEUE_SETS                                    ( 0 )
187
188 /* Run time stats gathering related definitions. */
189 #define configGENERATE_RUN_TIME_STATS                   ( 0 )
190
191 /* Co-routine related definitions. */
192 #define configUSE_CO_ROUTINES                                   ( 0 )
193 #define configMAX_CO_ROUTINE_PRIORITIES                 ( 1 )
194
195 /* Software timer related definitions. */
196 #define configUSE_TIMERS                                                ( 1 )
197 #define configTIMER_TASK_PRIORITY                               ( configMAX_PRIORITIES - 1 ) /* Highest priority */
198 #define configTIMER_QUEUE_LENGTH                                ( 10 )
199 #define configTIMER_TASK_STACK_DEPTH                    ( configMINIMAL_STACK_SIZE )
200
201 /* Cortex-M specific definitions. */
202 #ifdef __NVIC_PRIO_BITS
203         /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
204         #define configPRIO_BITS                __NVIC_PRIO_BITS
205 #else
206         #define configPRIO_BITS                3        /* 7 priority levels */
207 #endif
208
209 /* The lowest interrupt priority that can be used in a call to a "set priority"
210 function. */
211 #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY                 0x07
212
213 /* The highest interrupt priority that can be used by any interrupt service
214 routine that makes calls to interrupt safe FreeRTOS API functions.  DO NOT CALL
215 INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
216 PRIORITY THAN THIS! (higher priorities are lower numeric values. */
217 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY    0x05
218
219 /* Interrupt priorities used by the kernel port layer itself.  These are generic
220 to all Cortex-M ports, and do not rely on any particular library functions. */
221 #define configKERNEL_INTERRUPT_PRIORITY          ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
222 /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
223 See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
224 #define configMAX_SYSCALL_INTERRUPT_PRIORITY     ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
225
226
227 /* Optional functions - most linkers will remove unused functions anyway. */
228 #define INCLUDE_vTaskPrioritySet                                ( 1 )
229 #define INCLUDE_uxTaskPriorityGet                               ( 1 )
230 #define INCLUDE_vTaskDelete                                             ( 1 )
231 #define INCLUDE_vTaskSuspend                                    ( 1 )
232 #define INCLUDE_xResumeFromISR                                  ( 1 )
233 #define INCLUDE_vTaskDelayUntil                                 ( 1 )
234 #define INCLUDE_vTaskDelay                                              ( 1 )
235 #define INCLUDE_xTaskGetSchedulerState                  ( 1 )
236 #define INCLUDE_xTaskGetCurrentTaskHandle               ( 1 )
237 #define INCLUDE_uxTaskGetStackHighWaterMark             ( 0 )
238 #define INCLUDE_xTaskGetIdleTaskHandle                  ( 0 )
239 #define INCLUDE_xTimerGetTimerDaemonTaskHandle  ( 0 )
240 #define INCLUDE_eTaskGetState                                   ( 1 )
241 #define INCLUDE_xTimerPendFunctionCall                  ( 1 )
242
243 /* Stop if an assertion fails. */
244 #define configASSERT( x )       if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
245
246 /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
247 standard names. */
248 #define vPortSVCHandler         SVC_Handler
249 #define xPortPendSVHandler       PendSV_Handler
250 #define xPortSysTickHandler     SysTick_Handler
251
252 /* For the linker. */
253 #define fabs __builtin_fabs
254
255 #ifdef __cplusplus
256 }
257 #endif
258 #endif /* FREERTOS_CONFIG_H */
259