]> git.sur5r.net Git - freertos/blob - FreeRTOS-Labs/Demo/FreeRTOS_IoT_Libraries/mqtt/mqtt_basic_tls_server_auth/FreeRTOSConfig.h
d58a0b80fdb49386f1db8dc42ce420e8ebbb032c
[freertos] / FreeRTOS-Labs / Demo / FreeRTOS_IoT_Libraries / mqtt / mqtt_basic_tls_server_auth / FreeRTOSConfig.h
1 /*\r
2  * FreeRTOS Kernel V10.2.1\r
3  * Copyright (C) 2019 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 configUSE_PREEMPTION                                    1\r
46 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1\r
47 #define configMAX_PRIORITIES                                    ( 7 )\r
48 #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
49 #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
50 #define configTOTAL_HEAP_SIZE                                   ( ( size_t ) ( 2048U * 1024U ) )\r
51 #define configMAX_TASK_NAME_LEN                                 ( 15 )\r
52 #define configUSE_TRACE_FACILITY                                1\r
53 #define configUSE_16_BIT_TICKS                                  0\r
54 #define configIDLE_SHOULD_YIELD                                 1\r
55 #define configUSE_CO_ROUTINES                                   0\r
56 #define configUSE_MUTEXES                                               1\r
57 #define configUSE_RECURSIVE_MUTEXES                             1\r
58 #define configQUEUE_REGISTRY_SIZE                               0\r
59 #define configUSE_APPLICATION_TASK_TAG                  0\r
60 #define configUSE_COUNTING_SEMAPHORES                   1\r
61 #define configUSE_ALTERNATIVE_API                               0\r
62 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0\r
63 #define configENABLE_BACKWARD_COMPATIBILITY             1\r
64 #define configSUPPORT_STATIC_ALLOCATION                 1\r
65 \r
66 /* Hook function related definitions. */\r
67 #define configUSE_TICK_HOOK                             0\r
68 #define configUSE_IDLE_HOOK                             0\r
69 #define configUSE_MALLOC_FAILED_HOOK    0\r
70 #define configCHECK_FOR_STACK_OVERFLOW  0 /* Not applicable to the Win32 port. */\r
71 \r
72 /* Software timer related definitions. */\r
73 #define configUSE_TIMERS                                1\r
74 #define configTIMER_TASK_PRIORITY               ( configMAX_PRIORITIES - 1 )\r
75 #define configTIMER_QUEUE_LENGTH                5\r
76 #define configTIMER_TASK_STACK_DEPTH    ( configMINIMAL_STACK_SIZE * 2 )\r
77 \r
78 /* Event group related definitions. */\r
79 #define configUSE_EVENT_GROUPS                  1\r
80 \r
81 /* Run time stats gathering definitions. */\r
82 #define configGENERATE_RUN_TIME_STATS   0\r
83 \r
84 /* Co-routine definitions. */\r
85 #define configUSE_CO_ROUTINES                   0\r
86 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
87 \r
88 /* Set the following definitions to 1 to include the API function, or zero\r
89 to exclude the API function. */\r
90 #define INCLUDE_vTaskPrioritySet                                1\r
91 #define INCLUDE_uxTaskPriorityGet                               1\r
92 #define INCLUDE_vTaskDelete                                             1\r
93 #define INCLUDE_vTaskCleanUpResources                   0\r
94 #define INCLUDE_vTaskSuspend                                    1\r
95 #define INCLUDE_vTaskDelayUntil                                 1\r
96 #define INCLUDE_vTaskDelay                                              1\r
97 #define INCLUDE_uxTaskGetStackHighWaterMark             1\r
98 #define INCLUDE_xTaskGetSchedulerState                  1\r
99 #define INCLUDE_xTimerGetTimerTaskHandle                0\r
100 #define INCLUDE_xTaskGetIdleTaskHandle                  0\r
101 #define INCLUDE_xQueueGetMutexHolder                    1\r
102 #define INCLUDE_eTaskGetState                                   1\r
103 #define INCLUDE_xEventGroupSetBitsFromISR               1\r
104 #define INCLUDE_xTimerPendFunctionCall                  1\r
105 #define INCLUDE_pcTaskGetTaskName                               1\r
106 \r
107 /* This demo makes use of one or more example stats formatting functions.  These\r
108 format the raw data provided by the uxTaskGetSystemState() function in to human\r
109 readable ASCII form.  See the notes in the implementation of vTaskList() within\r
110 FreeRTOS/Source/tasks.c for limitations.  configUSE_STATS_FORMATTING_FUNCTIONS\r
111 is set to 2 so the formatting functions are included without the stdio.h being\r
112 included in tasks.c.  That is because this project defines its own sprintf()\r
113 functions. */\r
114 #define configUSE_STATS_FORMATTING_FUNCTIONS    1\r
115 \r
116 /* Assert call defined for debug builds. */\r
117 #ifdef _DEBUG\r
118         extern void vAssertCalled( const char *pcFile, uint32_t ulLine );\r
119         #define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __FILE__, __LINE__ )\r
120 #endif /* _DEBUG */\r
121 \r
122 \r
123 \r
124 /* Application specific definitions follow. **********************************/\r
125 \r
126 /* Only used when running in the FreeRTOS Windows simulator.  Defines the\r
127 priority of the task used to simulate Ethernet interrupts. */\r
128 #define configMAC_ISR_SIMULATOR_PRIORITY        ( configMAX_PRIORITIES - 1 )\r
129 \r
130 /* This demo creates a virtual network connection by accessing the raw Ethernet\r
131 or WiFi data to and from a real network connection.  Many computers have more\r
132 than one real network port, and configNETWORK_INTERFACE_TO_USE is used to tell\r
133 the demo which real port should be used to create the virtual port.  The ports\r
134 available are displayed on the console when the application is executed.  For\r
135 example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 4\r
136 results in the wired network being used, while setting\r
137 configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being\r
138 used. */\r
139 #define configNETWORK_INTERFACE_TO_USE 1L\r
140 \r
141 /* The address of an echo server is only left in this project as it doubles as\r
142 the address to which logging is sent should UDP logging be enabled. */\r
143 #define configECHO_SERVER_ADDR0 192\r
144 #define configECHO_SERVER_ADDR1 168\r
145 #define configECHO_SERVER_ADDR2 0\r
146 #define configECHO_SERVER_ADDR3 11\r
147 \r
148 /* Default MAC address configuration.  The demo creates a virtual network\r
149 connection that uses this MAC address by accessing the raw Ethernet/WiFi data\r
150 to and from a real network connection on the host PC.  See the\r
151 configNETWORK_INTERFACE_TO_USE definition above for information on how to\r
152 configure the real network connection to use. */\r
153 #define configMAC_ADDR0         0x00\r
154 #define configMAC_ADDR1         0x11\r
155 #define configMAC_ADDR2         0x11\r
156 #define configMAC_ADDR3         0x11\r
157 #define configMAC_ADDR4         0x11\r
158 #define configMAC_ADDR5         0x41\r
159 \r
160 /* Default IP address configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
161 ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
162 #define configIP_ADDR0          10\r
163 #define configIP_ADDR1          10\r
164 #define configIP_ADDR2          10\r
165 #define configIP_ADDR3          200\r
166 \r
167 /* Default gateway IP address configuration.  Used in ipconfigUSE_DNS is set to\r
168 0, or ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
169 #define configGATEWAY_ADDR0     10\r
170 #define configGATEWAY_ADDR1     10\r
171 #define configGATEWAY_ADDR2     10\r
172 #define configGATEWAY_ADDR3     1\r
173 \r
174 /* Default DNS server configuration.  OpenDNS addresses are 208.67.222.222 and\r
175 208.67.220.220.  Used in ipconfigUSE_DNS is set to 0, or ipconfigUSE_DNS is set\r
176 to 1 but a DNS server cannot be contacted.*/\r
177 #define configDNS_SERVER_ADDR0  208\r
178 #define configDNS_SERVER_ADDR1  67\r
179 #define configDNS_SERVER_ADDR2  222\r
180 #define configDNS_SERVER_ADDR3  222\r
181 \r
182 /* Default netmask configuration.  Used in ipconfigUSE_DNS is set to 0, or\r
183 ipconfigUSE_DNS is set to 1 but a DNS server cannot be contacted. */\r
184 #define configNET_MASK0         255\r
185 #define configNET_MASK1         0\r
186 #define configNET_MASK2         0\r
187 #define configNET_MASK3         0\r
188 \r
189 /* The UDP port to which print messages are sent. */\r
190 #define configPRINT_PORT        ( 15000 )\r
191 \r
192 #if( defined( _MSC_VER ) && ( _MSC_VER <= 1600 ) && !defined( snprintf ) )\r
193         /* Map to Windows names. */\r
194         #define snprintf        _snprintf\r
195         #define vsnprintf       _vsnprintf\r
196 #endif\r
197 \r
198 /* Visual studio does not have an implementation of strcasecmp(). */\r
199 #define strcasecmp _stricmp\r
200 #define strncasecmp _strnicmp\r
201 #define strcmpi _strcmpi\r
202 \r
203 /* Prototype for the function used to print out.  In this case it prints to the\r
204 console before the network is connected then a UDP port after the network has\r
205 connected. */\r
206 extern void vLoggingPrintf( const char *pcFormatString, ... );\r
207 #define configPRINTF( X )    vLoggingPrintf X\r
208 \r
209 #endif /* FREERTOS_CONFIG_H */\r
210 \r