]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Demo/FreeRTOS_Plus_TCP_Minimal_Windows_Simulator/FreeRTOSConfig.h
commit 9f316c246baafa15c542a5aea81a94f26e3d6507
[freertos] / FreeRTOS-Plus / Demo / FreeRTOS_Plus_TCP_Minimal_Windows_Simulator / FreeRTOSConfig.h
1 /*\r
2  * FreeRTOS Kernel V10.3.0\r
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
6  * this software and associated documentation files (the "Software"), to deal in\r
7  * the Software without restriction, including without limitation the rights to\r
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
9  * the Software, and to permit persons to whom the Software is furnished to do so,\r
10  * subject to the following conditions:\r
11  *\r
12  * The above copyright notice and this permission notice shall be included in all\r
13  * copies or substantial portions of the Software.\r
14  *\r
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
21  *\r
22  * http://www.FreeRTOS.org\r
23  * http://aws.amazon.com/freertos\r
24  *\r
25  * 1 tab == 4 spaces!\r
26  */\r
27 \r
28 #ifndef FREERTOS_CONFIG_H\r
29 #define FREERTOS_CONFIG_H\r
30 \r
31 /*-----------------------------------------------------------\r
32  * Application specific definitions.\r
33  *\r
34  * These definitions should be adjusted for your particular hardware and\r
35  * application requirements.\r
36  *\r
37  * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
38  * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
39  * http://www.freertos.org/a00110.html\r
40  *\r
41  * The bottom of this file contains some constants specific to running the UDP\r
42  * stack in this demo.  Constants specific to FreeRTOS+TCP itself (rather than\r
43  * the demo) are contained in FreeRTOSIPConfig.h.\r
44  *----------------------------------------------------------*/\r
45 #define configENABLE_BACKWARD_COMPATIBILITY             1\r
46 #define configUSE_PREEMPTION                                    1\r
47 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
48 #define configMAX_PRIORITIES                                    ( 7 )\r
49 #define configTICK_RATE_HZ                                              ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
50 #define configMINIMAL_STACK_SIZE                                ( ( unsigned short ) 60 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the Win32 thread. */\r
51 #define configTOTAL_HEAP_SIZE                                   ( ( size_t ) ( 2048U * 1024U ) )\r
52 #define configMAX_TASK_NAME_LEN                                 ( 15 )\r
53 #define configUSE_TRACE_FACILITY                                1\r
54 #define configUSE_16_BIT_TICKS                                  0\r
55 #define configIDLE_SHOULD_YIELD                                 1\r
56 #define configUSE_CO_ROUTINES                                   0\r
57 #define configUSE_MUTEXES                                               1\r
58 #define configUSE_RECURSIVE_MUTEXES                             1\r
59 #define configQUEUE_REGISTRY_SIZE                               0\r
60 #define configUSE_APPLICATION_TASK_TAG                  0\r
61 #define configUSE_COUNTING_SEMAPHORES                   1\r
62 #define configUSE_ALTERNATIVE_API                               0\r
63 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 3 /* FreeRTOS+FAT requires 2 pointers if a CWD is supported. */\r
64 \r
65 /* Hook function related definitions. */\r
66 #define configUSE_TICK_HOOK                             0\r
67 #define configUSE_IDLE_HOOK                             1\r
68 #define configUSE_MALLOC_FAILED_HOOK    1\r
69 #define configCHECK_FOR_STACK_OVERFLOW  0 /* Not applicable to the Win32 port. */\r
70 \r
71 /* Software timer related definitions. */\r
72 #define configUSE_TIMERS                                1\r
73 #define configTIMER_TASK_PRIORITY               ( configMAX_PRIORITIES - 1 )\r
74 #define configTIMER_QUEUE_LENGTH                5\r
75 #define configTIMER_TASK_STACK_DEPTH    ( configMINIMAL_STACK_SIZE * 2 )\r
76 \r
77 /* Event group related definitions. */\r
78 #define configUSE_EVENT_GROUPS                  1\r
79 \r
80 /* Run time stats gathering definitions. */\r
81 #define configGENERATE_RUN_TIME_STATS   0\r
82 \r
83 /* Co-routine definitions. */\r
84 #define configUSE_CO_ROUTINES                   0\r
85 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
86 \r
87 /* Set the following definitions to 1 to include the API function, or zero\r
88 to exclude the API function. */\r
89 #define INCLUDE_vTaskPrioritySet                                1\r
90 #define INCLUDE_uxTaskPriorityGet                               1\r
91 #define INCLUDE_vTaskDelete                                             1\r
92 #define INCLUDE_vTaskCleanUpResources                   0\r
93 #define INCLUDE_vTaskSuspend                                    1\r
94 #define INCLUDE_vTaskDelayUntil                                 1\r
95 #define INCLUDE_vTaskDelay                                              1\r
96 #define INCLUDE_uxTaskGetStackHighWaterMark             1\r
97 #define INCLUDE_xTaskGetSchedulerState                  1\r
98 #define INCLUDE_xTimerGetTimerTaskHandle                0\r
99 #define INCLUDE_xTaskGetIdleTaskHandle                  0\r
100 #define INCLUDE_xQueueGetMutexHolder                    1\r
101 #define INCLUDE_eTaskGetState                                   1\r
102 #define INCLUDE_xEventGroupSetBitsFromISR               1\r
103 #define INCLUDE_xTimerPendFunctionCall                  1\r
104 #define INCLUDE_pcTaskGetTaskName                               1\r
105 \r
106 /* This demo makes use of one or more example stats formatting functions.  These\r
107 format the raw data provided by the uxTaskGetSystemState() function in to human\r
108 readable ASCII form.  See the notes in the implementation of vTaskList() within\r
109 FreeRTOS/Source/tasks.c for limitations.  configUSE_STATS_FORMATTING_FUNCTIONS\r
110 is set to 2 so the formatting functions are included without the stdio.h being\r
111 included in tasks.c.  That is because this project defines its own sprintf()\r
112 functions. */\r
113 #define configUSE_STATS_FORMATTING_FUNCTIONS    1\r
114 \r
115 /* Assert call defined for debug builds. */\r
116 #ifdef _DEBUG\r
117         extern void vAssertCalled( const char *pcFile, uint32_t ulLine );\r
118         #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )\r
119 #endif /* _DEBUG */\r
120 \r
121 \r
122 \r
123 /* Application specific definitions follow. **********************************/\r
124 \r
125 /* If configINCLUDE_DEMO_DEBUG_STATS is set to one, then a few basic IP trace\r
126 macros are defined to gather some UDP stack statistics that can then be viewed\r
127 through the CLI interface. */\r
128 #define configINCLUDE_DEMO_DEBUG_STATS 1\r
129 \r
130 /* The size of the global output buffer that is available for use when there\r
131 are multiple command interpreters running at once (for example, one on a UART\r
132 and one on TCP/IP).  This is done to prevent an output buffer being defined by\r
133 each implementation - which would waste RAM.  In this case, there is only one\r
134 command interpreter running, and it has its own local output buffer, so the\r
135 global buffer is just set to be one byte long as it is not used and should not\r
136 take up unnecessary RAM. */\r
137 #define configCOMMAND_INT_MAX_OUTPUT_SIZE 1\r
138 \r
139 /* Only used when running in the FreeRTOS Windows simulator.  Defines the\r
140 priority of the task used to simulate Ethernet interrupts. */\r
141 #define configMAC_ISR_SIMULATOR_PRIORITY        ( configMAX_PRIORITIES - 1 )\r
142 \r
143 /* This demo creates a virtual network connection by accessing the raw Ethernet\r
144 or WiFi data to and from a real network connection.  Many computers have more\r
145 than one real network port, and configNETWORK_INTERFACE_TO_USE is used to tell\r
146 the demo which real port should be used to create the virtual port.  The ports\r
147 available are displayed on the console when the application is executed.  For\r
148 example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 4\r
149 results in the wired network being used, while setting\r
150 configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being\r
151 used. */\r
152 #define configNETWORK_INTERFACE_TO_USE 2L\r
153 \r
154 /* The address of an echo server that will be used by the two demo echo client\r
155 tasks.\r
156 http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Echo_Clients.html\r
157 http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/UDP_Echo_Clients.html */\r
158 #define configECHO_SERVER_ADDR0 192\r
159 #define configECHO_SERVER_ADDR1 168\r
160 #define configECHO_SERVER_ADDR2 0\r
161 #define configECHO_SERVER_ADDR3 11\r
162 \r
163 /* Default MAC address configuration.  The demo creates a virtual network\r
164 connection that uses this MAC address by accessing the raw Ethernet/WiFi data\r
165 to and from a real network connection on the host PC.  See the\r
166 configNETWORK_INTERFACE_TO_USE definition above for information on how to\r
167 configure the real network connection to use. */\r
168 #define configMAC_ADDR0         0x00\r
169 #define configMAC_ADDR1         0x11\r
170 #define configMAC_ADDR2         0x22\r
171 #define configMAC_ADDR3         0x33\r
172 #define configMAC_ADDR4         0x44\r
173 #define configMAC_ADDR5         0x41\r
174 \r
175 /* Default IP address configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
176 ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
177 #define configIP_ADDR0          10\r
178 #define configIP_ADDR1          10\r
179 #define configIP_ADDR2          10\r
180 #define configIP_ADDR3          200\r
181 \r
182 /* Default gateway IP address configuration.  Used in ipconfigUSE_DNS is set to\r
183 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
184 #define configGATEWAY_ADDR0     10\r
185 #define configGATEWAY_ADDR1     10\r
186 #define configGATEWAY_ADDR2     10\r
187 #define configGATEWAY_ADDR3     1\r
188 \r
189 /* Default DNS server configuration.  OpenDNS addresses are 208.67.222.222 and\r
190 208.67.220.220.  Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set\r
191 to 1 but a DNS server cannot be contacted.*/\r
192 #define configDNS_SERVER_ADDR0  208\r
193 #define configDNS_SERVER_ADDR1  67\r
194 #define configDNS_SERVER_ADDR2  222\r
195 #define configDNS_SERVER_ADDR3  222\r
196 \r
197 /* Default netmask configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
198 ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
199 #define configNET_MASK0         255\r
200 #define configNET_MASK1         0\r
201 #define configNET_MASK2         0\r
202 #define configNET_MASK3         0\r
203 \r
204 /* The UDP port to which print messages are sent. */\r
205 #define configPRINT_PORT        ( 15000 )\r
206 \r
207 #if( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )\r
208         /* Map to Windows names. */\r
209         #define snprintf        _snprintf\r
210         #define vsnprintf       _vsnprintf\r
211 #endif\r
212 \r
213 /* Visual studio does not have an implementation of strcasecmp(). */\r
214 #define strcasecmp _stricmp\r
215 #define strncasecmp _strnicmp\r
216 #define strcmpi _strcmpi\r
217 \r
218 #endif /* FREERTOS_CONFIG_H */\r
219 \r