Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
FreeRTOSConfig.h
1/*
2 FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.
3
4 FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
5 http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6
7 ***************************************************************************
8 * *
9 * FreeRTOS tutorial books are available in pdf and paperback. *
10 * Complete, revised, and edited pdf reference manuals are also *
11 * available. *
12 * *
13 * Purchasing FreeRTOS documentation will not only help you, by *
14 * ensuring you get running as quickly as possible and with an *
15 * in-depth knowledge of how to use FreeRTOS, it will also help *
16 * the FreeRTOS project to continue with its mission of providing *
17 * professional grade, cross platform, de facto standard solutions *
18 * for microcontrollers - completely free of charge! *
19 * *
20 * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
21 * *
22 * Thank you for using FreeRTOS, and thank you for your support! *
23 * *
24 ***************************************************************************
25
26
27 This file is part of the FreeRTOS distribution.
28
29 FreeRTOS is free software; you can redistribute it and/or modify it under
30 the terms of the GNU General Public License (version 2) as published by the
31 Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
32 >>>NOTE<<< The modification to the GPL is included to allow you to
33 distribute a combined work that includes FreeRTOS without being obliged to
34 provide the source code for proprietary components outside of the FreeRTOS
35 kernel. FreeRTOS is distributed in the hope that it will be useful, but
36 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
37 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
38 more details. You should have received a copy of the GNU General Public
39 License and the FreeRTOS license exception along with FreeRTOS; if not it
40 can be viewed here: http://www.freertos.org/a00114.html and also obtained
41 by writing to Richard Barry, contact details for whom are available on the
42 FreeRTOS WEB site.
43
44 1 tab == 4 spaces!
45
46 ***************************************************************************
47 * *
48 * Having a problem? Start by reading the FAQ "My application does *
49 * not run, what could be wrong?" *
50 * *
51 * http://www.FreeRTOS.org/FAQHelp.html *
52 * *
53 ***************************************************************************
54
55
56 http://www.FreeRTOS.org - Documentation, training, latest versions, license
57 and contact details.
58
59 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
60 including FreeRTOS+Trace - an indispensable productivity tool.
61
62 Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
63 the code with commercial support, indemnification, and middleware, under
64 the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
65 provide a safety engineered and independently SIL3 certified version under
66 the SafeRTOS brand: http://www.SafeRTOS.com.
67*/
68
69#ifndef FREERTOS_CONFIG_H
70#define FREERTOS_CONFIG_H
71
72#ifndef __LANGUAGE_ASSEMBLY__
73#include "utils/blinker.h"
74#endif
75
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 * Cortex-M3 specific defines
91 *************************************************************************** */
92#if defined(GCC_ARMCM3)
93
94#define configCPU_CLOCK_HZ ( cm3_cpu_clock_hz )
95#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 )
96#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 7000 ) )
97#define configTIMER_TASK_STACK_DEPTH 256
98
99#define configKERNEL_INTERRUPT_PRIORITY 255
100/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
101See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
102#define configMAX_SYSCALL_INTERRUPT_PRIORITY 0xa0 /* equivalent to 191, or priority 5. */
103
104// change #if to 1 in order to enable asserts for the kernel
105#if 1
106#ifdef __cplusplus
107extern "C" {
108#endif
109extern int g_death_lineno;
110#ifdef __cplusplus
111}
112#endif // cplusplus
113#define configASSERT( x ) do { if (!(x)) { g_death_lineno = __LINE__; diewith(BLINK_DIE_ASSERT); }} while(0)
114#endif
115
117//#define diewith( x ) abort()
118// Assertion facility
119#ifdef __cplusplus
120extern "C" {
121#endif
122extern const unsigned long cm3_cpu_clock_hz;
123extern void diewith(unsigned long);
124extern unsigned long blinker_pattern;
125#ifdef __cplusplus
126}
127#endif // cplusplus
128
129/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
130standard names - or at least those used in the unmodified vector table. */
131#define vPortSVCHandler SVC_Handler
132#define xPortPendSVHandler PendSV_Handler
133#define xPortSysTickHandler SysTick_Handler
134
135/* ***************************************************************************
136 * Cortex-M0 specific defines
137 *************************************************************************** */
138#elif defined (GCC_ARMCM0)
139
140#define configCPU_CLOCK_HZ ( cpu_clock_hz )
141#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 )
142//#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 7000 ) )
143#define configTIMER_TASK_STACK_DEPTH 256
144
145// change #if to 1 in order to enable asserts for the kernel
146#if 0
147#ifdef __cplusplus
148extern "C" {
149#endif
150extern int g_death_lineno;
151#ifdef __cplusplus
152}
153#endif // cplusplus
154#define configASSERT( x ) do { if (!(x)) { g_death_lineno = __LINE__; diewith(BLINK_DIE_ASSERT); }} while(0)
155#endif
156
157#ifdef __cplusplus
158extern "C" {
159#endif
160extern const unsigned long cpu_clock_hz;
161extern void diewith(unsigned long);
162extern unsigned long blinker_pattern;
163#ifdef __cplusplus
164}
165#endif // cplusplus
166
167#define vPortSVCHandler SVC_Handler
168#define xPortPendSVHandler PendSV_Handler
169#define xPortSysTickHandler SysTick_Handler
170
171
172/* ***************************************************************************
173 * LPC2368 specific defines
174 *************************************************************************** */
175#elif defined(TARGET_LPC2368)
176
177#include "lpc23xx.h"
178
179// Assertion facility
180#ifdef __cplusplus
181extern "C" {
182#endif
183extern void diewith(unsigned long);
184extern unsigned long blinker_pattern;
185#ifdef __cplusplus
186}
187#endif // cplusplus
188#define configASSERT( x ) if (!(x)) diewith(BLINK_DIE_ASSERT)
189
190/* Value to use on old rev '-' devices. */
191//#define configPINSEL2_VALUE 0x50151105
192
193/* Value to use on rev 'A' and newer devices. */
194#define configPINSEL2_VALUE 0x50150105
195
196#ifndef configPINSEL2_VALUE
197 #error Please uncomment one of the two configPINSEL2_VALUE definitions above, depending on the revision of the LPC2000 device being used.
198#endif
199
200#define configCPU_CLOCK_HZ ( ( unsigned long ) 48000000 ) /* =12Mhz xtal multiplied by 5 using the PLL. */
201#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 104 )
202#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 18 * 1024 ) )
203
204#define configTIMER_TASK_STACK_DEPTH 384 //256
205
206#elif defined(TARGET_LPC1768)
207
208// Assertion facility
209#ifdef __cplusplus
210extern "C" {
211#endif
212extern void diewith(unsigned long);
213extern unsigned long blinker_pattern;
214#ifdef __cplusplus
215}
216#endif // cplusplus
217#define configASSERT( x ) if (!(x)) diewith(BLINK_DIE_ASSERT)
218
219#define configCPU_CLOCK_HZ ( ( unsigned long ) 96000000 ) /* =12Mhz xtal multiplied by 5 using the PLL. */
220#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 104 )
221#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 18 * 1024 ) )
222
223#define configTIMER_TASK_STACK_DEPTH 256
224
225/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
226standard names - or at least those used in the unmodified vector table. */
227#define vPortSVCHandler SVC_Handler
228#define xPortPendSVHandler PendSV_Handler
229#define xPortSysTickHandler SysTick_Handler
230
231#define configKERNEL_INTERRUPT_PRIORITY 255
232/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
233See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
234#define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xa0, or priority 5. */
235
236#elif defined(TARGET_LPC11Cxx)
237
238#define configTIMER_TASK_STACK_DEPTH 80
239
240// Assertion facility
241#ifdef __cplusplus
242extern "C" {
243#endif
244extern void diewith(unsigned long);
245extern unsigned long blinker_pattern;
246#ifdef __cplusplus
247}
248#endif
249#define configASSERT( x ) if (!(x)) diewith(BLINK_DIE_ASSERT)
250
251#define configCPU_CLOCK_HZ ( ( unsigned long ) 48000000 ) /* =12Mhz xtal multiplied by 5 using the PLL. */
252/* Idle task stack uses this size */
253#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 33 )
254#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 3000 ) )
255
256/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
257standard names - or at least those used in the unmodified vector table. */
258#define vPortSVCHandler SVC_Handler
259#define xPortPendSVHandler PendSV_Handler
260#define xPortSysTickHandler SysTick_Handler
261
262#elif defined(TARGET_PIC32MX)
263
264#define MIPSNO16 __attribute__((nomips16))
265
266#define configCPU_CLOCK_HZ ( pic32_cpu_clock_hz )
267#define configPERIPHERAL_CLOCK_HZ ( pic32_periph_clock_hz )
268#define configMINIMAL_STACK_SIZE ( 90 )
269#define configISR_STACK_SIZE ( 512 )
270#define configTOTAL_HEAP_SIZE ( ( size_t ) 9000 )
271#define configTIMER_TASK_STACK_DEPTH ( 190 )
272#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
273#define configCHECK_FOR_STACK_OVERFLOW 3
274
275/* The priority at which the tick interrupt runs. This should probably be
276kept at 1. */
277#define configKERNEL_INTERRUPT_PRIORITY 0x01
278
279/* The maximum interrupt priority from which FreeRTOS.org API functions can
280be called. Only API functions that end in ...FromISR() can be used within
281interrupts. */
282#define configMAX_SYSCALL_INTERRUPT_PRIORITY 0x03
283
284#ifndef __LANGUAGE_ASSEMBLY__
285// Assertion facility
286#ifdef __cplusplus
287extern "C" {
288#endif
289extern const unsigned long pic32_cpu_clock_hz;
290extern const unsigned long pic32_periph_clock_hz;
291extern void diewith(unsigned long);
292extern unsigned long blinker_pattern;
293#ifdef __cplusplus
294}
295#endif // cplusplus
296#define configASSERT( x ) if (!(x)) diewith(BLINK_DIE_ASSERT)
297#endif // assembly
298
299#else
300
301#error please provide the FreeRTOSConfig.h for your target
302
303#endif // Switch target
304
305/* ***************************************************************************
306 * Common defines used for all targets
307 *************************************************************************** */
308#define configTICK_RATE_HZ ( ( portTickType ) 953 )
309#define NSEC_TO_TICK_SHIFT 20
310#define configUSE_PREEMPTION 1
311#define configUSE_IDLE_HOOK 1
312#define configUSE_TICK_HOOK 0
313
314#define configMAX_TASK_NAME_LEN ( 16 )
315#define configUSE_TRACE_FACILITY 0
316#define configUSE_16_BIT_TICKS 0
317#define configIDLE_SHOULD_YIELD 0
318#define configUSE_MUTEXES 1
319#define configUSE_RECURSIVE_MUTEXES 1
320#define configUSE_COUNTING_SEMAPHORES 1
321#define configUSE_NEWLIB_REENTRANT 1
322#define configUSE_CO_ROUTINES 0
323#ifndef configCHECK_FOR_STACK_OVERFLOW
324#define configCHECK_FOR_STACK_OVERFLOW 2
325#endif
326
327#define configMAX_PRIORITIES ( 5 )
328#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
329
330#define configUSE_APPLICATION_TASK_TAG 1
331
332#define configUSE_TIMERS 1
333#define configTIMER_QUEUE_LENGTH 16
334#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 2)
335#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1
336
337#if tskKERNEL_VERSION_MAJOR >= 9
338#define configSUPPORT_STATIC_ALLOCATION 1
339#define configSUPPORT_DYNAMIC_ALLOCATION 1
340#endif
341
342/* Enable thread local storage, only active on FreeRTOS 9.x+ */
343#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 1
344#define TLS_INDEX_SELECT_EVENT_BIT 0 /* Wakeup event for platform select() */
345
346/* backwards compatibility */
347#if !defined(vPortClearInterruptMask)
348 #define vPortClearInterruptMask(x) vPortSetBASEPRI(x)
349#endif
350
351#define INCLUDE_uxTaskGetStackHighWaterMark 1
352#define INCLUDE_pcTaskGetTaskName 1
353
354/* Set the following definitions to 1 to include the API function, or zero
355to exclude the API function. */
356
357#define INCLUDE_vTaskPrioritySet 1
358#define INCLUDE_uxTaskPriorityGet 1
359#define INCLUDE_vTaskDelete 1
360#define INCLUDE_vTaskCleanUpResources 1
361#define INCLUDE_vTaskSuspend 1
362#define INCLUDE_vTaskDelayUntil 1
363#define INCLUDE_vTaskDelay 1
364#define INCLUDE_xTaskGetIdleTaskHandle 1
365#define INCLUDE_xEventGroupSetBitFromISR 1
366#define INCLUDE_xTimerPendFunctionCall 1
367#ifndef __LANGUAGE_ASSEMBLY__
368#ifndef TARGET_LPC11Cxx
371void cpuload_tick(unsigned);
372//#define traceTASK_INCREMENT_TICK( count ) cpuload_tick()
373#endif
374
375#endif
376
377#ifndef MIPSNO16
378#define MIPSNO16
379#endif
380
381#endif /* FREERTOS_CONFIG_H */
uint32_t blinker_pattern
Stores the canonical pattern for the blinker.
void diewith(uint32_t pattern)
Sets a blinking pattern and never returns.
int g_death_lineno
Captures point of death (line).
Definition os.c:93