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