]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC/FreeRTOSConfig.h
Update version numbers to V7.4.1.
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_UDP_and_CLI_LPC1830_GCC / FreeRTOSConfig.h
1 /*\r
2     FreeRTOS V7.4.1 - Copyright (C) 2013 Real Time Engineers Ltd.\r
3 \r
4     FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
5     http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     ***************************************************************************\r
8      *                                                                       *\r
9      *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
10      *    Complete, revised, and edited pdf reference manuals are also       *\r
11      *    available.                                                         *\r
12      *                                                                       *\r
13      *    Purchasing FreeRTOS documentation will not only help you, by       *\r
14      *    ensuring you get running as quickly as possible and with an        *\r
15      *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
16      *    the FreeRTOS project to continue with its mission of providing     *\r
17      *    professional grade, cross platform, de facto standard solutions    *\r
18      *    for microcontrollers - completely free of charge!                  *\r
19      *                                                                       *\r
20      *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
21      *                                                                       *\r
22      *    Thank you for using FreeRTOS, and thank you for your support!      *\r
23      *                                                                       *\r
24     ***************************************************************************\r
25 \r
26 \r
27     This file is part of the FreeRTOS distribution.\r
28 \r
29     FreeRTOS is free software; you can redistribute it and/or modify it under\r
30     the terms of the GNU General Public License (version 2) as published by the\r
31     Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
32 \r
33     >>>>>>NOTE<<<<<< The modification to the GPL is included to allow you to\r
34     distribute a combined work that includes FreeRTOS without being obliged to\r
35     provide the source code for proprietary components outside of the FreeRTOS\r
36     kernel.\r
37 \r
38     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
39     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
40     FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more\r
41     details. You should have received a copy of the GNU General Public License\r
42     and the FreeRTOS license exception along with FreeRTOS; if not it can be\r
43     viewed here: http://www.freertos.org/a00114.html and also obtained by\r
44     writing to Real Time Engineers Ltd., contact details for whom are available\r
45     on the FreeRTOS WEB site.\r
46 \r
47     1 tab == 4 spaces!\r
48 \r
49     ***************************************************************************\r
50      *                                                                       *\r
51      *    Having a problem?  Start by reading the FAQ "My application does   *\r
52      *    not run, what could be wrong?"                                     *\r
53      *                                                                       *\r
54      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
55      *                                                                       *\r
56     ***************************************************************************\r
57 \r
58 \r
59     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
60     license and Real Time Engineers Ltd. contact details.\r
61 \r
62     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
63     including FreeRTOS+Trace - an indispensable productivity tool, and our new\r
64     fully thread aware and reentrant UDP/IP stack.\r
65 \r
66     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
67     Integrity Systems, who sell the code with commercial support,\r
68     indemnification and middleware, under the OpenRTOS brand.\r
69 \r
70     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
71     engineered and independently SIL3 certified version for use in safety and\r
72     mission critical applications that require provable dependability.\r
73 */\r
74 \r
75 #ifndef FREERTOS_CONFIG_H\r
76 #define FREERTOS_CONFIG_H\r
77 \r
78 #include <stdint.h>\r
79 extern uint32_t SystemCoreClock;\r
80 \r
81 /*-----------------------------------------------------------\r
82  * Application specific definitions.\r
83  *\r
84  * These definitions should be adjusted for your particular hardware and\r
85  * application requirements.\r
86  *\r
87  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
88  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
89  * http://www.freertos.org/a00110.html\r
90  *\r
91  * The bottom of this file contains some constants specific to running the UDP\r
92  * stack in this demo.  Constants specific to FreeRTOS+UDP itself (rather than\r
93  * the demo) are contained in FreeRTOSIPConfig.h.\r
94  *----------------------------------------------------------*/\r
95 \r
96 #define configUSE_PREEMPTION                    1\r
97 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
98 #define configUSE_TICKLESS_IDLE                 0\r
99 #define configMAX_PRIORITIES                    ( 7 )\r
100 #define configCPU_CLOCK_HZ                              ( SystemCoreClock )\r
101 #define configTICK_RATE_HZ                              100\r
102 #define configMINIMAL_STACK_SIZE                ( ( unsigned short ) 300 )\r
103 #define configTOTAL_HEAP_SIZE                   ( ( size_t ) ( 40 * 1024 ) ) /* Has not effect in this demo as the heap is manually pointed to AHB RAM. */\r
104 #define configMAX_TASK_NAME_LEN                 ( 12 )\r
105 #define configIDLE_SHOULD_YIELD                 0\r
106 #define configQUEUE_REGISTRY_SIZE               10\r
107 #define configUSE_TRACE_FACILITY                1\r
108 #define configUSE_16_BIT_TICKS                  0\r
109 #define configUSE_MUTEXES                               1\r
110 #define configUSE_CO_ROUTINES                   0\r
111 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
112 #define configUSE_COUNTING_SEMAPHORES   1\r
113 #define configUSE_ALTERNATIVE_API               0\r
114 #define configUSE_RECURSIVE_MUTEXES             1\r
115 \r
116 /* Hook function related definitions. */\r
117 #define configUSE_TICK_HOOK                             0\r
118 #define configUSE_IDLE_HOOK                             0\r
119 #define configUSE_MALLOC_FAILED_HOOK    1\r
120 #define configCHECK_FOR_STACK_OVERFLOW  2\r
121 \r
122 /* Software timer related definitions. */\r
123 #define configUSE_TIMERS                                1\r
124 #define configTIMER_TASK_PRIORITY               ( configMAX_PRIORITIES - 1 )\r
125 #define configTIMER_QUEUE_LENGTH                5\r
126 #define configTIMER_TASK_STACK_DEPTH    configMINIMAL_STACK_SIZE\r
127 \r
128 /* Run time stats gathering definitions. */\r
129 void vMainConfigureTimerForRunTimeStats( void );\r
130 uint32_t ulMainGetRunTimeCounterValue( void );\r
131 #define configGENERATE_RUN_TIME_STATS   1\r
132 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vMainConfigureTimerForRunTimeStats()\r
133 #define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()\r
134 \r
135 /* Set the following definitions to 1 to include the API function, or zero\r
136 to exclude the API function. */\r
137 #define INCLUDE_vTaskPrioritySet                        1\r
138 #define INCLUDE_uxTaskPriorityGet                       1\r
139 #define INCLUDE_vTaskDelete                                     1\r
140 #define INCLUDE_vTaskCleanUpResources           0\r
141 #define INCLUDE_vTaskSuspend                            1\r
142 #define INCLUDE_vTaskDelayUntil                         1\r
143 #define INCLUDE_vTaskDelay                                      1\r
144 #define INCLUDE_uxTaskGetStackHighWaterMark     1\r
145 #define INCLUDE_xTimerGetTimerTaskHandle        0\r
146 #define INCLUDE_xTaskGetIdleTaskHandle          0\r
147 #define INCLUDE_xQueueGetMutexHolder            1\r
148 \r
149 /* Assert statement defined for debug builds. */\r
150 #ifdef DEBUG\r
151         #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }\r
152 #endif\r
153 \r
154 /* Interrupt priority configuration settings follow.\r
155 http://www.freertos.org/RTOS-Cortex-M3-M4.html */\r
156 \r
157 /* Use the system definition for the number of interrupt priorities, if there\r
158 is one */\r
159 #ifdef __NVIC_PRIO_BITS\r
160         #define configPRIO_BITS       __NVIC_PRIO_BITS\r
161 #else\r
162         #define configPRIO_BITS       5        /* 32 priority levels */\r
163 #endif\r
164 \r
165 /* The maximum priority an interrupt that uses an interrupt safe FreeRTOS API\r
166 function can have.  Note that lower priority have numerically higher values.  */\r
167 #define configMAX_LIBRARY_INTERRUPT_PRIORITY    ( 5 )\r
168 \r
169 /* The minimum possible interrupt priority. */\r
170 #define configMIN_LIBRARY_INTERRUPT_PRIORITY    ( 31 )\r
171 \r
172 /* The lowest priority. */\r
173 #define configKERNEL_INTERRUPT_PRIORITY                 ( configMIN_LIBRARY_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )\r
174 \r
175 /* Priority 5, or 248 as only the top five bits are implemented. */\r
176 #define configMAX_SYSCALL_INTERRUPT_PRIORITY    ( configMAX_LIBRARY_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )\r
177 \r
178 /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS\r
179 standard names. */\r
180 #define vPortSVCHandler SVCall_Handler\r
181 #define xPortPendSVHandler PendSV_Handler\r
182 #define xPortSysTickHandler SysTick_Handler\r
183 \r
184 \r
185 \r
186 \r
187 /*\r
188  * DEMO APPLICATION SPECIFIC DEFINITIONS FOLLOW FROM HERE\r
189  */\r
190 \r
191 /* Set to 1 to include "trace start" and "trace stop" CLI commands.  These\r
192 commands start and stop the FreeRTOS+Trace recording. */\r
193 #define configINCLUDE_TRACE_RELATED_CLI_COMMANDS 0\r
194 \r
195 /* Dimensions a buffer that can be used by the FreeRTOS+CLI command\r
196 interpreter.  See the FreeRTOS+CLI documentation for more information:\r
197 http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/ */\r
198 #define configCOMMAND_INT_MAX_OUTPUT_SIZE               1024\r
199 \r
200 /* The priority used by the Ethernet MAC driver interrupt. */\r
201 #define configMAC_INTERRUPT_PRIORITY            ( configMAX_LIBRARY_INTERRUPT_PRIORITY )\r
202 \r
203 /* If configINCLUDE_DEMO_DEBUG_STATS is set to one, then a few basic IP trace\r
204 macros are defined to gather some UDP stack statistics that can then be viewed\r
205 through the CLI interface.  See\r
206 http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/UDP_IP_Trace.shtml*/\r
207 #define configINCLUDE_DEMO_DEBUG_STATS 1\r
208 \r
209 /* The LPC1830 Ethernet peripheral uses a DMA to transmit and receive packets.\r
210 The DMA uses a chain of descriptors to reference Ethernet buffers, and provide\r
211 information on the state of each buffer (full/empty/error/etc.).\r
212 configNUM_RX_ETHERNET_DMA_DESCRIPTORS defines the total number of receive\r
213 descriptors (descriptors that point to buffers into which the DMA will write\r
214 packets received from the network).  An Ethernet buffer is assigned to each\r
215 descriptor.  Having too few descriptors will impact reliability because the DMA\r
216 will have to drop packets that are received when there are no receive\r
217 descriptors free.  It is however only necessary to have a couple of free\r
218 descriptors at a time, and having more wastes the RAM used by the Ethernet\r
219 buffers that are surplus to requirements. */\r
220 #define configNUM_RX_ETHERNET_DMA_DESCRIPTORS   4\r
221 \r
222 /* The LPC1830 Ethernet peripheral uses a DMA to transmit and receive packets.\r
223 The DMA uses a chain of descriptors to reference Ethernet buffers that are\r
224 waiting to be sent onto the network.  configNUM_TX_ETHERNET_DMA_DESCRIPTORS\r
225 defines the total number of transmit descriptors.  An Ethernet buffer is\r
226 not assigned to a transmit descriptor until data is actually sent, but will\r
227 remain assigned to the descriptor until the descriptor is re-used.  It is not\r
228 necessary to have many transmit descriptors as the IP stack task will be held\r
229 in the Blocked state (so other tasks can run) until a descriptor becomes\r
230 available if it attempts to transmit when all the descriptors are in use.  See\r
231 the iptraceWAITING_FOR_TX_DMA_DESCRIPTOR() IP trace macro. */\r
232 #define configNUM_TX_ETHERNET_DMA_DESCRIPTORS   1\r
233 \r
234 /* The address of an echo server that will be used by the two demo echo client\r
235 tasks.\r
236 http://localhost/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Examples/Common_Echo_Clients.shtml */\r
237 #define configECHO_SERVER_ADDR0 172\r
238 #define configECHO_SERVER_ADDR1 25\r
239 #define configECHO_SERVER_ADDR2 218\r
240 #define configECHO_SERVER_ADDR3 103\r
241 \r
242 /* MAC address configuration.  In a deployed production system this would\r
243 probably be read from an EEPROM.  In the demo it is just hard coded.  Make sure\r
244 each node on the network has a unique MAC address. */\r
245 #define configMAC_ADDR0 0x00\r
246 #define configMAC_ADDR1 0x01\r
247 #define configMAC_ADDR2 0x02\r
248 #define configMAC_ADDR3 0x03\r
249 #define configMAC_ADDR4 0x04\r
250 #define configMAC_ADDR5 0x08\r
251 \r
252 /* Default IP address configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
253 ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
254 #define configIP_ADDR0          192\r
255 #define configIP_ADDR1          168\r
256 #define configIP_ADDR2          1\r
257 #define configIP_ADDR3          125\r
258 \r
259 /* Default gateway IP address configuration.  Used in ipconfigUSE_DNS is set to\r
260 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
261 #define configGATEWAY_ADDR0     192\r
262 #define configGATEWAY_ADDR1     168\r
263 #define configGATEWAY_ADDR2     1\r
264 #define configGATEWAY_ADDR3     1\r
265 \r
266 /* Default DNS server configuration.  OpenDNS addresses are 208.67.222.222 and\r
267 208.67.220.220.  Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set\r
268 to 1 but a DNS server cannot be contacted.*/\r
269 #define configDNS_SERVER_ADDR0  208\r
270 #define configDNS_SERVER_ADDR1  67\r
271 #define configDNS_SERVER_ADDR2  222\r
272 #define configDNS_SERVER_ADDR3  222\r
273 \r
274 /* Defalt netmask configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
275 ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
276 #define configNET_MASK0         255\r
277 #define configNET_MASK1         255\r
278 #define configNET_MASK2         255\r
279 #define configNET_MASK3         0\r
280 \r
281 #if configINCLUDE_TRACE_RELATED_CLI_COMMANDS == 1\r
282         /* Only include the trace macro definitions required by FreeRTOS+Trace is\r
283         the trace start and trace stop CLI commands are included. */\r
284         #include "trcHooks.h"\r
285 #endif\r
286 \r
287 #endif /* FREERTOS_CONFIG_H */\r