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