1 /*
2  * FreeRTOS V202212.00
3  * Copyright (C) 2020 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  * https://www.FreeRTOS.org
23  * https://github.com/FreeRTOS
24  *
25  */
26 #ifndef FREERTOS_CONFIG_H
27 #define FREERTOS_CONFIG_H
28 
29 #include "unity_internals.h"
30 
31 /*-----------------------------------------------------------
32 * Application specific definitions.
33 *
34 * These definitions should be adjusted for your particular hardware and
35 * application requirements.
36 *
37 * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
38 * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
39 * https://www.FreeRTOS.org/a00110.html
40 *
41 * The bottom of this file contains some constants specific to running the UDP
42 * stack in this demo.  Constants specific to FreeRTOS+TCP itself (rather than
43 * the demo) are contained in FreeRTOSIPConfig.h.
44 *----------------------------------------------------------*/
45 #define configENABLE_BACKWARD_COMPATIBILITY        1
46 #define configUSE_PREEMPTION                       1
47 #define configUSE_PORT_OPTIMISED_TASK_SELECTION    1
48 #define configMAX_PRIORITIES                       ( 7 )
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. */
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. */
51 #define configTOTAL_HEAP_SIZE                      ( ( size_t ) ( 2048U * 1024U ) )
52 #define configMAX_TASK_NAME_LEN                    ( 15 )
53 #define configUSE_TRACE_FACILITY                   1
54 #define configUSE_16_BIT_TICKS                     0
55 #define configIDLE_SHOULD_YIELD                    1
56 #define configUSE_MUTEXES                          1
57 #define configUSE_RECURSIVE_MUTEXES                1
58 #define configQUEUE_REGISTRY_SIZE                  0
59 #define configUSE_APPLICATION_TASK_TAG             1
60 #define configUSE_COUNTING_SEMAPHORES              1
61 #define configUSE_ALTERNATIVE_API                  0
62 #define configNUM_THREAD_LOCAL_STORAGE_POINTERS    3      /* FreeRTOS+FAT requires 2 pointers if a CWD is supported. */
63 #define configRECORD_STACK_HIGH_ADDRESS            1
64 
65 /* Hook function related definitions. */
66 #define configUSE_TICK_HOOK                        0
67 #define configUSE_IDLE_HOOK                        1
68 #define configUSE_MALLOC_FAILED_HOOK               1
69 #define configCHECK_FOR_STACK_OVERFLOW             0      /* Not applicable to the Win32 port. */
70 
71 /* Software timer related definitions. */
72 #define configUSE_TIMERS                           1
73 #define configTIMER_TASK_PRIORITY                  ( configMAX_PRIORITIES - 1 )
74 #define configTIMER_QUEUE_LENGTH                   5
75 #define configTIMER_TASK_STACK_DEPTH               ( configMINIMAL_STACK_SIZE * 2 )
76 
77 /* Event group related definitions. */
78 #define configUSE_EVENT_GROUPS                     1
79 
80 /* Run time stats gathering definitions. */
81 unsigned long ulGetRunTimeCounterValue( void );
82 void vConfigureTimerForRunTimeStats( void );
83 #define configGENERATE_RUN_TIME_STATS    1
84 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()    vConfigureTimerForRunTimeStats()
85 #define portGET_RUN_TIME_COUNTER_VALUE()            ulGetRunTimeCounterValue()
86 
87 /* Currently the TCP/IP stack is using dynamic allocation, and the MQTT task is
88  * using static allocation. */
89 #define configSUPPORT_DYNAMIC_ALLOCATION        1
90 #define configSUPPORT_STATIC_ALLOCATION         1
91 
92 /* Set the following definitions to 1 to include the API function, or zero
93  * to exclude the API function. */
94 #define INCLUDE_vTaskPrioritySet                1
95 #define INCLUDE_uxTaskPriorityGet               1
96 #define INCLUDE_vTaskDelete                     1
97 #define INCLUDE_vTaskCleanUpResources           0
98 #define INCLUDE_vTaskSuspend                    1
99 #define INCLUDE_vTaskDelayUntil                 1
100 #define INCLUDE_vTaskDelay                      1
101 #define INCLUDE_uxTaskGetStackHighWaterMark     1
102 #define INCLUDE_xTaskGetSchedulerState          1
103 #define INCLUDE_xTimerGetTimerTaskHandle        0
104 #define INCLUDE_xTaskGetIdleTaskHandle          0
105 #define INCLUDE_xQueueGetMutexHolder            1
106 #define INCLUDE_eTaskGetState                   1
107 #define INCLUDE_xEventGroupSetBitsFromISR       1
108 #define INCLUDE_xTimerPendFunctionCall          1
109 #define INCLUDE_xTaskGetCurrentTaskHandle       1
110 #define INCLUDE_xTaskAbortDelay                 1
111 
112 /* This demo makes use of one or more example stats formatting functions.  These
113  * format the raw data provided by the uxTaskGetSystemState() function in to human
114  * readable ASCII form.  See the notes in the implementation of vTaskList() within
115  * FreeRTOS/Source/tasks.c for limitations.  configUSE_STATS_FORMATTING_FUNCTIONS
116  * is set to 2 so the formatting functions are included without the stdio.h being
117  * included in tasks.c.  That is because this project defines its own sprintf()
118  * functions. */
119 #define configUSE_STATS_FORMATTING_FUNCTIONS    1
120 
121 /* Assert call defined for debug builds. */
122 void vAssertCalled( const char * pcFile,
123                     uint32_t ulLine );
124 
125 #define configASSERT( x )    if( ( x ) == 0 ) TEST_ABORT( )
126 
127 /* The function that implements FreeRTOS printf style output, and the macro
128  * that maps the configPRINTF() macros to that function. */
129 void vLoggingPrintf( char const * pcFormat,
130                      ... );
131 #define configPRINTF( X )    vLoggingPrintf X
132 
133 /* Non-format version thread-safe print. */
134 extern void vLoggingPrint( const char * pcMessage );
135 #define configPRINT( X )           vLoggingPrint( X )
136 
137 /* Non-format version thread-safe print. */
138 #define configPRINT_STRING( X )    vLoggingPrintf( X )
139 
140 /* Application specific definitions follow. **********************************/
141 
142 /* If configINCLUDE_DEMO_DEBUG_STATS is set to one, then a few basic IP trace
143  * macros are defined to gather some UDP stack statistics that can then be viewed
144  * through the CLI interface. */
145 #define configINCLUDE_DEMO_DEBUG_STATS       1
146 
147 /* The size of the global output buffer that is available for use when there
148  * are multiple command interpreters running at once (for example, one on a UART
149  * and one on TCP/IP).  This is done to prevent an output buffer being defined by
150  * each implementation - which would waste RAM.  In this case, there is only one
151  * command interpreter running, and it has its own local output buffer, so the
152  * global buffer is just set to be one byte long as it is not used and should not
153  * take up unnecessary RAM. */
154 #define configCOMMAND_INT_MAX_OUTPUT_SIZE    1
155 
156 /* Only used when running in the FreeRTOS Windows simulator.  Defines the
157  * priority of the task used to simulate Ethernet interrupts. */
158 #define configMAC_ISR_SIMULATOR_PRIORITY     ( configMAX_PRIORITIES - 1 )
159 
160 /* This demo creates a virtual network connection by accessing the raw Ethernet
161  * or WiFi data to and from a real network connection.  Many computers have more
162  * than one real network port, and configNETWORK_INTERFACE_TO_USE is used to tell
163  * the demo which real port should be used to create the virtual port.  The ports
164  * available are displayed on the console when the application is executed.  For
165  * example, on my development laptop setting configNETWORK_INTERFACE_TO_USE to 4
166  * results in the wired network being used, while setting
167  * configNETWORK_INTERFACE_TO_USE to 2 results in the wireless network being
168  * used. */
169 #define configNETWORK_INTERFACE_TO_USE       ( 0L )
170 
171 /* The address of an echo server that will be used by the two demo echo client
172  * tasks:
173  * https://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_Echo_Clients.html,
174  * https://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/UDP_Echo_Clients.html. */
175 #define configECHO_SERVER_ADDR0              192
176 #define configECHO_SERVER_ADDR1              168
177 #define configECHO_SERVER_ADDR2              2
178 #define configECHO_SERVER_ADDR3              6
179 #define configTCP_ECHO_CLIENT_PORT           7
180 
181 /* Default MAC address configuration.  The demo creates a virtual network
182  * connection that uses this MAC address by accessing the raw Ethernet/WiFi data
183  * to and from a real network connection on the host PC.  See the
184  * configNETWORK_INTERFACE_TO_USE definition above for information on how to
185  * configure the real network connection to use. */
186 #define configMAC_ADDR0                      0x00
187 #define configMAC_ADDR1                      0x11
188 #define configMAC_ADDR2                      0x22
189 #define configMAC_ADDR3                      0x33
190 #define configMAC_ADDR4                      0x44
191 #define configMAC_ADDR5                      0x32
192 
193 /* Default IP address configuration.  Used in ipconfigUSE_DHCP is set to 0, or
194  * ipconfigUSE_DHCP is set to 1 but a DNS server cannot be contacted. */
195 #define configIP_ADDR0                       192
196 #define configIP_ADDR1                       168
197 #define configIP_ADDR2                       0
198 #define configIP_ADDR3                       105
199 
200 /* Default gateway IP address configuration.  Used in ipconfigUSE_DHCP is set to
201  * 0, or ipconfigUSE_DHCP is set to 1 but a DNS server cannot be contacted. */
202 #define configGATEWAY_ADDR0                  192
203 #define configGATEWAY_ADDR1                  168
204 #define configGATEWAY_ADDR2                  0
205 #define configGATEWAY_ADDR3                  1
206 
207 /* Default DNS server configuration.  OpenDNS addresses are 208.67.222.222 and
208  * 208.67.220.220.  Used in ipconfigUSE_DHCP is set to 0, or ipconfigUSE_DHCP is
209  * set to 1 but a DNS server cannot be contacted.*/
210 #define configDNS_SERVER_ADDR0               208
211 #define configDNS_SERVER_ADDR1               67
212 #define configDNS_SERVER_ADDR2               222
213 #define configDNS_SERVER_ADDR3               222
214 
215 /* Default netmask configuration.  Used in ipconfigUSE_DHCP is set to 0, or
216  * ipconfigUSE_DHCP is set to 1 but a DNS server cannot be contacted. */
217 #define configNET_MASK0                      255
218 #define configNET_MASK1                      255
219 #define configNET_MASK2                      255
220 #define configNET_MASK3                      0
221 
222 /* The UDP port to which print messages are sent. */
223 #define configPRINT_PORT                     ( 15000 )
224 
225 #define configPROFILING                      ( 0 )
226 
227 /* Pseudo random number generator used by some demo tasks. */
228 extern uint32_t ulRand();
229 #define configRAND32()    ulRand()
230 
231 /* The platform that FreeRTOS is running on. */
232 #define configPLATFORM_NAME    "WinSim"
233 
234 
235 #endif /* FREERTOS_CONFIG_H */
236