]> begriffs open source - freertos/blob - include/FreeRTOS.h
Add assert to catch invalid task priority (#292)
[freertos] / include / FreeRTOS.h
1 /*\r
2  * FreeRTOS Kernel V10.4.3\r
3  * Copyright (C) 2020 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  * https://www.FreeRTOS.org\r
23  * https://github.com/FreeRTOS\r
24  *\r
25  */\r
26 \r
27 #ifndef INC_FREERTOS_H\r
28 #define INC_FREERTOS_H\r
29 \r
30 /*\r
31  * Include the generic headers required for the FreeRTOS port being used.\r
32  */\r
33 #include <stddef.h>\r
34 \r
35 /*\r
36  * If stdint.h cannot be located then:\r
37  *   + If using GCC ensure the -nostdint options is *not* being used.\r
38  *   + Ensure the project's include path includes the directory in which your\r
39  *     compiler stores stdint.h.\r
40  *   + Set any compiler options necessary for it to support C99, as technically\r
41  *     stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any\r
42  *     other way).\r
43  *   + The FreeRTOS download includes a simple stdint.h definition that can be\r
44  *     used in cases where none is provided by the compiler.  The files only\r
45  *     contains the typedefs required to build FreeRTOS.  Read the instructions\r
46  *     in FreeRTOS/source/stdint.readme for more information.\r
47  */\r
48 #include <stdint.h>     /* READ COMMENT ABOVE. */\r
49 \r
50 /* *INDENT-OFF* */\r
51 #ifdef __cplusplus\r
52     extern "C" {\r
53 #endif\r
54 /* *INDENT-ON* */\r
55 \r
56 /* Application specific configuration options. */\r
57 #include "FreeRTOSConfig.h"\r
58 \r
59 /* Basic FreeRTOS definitions. */\r
60 #include "projdefs.h"\r
61 \r
62 /* Definitions specific to the port being used. */\r
63 #include "portable.h"\r
64 \r
65 /* Must be defaulted before configUSE_NEWLIB_REENTRANT is used below. */\r
66 #ifndef configUSE_NEWLIB_REENTRANT\r
67     #define configUSE_NEWLIB_REENTRANT    0\r
68 #endif\r
69 \r
70 /* Required if struct _reent is used. */\r
71 #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
72     #include <reent.h>\r
73 #endif\r
74 \r
75 /*\r
76  * Check all the required application specific macros have been defined.\r
77  * These macros are application specific and (as downloaded) are defined\r
78  * within FreeRTOSConfig.h.\r
79  */\r
80 \r
81 #ifndef configMINIMAL_STACK_SIZE\r
82     #error Missing definition:  configMINIMAL_STACK_SIZE must be defined in FreeRTOSConfig.h.  configMINIMAL_STACK_SIZE defines the size (in words) of the stack allocated to the idle task.  Refer to the demo project provided for your port for a suitable value.\r
83 #endif\r
84 \r
85 #ifndef configMAX_PRIORITIES\r
86     #error Missing definition:  configMAX_PRIORITIES must be defined in FreeRTOSConfig.h.  See the Configuration section of the FreeRTOS API documentation for details.\r
87 #endif\r
88 \r
89 #if configMAX_PRIORITIES < 1\r
90     #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.\r
91 #endif\r
92 \r
93 #ifndef configUSE_PREEMPTION\r
94     #error Missing definition:  configUSE_PREEMPTION must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
95 #endif\r
96 \r
97 #ifndef configUSE_IDLE_HOOK\r
98     #error Missing definition:  configUSE_IDLE_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
99 #endif\r
100 \r
101 #ifndef configUSE_TICK_HOOK\r
102     #error Missing definition:  configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
103 #endif\r
104 \r
105 #ifndef configUSE_16_BIT_TICKS\r
106     #error Missing definition:  configUSE_16_BIT_TICKS must be defined in FreeRTOSConfig.h as either 1 or 0.  See the Configuration section of the FreeRTOS API documentation for details.\r
107 #endif\r
108 \r
109 #ifndef configUSE_CO_ROUTINES\r
110     #define configUSE_CO_ROUTINES    0\r
111 #endif\r
112 \r
113 #ifndef INCLUDE_vTaskPrioritySet\r
114     #define INCLUDE_vTaskPrioritySet    0\r
115 #endif\r
116 \r
117 #ifndef INCLUDE_uxTaskPriorityGet\r
118     #define INCLUDE_uxTaskPriorityGet    0\r
119 #endif\r
120 \r
121 #ifndef INCLUDE_vTaskDelete\r
122     #define INCLUDE_vTaskDelete    0\r
123 #endif\r
124 \r
125 #ifndef INCLUDE_vTaskSuspend\r
126     #define INCLUDE_vTaskSuspend    0\r
127 #endif\r
128 \r
129 #ifdef INCLUDE_xTaskDelayUntil\r
130     #ifdef INCLUDE_vTaskDelayUntil\r
131         /* INCLUDE_vTaskDelayUntil was replaced by INCLUDE_xTaskDelayUntil.  Backward\r
132          * compatibility is maintained if only one or the other is defined, but\r
133          * there is a conflict if both are defined. */\r
134         #error INCLUDE_vTaskDelayUntil and INCLUDE_xTaskDelayUntil are both defined.  INCLUDE_vTaskDelayUntil is no longer required and should be removed\r
135     #endif\r
136 #endif\r
137 \r
138 #ifndef INCLUDE_xTaskDelayUntil\r
139     #ifdef INCLUDE_vTaskDelayUntil\r
140         /* If INCLUDE_vTaskDelayUntil is set but INCLUDE_xTaskDelayUntil is not then\r
141          * the project's FreeRTOSConfig.h probably pre-dates the introduction of\r
142          * xTaskDelayUntil and setting INCLUDE_xTaskDelayUntil to whatever\r
143          * INCLUDE_vTaskDelayUntil is set to will ensure backward compatibility.\r
144          */\r
145         #define INCLUDE_xTaskDelayUntil INCLUDE_vTaskDelayUntil\r
146     #endif\r
147 #endif\r
148 \r
149 #ifndef INCLUDE_xTaskDelayUntil\r
150     #define INCLUDE_xTaskDelayUntil    0\r
151 #endif\r
152 \r
153 #ifndef INCLUDE_vTaskDelay\r
154     #define INCLUDE_vTaskDelay    0\r
155 #endif\r
156 \r
157 #ifndef INCLUDE_xTaskGetIdleTaskHandle\r
158     #define INCLUDE_xTaskGetIdleTaskHandle    0\r
159 #endif\r
160 \r
161 #ifndef INCLUDE_xTaskAbortDelay\r
162     #define INCLUDE_xTaskAbortDelay    0\r
163 #endif\r
164 \r
165 #ifndef INCLUDE_xQueueGetMutexHolder\r
166     #define INCLUDE_xQueueGetMutexHolder    0\r
167 #endif\r
168 \r
169 #ifndef INCLUDE_xSemaphoreGetMutexHolder\r
170     #define INCLUDE_xSemaphoreGetMutexHolder    INCLUDE_xQueueGetMutexHolder\r
171 #endif\r
172 \r
173 #ifndef INCLUDE_xTaskGetHandle\r
174     #define INCLUDE_xTaskGetHandle    0\r
175 #endif\r
176 \r
177 #ifndef INCLUDE_uxTaskGetStackHighWaterMark\r
178     #define INCLUDE_uxTaskGetStackHighWaterMark    0\r
179 #endif\r
180 \r
181 #ifndef INCLUDE_uxTaskGetStackHighWaterMark2\r
182     #define INCLUDE_uxTaskGetStackHighWaterMark2    0\r
183 #endif\r
184 \r
185 #ifndef INCLUDE_eTaskGetState\r
186     #define INCLUDE_eTaskGetState    0\r
187 #endif\r
188 \r
189 #ifndef INCLUDE_xTaskResumeFromISR\r
190     #define INCLUDE_xTaskResumeFromISR    1\r
191 #endif\r
192 \r
193 #ifndef INCLUDE_xTimerPendFunctionCall\r
194     #define INCLUDE_xTimerPendFunctionCall    0\r
195 #endif\r
196 \r
197 #ifndef INCLUDE_xTaskGetSchedulerState\r
198     #define INCLUDE_xTaskGetSchedulerState    0\r
199 #endif\r
200 \r
201 #ifndef INCLUDE_xTaskGetCurrentTaskHandle\r
202     #define INCLUDE_xTaskGetCurrentTaskHandle    0\r
203 #endif\r
204 \r
205 #if configUSE_CO_ROUTINES != 0\r
206     #ifndef configMAX_CO_ROUTINE_PRIORITIES\r
207         #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.\r
208     #endif\r
209 #endif\r
210 \r
211 #ifndef configUSE_DAEMON_TASK_STARTUP_HOOK\r
212     #define configUSE_DAEMON_TASK_STARTUP_HOOK    0\r
213 #endif\r
214 \r
215 #ifndef configUSE_APPLICATION_TASK_TAG\r
216     #define configUSE_APPLICATION_TASK_TAG    0\r
217 #endif\r
218 \r
219 #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS\r
220     #define configNUM_THREAD_LOCAL_STORAGE_POINTERS    0\r
221 #endif\r
222 \r
223 #ifndef configUSE_RECURSIVE_MUTEXES\r
224     #define configUSE_RECURSIVE_MUTEXES    0\r
225 #endif\r
226 \r
227 #ifndef configUSE_MUTEXES\r
228     #define configUSE_MUTEXES    0\r
229 #endif\r
230 \r
231 #ifndef configUSE_TIMERS\r
232     #define configUSE_TIMERS    0\r
233 #endif\r
234 \r
235 #ifndef configUSE_COUNTING_SEMAPHORES\r
236     #define configUSE_COUNTING_SEMAPHORES    0\r
237 #endif\r
238 \r
239 #ifndef configUSE_ALTERNATIVE_API\r
240     #define configUSE_ALTERNATIVE_API    0\r
241 #endif\r
242 \r
243 #ifndef portCRITICAL_NESTING_IN_TCB\r
244     #define portCRITICAL_NESTING_IN_TCB    0\r
245 #endif\r
246 \r
247 #ifndef configMAX_TASK_NAME_LEN\r
248     #define configMAX_TASK_NAME_LEN    16\r
249 #endif\r
250 \r
251 #ifndef configIDLE_SHOULD_YIELD\r
252     #define configIDLE_SHOULD_YIELD    1\r
253 #endif\r
254 \r
255 #if configMAX_TASK_NAME_LEN < 1\r
256     #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h\r
257 #endif\r
258 \r
259 #ifndef configASSERT\r
260     #define configASSERT( x )\r
261     #define configASSERT_DEFINED    0\r
262 #else\r
263     #define configASSERT_DEFINED    1\r
264 #endif\r
265 \r
266 /* configPRECONDITION should be defined as configASSERT.\r
267  * The CBMC proofs need a way to track assumptions and assertions.\r
268  * A configPRECONDITION statement should express an implicit invariant or\r
269  * assumption made.  A configASSERT statement should express an invariant that must\r
270  * hold explicit before calling the code. */\r
271 #ifndef configPRECONDITION\r
272     #define configPRECONDITION( X )    configASSERT( X )\r
273     #define configPRECONDITION_DEFINED    0\r
274 #else\r
275     #define configPRECONDITION_DEFINED    1\r
276 #endif\r
277 \r
278 #ifndef portMEMORY_BARRIER\r
279     #define portMEMORY_BARRIER()\r
280 #endif\r
281 \r
282 #ifndef portSOFTWARE_BARRIER\r
283     #define portSOFTWARE_BARRIER()\r
284 #endif\r
285 \r
286 /* The timers module relies on xTaskGetSchedulerState(). */\r
287 #if configUSE_TIMERS == 1\r
288 \r
289     #ifndef configTIMER_TASK_PRIORITY\r
290         #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.\r
291     #endif /* configTIMER_TASK_PRIORITY */\r
292 \r
293     #ifndef configTIMER_QUEUE_LENGTH\r
294         #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.\r
295     #endif /* configTIMER_QUEUE_LENGTH */\r
296 \r
297     #ifndef configTIMER_TASK_STACK_DEPTH\r
298         #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.\r
299     #endif /* configTIMER_TASK_STACK_DEPTH */\r
300 \r
301 #endif /* configUSE_TIMERS */\r
302 \r
303 #ifndef portSET_INTERRUPT_MASK_FROM_ISR\r
304     #define portSET_INTERRUPT_MASK_FROM_ISR()    0\r
305 #endif\r
306 \r
307 #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR\r
308     #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue )    ( void ) uxSavedStatusValue\r
309 #endif\r
310 \r
311 #ifndef portCLEAN_UP_TCB\r
312     #define portCLEAN_UP_TCB( pxTCB )    ( void ) pxTCB\r
313 #endif\r
314 \r
315 #ifndef portPRE_TASK_DELETE_HOOK\r
316     #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )\r
317 #endif\r
318 \r
319 #ifndef portSETUP_TCB\r
320     #define portSETUP_TCB( pxTCB )    ( void ) pxTCB\r
321 #endif\r
322 \r
323 #ifndef configQUEUE_REGISTRY_SIZE\r
324     #define configQUEUE_REGISTRY_SIZE    0U\r
325 #endif\r
326 \r
327 #if ( configQUEUE_REGISTRY_SIZE < 1 )\r
328     #define vQueueAddToRegistry( xQueue, pcName )\r
329     #define vQueueUnregisterQueue( xQueue )\r
330     #define pcQueueGetName( xQueue )\r
331 #endif\r
332 \r
333 #ifndef portPOINTER_SIZE_TYPE\r
334     #define portPOINTER_SIZE_TYPE    uint32_t\r
335 #endif\r
336 \r
337 /* Remove any unused trace macros. */\r
338 #ifndef traceSTART\r
339 \r
340 /* Used to perform any necessary initialisation - for example, open a file\r
341  * into which trace is to be written. */\r
342     #define traceSTART()\r
343 #endif\r
344 \r
345 #ifndef traceEND\r
346 \r
347 /* Use to close a trace, for example close a file into which trace has been\r
348  * written. */\r
349     #define traceEND()\r
350 #endif\r
351 \r
352 #ifndef traceTASK_SWITCHED_IN\r
353 \r
354 /* Called after a task has been selected to run.  pxCurrentTCB holds a pointer\r
355  * to the task control block of the selected task. */\r
356     #define traceTASK_SWITCHED_IN()\r
357 #endif\r
358 \r
359 #ifndef traceINCREASE_TICK_COUNT\r
360 \r
361 /* Called before stepping the tick count after waking from tickless idle\r
362  * sleep. */\r
363     #define traceINCREASE_TICK_COUNT( x )\r
364 #endif\r
365 \r
366 #ifndef traceLOW_POWER_IDLE_BEGIN\r
367     /* Called immediately before entering tickless idle. */\r
368     #define traceLOW_POWER_IDLE_BEGIN()\r
369 #endif\r
370 \r
371 #ifndef traceLOW_POWER_IDLE_END\r
372     /* Called when returning to the Idle task after a tickless idle. */\r
373     #define traceLOW_POWER_IDLE_END()\r
374 #endif\r
375 \r
376 #ifndef traceTASK_SWITCHED_OUT\r
377 \r
378 /* Called before a task has been selected to run.  pxCurrentTCB holds a pointer\r
379  * to the task control block of the task being switched out. */\r
380     #define traceTASK_SWITCHED_OUT()\r
381 #endif\r
382 \r
383 #ifndef traceTASK_PRIORITY_INHERIT\r
384 \r
385 /* Called when a task attempts to take a mutex that is already held by a\r
386  * lower priority task.  pxTCBOfMutexHolder is a pointer to the TCB of the task\r
387  * that holds the mutex.  uxInheritedPriority is the priority the mutex holder\r
388  * will inherit (the priority of the task that is attempting to obtain the\r
389  * muted. */\r
390     #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )\r
391 #endif\r
392 \r
393 #ifndef traceTASK_PRIORITY_DISINHERIT\r
394 \r
395 /* Called when a task releases a mutex, the holding of which had resulted in\r
396  * the task inheriting the priority of a higher priority task.\r
397  * pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the\r
398  * mutex.  uxOriginalPriority is the task's configured (base) priority. */\r
399     #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )\r
400 #endif\r
401 \r
402 #ifndef traceBLOCKING_ON_QUEUE_RECEIVE\r
403 \r
404 /* Task is about to block because it cannot read from a\r
405  * queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
406  * upon which the read was attempted.  pxCurrentTCB points to the TCB of the\r
407  * task that attempted the read. */\r
408     #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )\r
409 #endif\r
410 \r
411 #ifndef traceBLOCKING_ON_QUEUE_PEEK\r
412 \r
413 /* Task is about to block because it cannot read from a\r
414  * queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
415  * upon which the read was attempted.  pxCurrentTCB points to the TCB of the\r
416  * task that attempted the read. */\r
417     #define traceBLOCKING_ON_QUEUE_PEEK( pxQueue )\r
418 #endif\r
419 \r
420 #ifndef traceBLOCKING_ON_QUEUE_SEND\r
421 \r
422 /* Task is about to block because it cannot write to a\r
423  * queue/mutex/semaphore.  pxQueue is a pointer to the queue/mutex/semaphore\r
424  * upon which the write was attempted.  pxCurrentTCB points to the TCB of the\r
425  * task that attempted the write. */\r
426     #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )\r
427 #endif\r
428 \r
429 #ifndef configCHECK_FOR_STACK_OVERFLOW\r
430     #define configCHECK_FOR_STACK_OVERFLOW    0\r
431 #endif\r
432 \r
433 #ifndef configRECORD_STACK_HIGH_ADDRESS\r
434     #define configRECORD_STACK_HIGH_ADDRESS    0\r
435 #endif\r
436 \r
437 #ifndef configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H\r
438     #define configINCLUDE_FREERTOS_TASK_C_ADDITIONS_H    0\r
439 #endif\r
440 \r
441 /* The following event macros are embedded in the kernel API calls. */\r
442 \r
443 #ifndef traceMOVED_TASK_TO_READY_STATE\r
444     #define traceMOVED_TASK_TO_READY_STATE( pxTCB )\r
445 #endif\r
446 \r
447 #ifndef tracePOST_MOVED_TASK_TO_READY_STATE\r
448     #define tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )\r
449 #endif\r
450 \r
451 #ifndef traceQUEUE_CREATE\r
452     #define traceQUEUE_CREATE( pxNewQueue )\r
453 #endif\r
454 \r
455 #ifndef traceQUEUE_CREATE_FAILED\r
456     #define traceQUEUE_CREATE_FAILED( ucQueueType )\r
457 #endif\r
458 \r
459 #ifndef traceCREATE_MUTEX\r
460     #define traceCREATE_MUTEX( pxNewQueue )\r
461 #endif\r
462 \r
463 #ifndef traceCREATE_MUTEX_FAILED\r
464     #define traceCREATE_MUTEX_FAILED()\r
465 #endif\r
466 \r
467 #ifndef traceGIVE_MUTEX_RECURSIVE\r
468     #define traceGIVE_MUTEX_RECURSIVE( pxMutex )\r
469 #endif\r
470 \r
471 #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED\r
472     #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )\r
473 #endif\r
474 \r
475 #ifndef traceTAKE_MUTEX_RECURSIVE\r
476     #define traceTAKE_MUTEX_RECURSIVE( pxMutex )\r
477 #endif\r
478 \r
479 #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED\r
480     #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )\r
481 #endif\r
482 \r
483 #ifndef traceCREATE_COUNTING_SEMAPHORE\r
484     #define traceCREATE_COUNTING_SEMAPHORE()\r
485 #endif\r
486 \r
487 #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED\r
488     #define traceCREATE_COUNTING_SEMAPHORE_FAILED()\r
489 #endif\r
490 \r
491 #ifndef traceQUEUE_SET_SEND\r
492     #define traceQUEUE_SET_SEND    traceQUEUE_SEND\r
493 #endif\r
494 \r
495 #ifndef traceQUEUE_SEND\r
496     #define traceQUEUE_SEND( pxQueue )\r
497 #endif\r
498 \r
499 #ifndef traceQUEUE_SEND_FAILED\r
500     #define traceQUEUE_SEND_FAILED( pxQueue )\r
501 #endif\r
502 \r
503 #ifndef traceQUEUE_RECEIVE\r
504     #define traceQUEUE_RECEIVE( pxQueue )\r
505 #endif\r
506 \r
507 #ifndef traceQUEUE_PEEK\r
508     #define traceQUEUE_PEEK( pxQueue )\r
509 #endif\r
510 \r
511 #ifndef traceQUEUE_PEEK_FAILED\r
512     #define traceQUEUE_PEEK_FAILED( pxQueue )\r
513 #endif\r
514 \r
515 #ifndef traceQUEUE_PEEK_FROM_ISR\r
516     #define traceQUEUE_PEEK_FROM_ISR( pxQueue )\r
517 #endif\r
518 \r
519 #ifndef traceQUEUE_RECEIVE_FAILED\r
520     #define traceQUEUE_RECEIVE_FAILED( pxQueue )\r
521 #endif\r
522 \r
523 #ifndef traceQUEUE_SEND_FROM_ISR\r
524     #define traceQUEUE_SEND_FROM_ISR( pxQueue )\r
525 #endif\r
526 \r
527 #ifndef traceQUEUE_SEND_FROM_ISR_FAILED\r
528     #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )\r
529 #endif\r
530 \r
531 #ifndef traceQUEUE_RECEIVE_FROM_ISR\r
532     #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )\r
533 #endif\r
534 \r
535 #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED\r
536     #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )\r
537 #endif\r
538 \r
539 #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED\r
540     #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )\r
541 #endif\r
542 \r
543 #ifndef traceQUEUE_DELETE\r
544     #define traceQUEUE_DELETE( pxQueue )\r
545 #endif\r
546 \r
547 #ifndef traceTASK_CREATE\r
548     #define traceTASK_CREATE( pxNewTCB )\r
549 #endif\r
550 \r
551 #ifndef traceTASK_CREATE_FAILED\r
552     #define traceTASK_CREATE_FAILED()\r
553 #endif\r
554 \r
555 #ifndef traceTASK_DELETE\r
556     #define traceTASK_DELETE( pxTaskToDelete )\r
557 #endif\r
558 \r
559 #ifndef traceTASK_DELAY_UNTIL\r
560     #define traceTASK_DELAY_UNTIL( x )\r
561 #endif\r
562 \r
563 #ifndef traceTASK_DELAY\r
564     #define traceTASK_DELAY()\r
565 #endif\r
566 \r
567 #ifndef traceTASK_PRIORITY_SET\r
568     #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )\r
569 #endif\r
570 \r
571 #ifndef traceTASK_SUSPEND\r
572     #define traceTASK_SUSPEND( pxTaskToSuspend )\r
573 #endif\r
574 \r
575 #ifndef traceTASK_RESUME\r
576     #define traceTASK_RESUME( pxTaskToResume )\r
577 #endif\r
578 \r
579 #ifndef traceTASK_RESUME_FROM_ISR\r
580     #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )\r
581 #endif\r
582 \r
583 #ifndef traceTASK_INCREMENT_TICK\r
584     #define traceTASK_INCREMENT_TICK( xTickCount )\r
585 #endif\r
586 \r
587 #ifndef traceTIMER_CREATE\r
588     #define traceTIMER_CREATE( pxNewTimer )\r
589 #endif\r
590 \r
591 #ifndef traceTIMER_CREATE_FAILED\r
592     #define traceTIMER_CREATE_FAILED()\r
593 #endif\r
594 \r
595 #ifndef traceTIMER_COMMAND_SEND\r
596     #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )\r
597 #endif\r
598 \r
599 #ifndef traceTIMER_EXPIRED\r
600     #define traceTIMER_EXPIRED( pxTimer )\r
601 #endif\r
602 \r
603 #ifndef traceTIMER_COMMAND_RECEIVED\r
604     #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )\r
605 #endif\r
606 \r
607 #ifndef traceMALLOC\r
608     #define traceMALLOC( pvAddress, uiSize )\r
609 #endif\r
610 \r
611 #ifndef traceFREE\r
612     #define traceFREE( pvAddress, uiSize )\r
613 #endif\r
614 \r
615 #ifndef traceEVENT_GROUP_CREATE\r
616     #define traceEVENT_GROUP_CREATE( xEventGroup )\r
617 #endif\r
618 \r
619 #ifndef traceEVENT_GROUP_CREATE_FAILED\r
620     #define traceEVENT_GROUP_CREATE_FAILED()\r
621 #endif\r
622 \r
623 #ifndef traceEVENT_GROUP_SYNC_BLOCK\r
624     #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )\r
625 #endif\r
626 \r
627 #ifndef traceEVENT_GROUP_SYNC_END\r
628     #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred )    ( void ) xTimeoutOccurred\r
629 #endif\r
630 \r
631 #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK\r
632     #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )\r
633 #endif\r
634 \r
635 #ifndef traceEVENT_GROUP_WAIT_BITS_END\r
636     #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred )    ( void ) xTimeoutOccurred\r
637 #endif\r
638 \r
639 #ifndef traceEVENT_GROUP_CLEAR_BITS\r
640     #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )\r
641 #endif\r
642 \r
643 #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR\r
644     #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )\r
645 #endif\r
646 \r
647 #ifndef traceEVENT_GROUP_SET_BITS\r
648     #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )\r
649 #endif\r
650 \r
651 #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR\r
652     #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )\r
653 #endif\r
654 \r
655 #ifndef traceEVENT_GROUP_DELETE\r
656     #define traceEVENT_GROUP_DELETE( xEventGroup )\r
657 #endif\r
658 \r
659 #ifndef tracePEND_FUNC_CALL\r
660     #define tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, ret )\r
661 #endif\r
662 \r
663 #ifndef tracePEND_FUNC_CALL_FROM_ISR\r
664     #define tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, ret )\r
665 #endif\r
666 \r
667 #ifndef traceQUEUE_REGISTRY_ADD\r
668     #define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName )\r
669 #endif\r
670 \r
671 #ifndef traceTASK_NOTIFY_TAKE_BLOCK\r
672     #define traceTASK_NOTIFY_TAKE_BLOCK( uxIndexToWait )\r
673 #endif\r
674 \r
675 #ifndef traceTASK_NOTIFY_TAKE\r
676     #define traceTASK_NOTIFY_TAKE( uxIndexToWait )\r
677 #endif\r
678 \r
679 #ifndef traceTASK_NOTIFY_WAIT_BLOCK\r
680     #define traceTASK_NOTIFY_WAIT_BLOCK( uxIndexToWait )\r
681 #endif\r
682 \r
683 #ifndef traceTASK_NOTIFY_WAIT\r
684     #define traceTASK_NOTIFY_WAIT( uxIndexToWait )\r
685 #endif\r
686 \r
687 #ifndef traceTASK_NOTIFY\r
688     #define traceTASK_NOTIFY( uxIndexToNotify )\r
689 #endif\r
690 \r
691 #ifndef traceTASK_NOTIFY_FROM_ISR\r
692     #define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify )\r
693 #endif\r
694 \r
695 #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR\r
696     #define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )\r
697 #endif\r
698 \r
699 #ifndef traceSTREAM_BUFFER_CREATE_FAILED\r
700     #define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer )\r
701 #endif\r
702 \r
703 #ifndef traceSTREAM_BUFFER_CREATE_STATIC_FAILED\r
704     #define traceSTREAM_BUFFER_CREATE_STATIC_FAILED( xReturn, xIsMessageBuffer )\r
705 #endif\r
706 \r
707 #ifndef traceSTREAM_BUFFER_CREATE\r
708     #define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer )\r
709 #endif\r
710 \r
711 #ifndef traceSTREAM_BUFFER_DELETE\r
712     #define traceSTREAM_BUFFER_DELETE( xStreamBuffer )\r
713 #endif\r
714 \r
715 #ifndef traceSTREAM_BUFFER_RESET\r
716     #define traceSTREAM_BUFFER_RESET( xStreamBuffer )\r
717 #endif\r
718 \r
719 #ifndef traceBLOCKING_ON_STREAM_BUFFER_SEND\r
720     #define traceBLOCKING_ON_STREAM_BUFFER_SEND( xStreamBuffer )\r
721 #endif\r
722 \r
723 #ifndef traceSTREAM_BUFFER_SEND\r
724     #define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent )\r
725 #endif\r
726 \r
727 #ifndef traceSTREAM_BUFFER_SEND_FAILED\r
728     #define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer )\r
729 #endif\r
730 \r
731 #ifndef traceSTREAM_BUFFER_SEND_FROM_ISR\r
732     #define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent )\r
733 #endif\r
734 \r
735 #ifndef traceBLOCKING_ON_STREAM_BUFFER_RECEIVE\r
736     #define traceBLOCKING_ON_STREAM_BUFFER_RECEIVE( xStreamBuffer )\r
737 #endif\r
738 \r
739 #ifndef traceSTREAM_BUFFER_RECEIVE\r
740     #define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength )\r
741 #endif\r
742 \r
743 #ifndef traceSTREAM_BUFFER_RECEIVE_FAILED\r
744     #define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer )\r
745 #endif\r
746 \r
747 #ifndef traceSTREAM_BUFFER_RECEIVE_FROM_ISR\r
748     #define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength )\r
749 #endif\r
750 \r
751 #ifndef configGENERATE_RUN_TIME_STATS\r
752     #define configGENERATE_RUN_TIME_STATS    0\r
753 #endif\r
754 \r
755 #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
756 \r
757     #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS\r
758         #error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined.  portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base.\r
759     #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */\r
760 \r
761     #ifndef portGET_RUN_TIME_COUNTER_VALUE\r
762         #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE\r
763             #error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined.  See the examples provided and the FreeRTOS web site for more information.\r
764         #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */\r
765     #endif /* portGET_RUN_TIME_COUNTER_VALUE */\r
766 \r
767 #endif /* configGENERATE_RUN_TIME_STATS */\r
768 \r
769 #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS\r
770     #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()\r
771 #endif\r
772 \r
773 #ifndef configUSE_MALLOC_FAILED_HOOK\r
774     #define configUSE_MALLOC_FAILED_HOOK    0\r
775 #endif\r
776 \r
777 #ifndef portPRIVILEGE_BIT\r
778     #define portPRIVILEGE_BIT    ( ( UBaseType_t ) 0x00 )\r
779 #endif\r
780 \r
781 #ifndef portYIELD_WITHIN_API\r
782     #define portYIELD_WITHIN_API    portYIELD\r
783 #endif\r
784 \r
785 #ifndef portSUPPRESS_TICKS_AND_SLEEP\r
786     #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )\r
787 #endif\r
788 \r
789 #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP\r
790     #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP    2\r
791 #endif\r
792 \r
793 #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2\r
794     #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2\r
795 #endif\r
796 \r
797 #ifndef configUSE_TICKLESS_IDLE\r
798     #define configUSE_TICKLESS_IDLE    0\r
799 #endif\r
800 \r
801 #ifndef configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING\r
802     #define configPRE_SUPPRESS_TICKS_AND_SLEEP_PROCESSING( x )\r
803 #endif\r
804 \r
805 #ifndef configPRE_SLEEP_PROCESSING\r
806     #define configPRE_SLEEP_PROCESSING( x )\r
807 #endif\r
808 \r
809 #ifndef configPOST_SLEEP_PROCESSING\r
810     #define configPOST_SLEEP_PROCESSING( x )\r
811 #endif\r
812 \r
813 #ifndef configUSE_QUEUE_SETS\r
814     #define configUSE_QUEUE_SETS    0\r
815 #endif\r
816 \r
817 #ifndef portTASK_USES_FLOATING_POINT\r
818     #define portTASK_USES_FLOATING_POINT()\r
819 #endif\r
820 \r
821 #ifndef portALLOCATE_SECURE_CONTEXT\r
822     #define portALLOCATE_SECURE_CONTEXT( ulSecureStackSize )\r
823 #endif\r
824 \r
825 #ifndef portDONT_DISCARD\r
826     #define portDONT_DISCARD\r
827 #endif\r
828 \r
829 #ifndef configUSE_TIME_SLICING\r
830     #define configUSE_TIME_SLICING    1\r
831 #endif\r
832 \r
833 #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS\r
834     #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS    0\r
835 #endif\r
836 \r
837 #ifndef configUSE_STATS_FORMATTING_FUNCTIONS\r
838     #define configUSE_STATS_FORMATTING_FUNCTIONS    0\r
839 #endif\r
840 \r
841 #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID\r
842     #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()\r
843 #endif\r
844 \r
845 #ifndef configUSE_TRACE_FACILITY\r
846     #define configUSE_TRACE_FACILITY    0\r
847 #endif\r
848 \r
849 #ifndef mtCOVERAGE_TEST_MARKER\r
850     #define mtCOVERAGE_TEST_MARKER()\r
851 #endif\r
852 \r
853 #ifndef mtCOVERAGE_TEST_DELAY\r
854     #define mtCOVERAGE_TEST_DELAY()\r
855 #endif\r
856 \r
857 #ifndef portASSERT_IF_IN_ISR\r
858     #define portASSERT_IF_IN_ISR()\r
859 #endif\r
860 \r
861 #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION\r
862     #define configUSE_PORT_OPTIMISED_TASK_SELECTION    0\r
863 #endif\r
864 \r
865 #ifndef configAPPLICATION_ALLOCATED_HEAP\r
866     #define configAPPLICATION_ALLOCATED_HEAP    0\r
867 #endif\r
868 \r
869 #ifndef configUSE_TASK_NOTIFICATIONS\r
870     #define configUSE_TASK_NOTIFICATIONS    1\r
871 #endif\r
872 \r
873 #ifndef configTASK_NOTIFICATION_ARRAY_ENTRIES\r
874     #define configTASK_NOTIFICATION_ARRAY_ENTRIES    1\r
875 #endif\r
876 \r
877 #if configTASK_NOTIFICATION_ARRAY_ENTRIES < 1\r
878     #error configTASK_NOTIFICATION_ARRAY_ENTRIES must be at least 1\r
879 #endif\r
880 \r
881 #ifndef configUSE_POSIX_ERRNO\r
882     #define configUSE_POSIX_ERRNO    0\r
883 #endif\r
884 \r
885 #ifndef portTICK_TYPE_IS_ATOMIC\r
886     #define portTICK_TYPE_IS_ATOMIC    0\r
887 #endif\r
888 \r
889 #ifndef configSUPPORT_STATIC_ALLOCATION\r
890     /* Defaults to 0 for backward compatibility. */\r
891     #define configSUPPORT_STATIC_ALLOCATION    0\r
892 #endif\r
893 \r
894 #ifndef configSUPPORT_DYNAMIC_ALLOCATION\r
895     /* Defaults to 1 for backward compatibility. */\r
896     #define configSUPPORT_DYNAMIC_ALLOCATION    1\r
897 #endif\r
898 \r
899 #ifndef configSTACK_ALLOCATION_FROM_SEPARATE_HEAP\r
900     /* Defaults to 0 for backward compatibility. */\r
901     #define configSTACK_ALLOCATION_FROM_SEPARATE_HEAP   0\r
902 #endif\r
903 \r
904 #ifndef configSTACK_DEPTH_TYPE\r
905 \r
906 /* Defaults to uint16_t for backward compatibility, but can be overridden\r
907  * in FreeRTOSConfig.h if uint16_t is too restrictive. */\r
908     #define configSTACK_DEPTH_TYPE    uint16_t\r
909 #endif\r
910 \r
911 #ifndef configMESSAGE_BUFFER_LENGTH_TYPE\r
912 \r
913 /* Defaults to size_t for backward compatibility, but can be overridden\r
914  * in FreeRTOSConfig.h if lengths will always be less than the number of bytes\r
915  * in a size_t. */\r
916     #define configMESSAGE_BUFFER_LENGTH_TYPE    size_t\r
917 #endif\r
918 \r
919 /* Sanity check the configuration. */\r
920 #if ( configUSE_TICKLESS_IDLE != 0 )\r
921     #if ( INCLUDE_vTaskSuspend != 1 )\r
922         #error INCLUDE_vTaskSuspend must be set to 1 if configUSE_TICKLESS_IDLE is not set to 0\r
923     #endif /* INCLUDE_vTaskSuspend */\r
924 #endif /* configUSE_TICKLESS_IDLE */\r
925 \r
926 #if ( ( configSUPPORT_STATIC_ALLOCATION == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) )\r
927     #error configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION cannot both be 0, but can both be 1.\r
928 #endif\r
929 \r
930 #if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )\r
931     #error configUSE_MUTEXES must be set to 1 to use recursive mutexes\r
932 #endif\r
933 \r
934 #ifndef configINITIAL_TICK_COUNT\r
935     #define configINITIAL_TICK_COUNT    0\r
936 #endif\r
937 \r
938 #if ( portTICK_TYPE_IS_ATOMIC == 0 )\r
939 \r
940 /* Either variables of tick type cannot be read atomically, or\r
941  * portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when\r
942  * the tick count is returned to the standard critical section macros. */\r
943     #define portTICK_TYPE_ENTER_CRITICAL()                      portENTER_CRITICAL()\r
944     #define portTICK_TYPE_EXIT_CRITICAL()                       portEXIT_CRITICAL()\r
945     #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR()         portSET_INTERRUPT_MASK_FROM_ISR()\r
946     #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x )    portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )\r
947 #else\r
948 \r
949 /* The tick type can be read atomically, so critical sections used when the\r
950  * tick count is returned can be defined away. */\r
951     #define portTICK_TYPE_ENTER_CRITICAL()\r
952     #define portTICK_TYPE_EXIT_CRITICAL()\r
953     #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR()         0\r
954     #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x )    ( void ) x\r
955 #endif /* if ( portTICK_TYPE_IS_ATOMIC == 0 ) */\r
956 \r
957 /* Definitions to allow backward compatibility with FreeRTOS versions prior to\r
958  * V8 if desired. */\r
959 #ifndef configENABLE_BACKWARD_COMPATIBILITY\r
960     #define configENABLE_BACKWARD_COMPATIBILITY    1\r
961 #endif\r
962 \r
963 #ifndef configPRINTF\r
964 \r
965 /* configPRINTF() was not defined, so define it away to nothing.  To use\r
966  * configPRINTF() then define it as follows (where MyPrintFunction() is\r
967  * provided by the application writer):\r
968  *\r
969  * void MyPrintFunction(const char *pcFormat, ... );\r
970  #define configPRINTF( X )   MyPrintFunction X\r
971  *\r
972  * Then call like a standard printf() function, but placing brackets around\r
973  * all parameters so they are passed as a single parameter.  For example:\r
974  * configPRINTF( ("Value = %d", MyVariable) ); */\r
975     #define configPRINTF( X )\r
976 #endif\r
977 \r
978 #ifndef configMAX\r
979 \r
980 /* The application writer has not provided their own MAX macro, so define\r
981  * the following generic implementation. */\r
982     #define configMAX( a, b )    ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )\r
983 #endif\r
984 \r
985 #ifndef configMIN\r
986 \r
987 /* The application writer has not provided their own MIN macro, so define\r
988  * the following generic implementation. */\r
989     #define configMIN( a, b )    ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )\r
990 #endif\r
991 \r
992 #if configENABLE_BACKWARD_COMPATIBILITY == 1\r
993     #define eTaskStateGet                 eTaskGetState\r
994     #define portTickType                  TickType_t\r
995     #define xTaskHandle                   TaskHandle_t\r
996     #define xQueueHandle                  QueueHandle_t\r
997     #define xSemaphoreHandle              SemaphoreHandle_t\r
998     #define xQueueSetHandle               QueueSetHandle_t\r
999     #define xQueueSetMemberHandle         QueueSetMemberHandle_t\r
1000     #define xTimeOutType                  TimeOut_t\r
1001     #define xMemoryRegion                 MemoryRegion_t\r
1002     #define xTaskParameters               TaskParameters_t\r
1003     #define xTaskStatusType               TaskStatus_t\r
1004     #define xTimerHandle                  TimerHandle_t\r
1005     #define xCoRoutineHandle              CoRoutineHandle_t\r
1006     #define pdTASK_HOOK_CODE              TaskHookFunction_t\r
1007     #define portTICK_RATE_MS              portTICK_PERIOD_MS\r
1008     #define pcTaskGetTaskName             pcTaskGetName\r
1009     #define pcTimerGetTimerName           pcTimerGetName\r
1010     #define pcQueueGetQueueName           pcQueueGetName\r
1011     #define vTaskGetTaskInfo              vTaskGetInfo\r
1012     #define xTaskGetIdleRunTimeCounter    ulTaskGetIdleRunTimeCounter\r
1013 \r
1014 /* Backward compatibility within the scheduler code only - these definitions\r
1015  * are not really required but are included for completeness. */\r
1016     #define tmrTIMER_CALLBACK             TimerCallbackFunction_t\r
1017     #define pdTASK_CODE                   TaskFunction_t\r
1018     #define xListItem                     ListItem_t\r
1019     #define xList                         List_t\r
1020 \r
1021 /* For libraries that break the list data hiding, and access list structure\r
1022  * members directly (which is not supposed to be done). */\r
1023     #define pxContainer                   pvContainer\r
1024 #endif /* configENABLE_BACKWARD_COMPATIBILITY */\r
1025 \r
1026 #if ( configUSE_ALTERNATIVE_API != 0 )\r
1027     #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0\r
1028 #endif\r
1029 \r
1030 /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even\r
1031  * if floating point hardware is otherwise supported by the FreeRTOS port in use.\r
1032  * This constant is not supported by all FreeRTOS ports that include floating\r
1033  * point support. */\r
1034 #ifndef configUSE_TASK_FPU_SUPPORT\r
1035     #define configUSE_TASK_FPU_SUPPORT    1\r
1036 #endif\r
1037 \r
1038 /* Set configENABLE_MPU to 1 to enable MPU support and 0 to disable it. This is\r
1039  * currently used in ARMv8M ports. */\r
1040 #ifndef configENABLE_MPU\r
1041     #define configENABLE_MPU    0\r
1042 #endif\r
1043 \r
1044 /* Set configENABLE_FPU to 1 to enable FPU support and 0 to disable it. This is\r
1045  * currently used in ARMv8M ports. */\r
1046 #ifndef configENABLE_FPU\r
1047     #define configENABLE_FPU    1\r
1048 #endif\r
1049 \r
1050 /* Set configENABLE_TRUSTZONE to 1 enable TrustZone support and 0 to disable it.\r
1051  * This is currently used in ARMv8M ports. */\r
1052 #ifndef configENABLE_TRUSTZONE\r
1053     #define configENABLE_TRUSTZONE    1\r
1054 #endif\r
1055 \r
1056 /* Set configRUN_FREERTOS_SECURE_ONLY to 1 to run the FreeRTOS ARMv8M port on\r
1057  * the Secure Side only. */\r
1058 #ifndef configRUN_FREERTOS_SECURE_ONLY\r
1059     #define configRUN_FREERTOS_SECURE_ONLY    0\r
1060 #endif\r
1061 \r
1062 #ifndef configRUN_ADDITIONAL_TESTS\r
1063     #define configRUN_ADDITIONAL_TESTS    0\r
1064 #endif\r
1065 \r
1066 \r
1067 /* Sometimes the FreeRTOSConfig.h settings only allow a task to be created using\r
1068  * dynamically allocated RAM, in which case when any task is deleted it is known\r
1069  * that both the task's stack and TCB need to be freed.  Sometimes the\r
1070  * FreeRTOSConfig.h settings only allow a task to be created using statically\r
1071  * allocated RAM, in which case when any task is deleted it is known that neither\r
1072  * the task's stack or TCB should be freed.  Sometimes the FreeRTOSConfig.h\r
1073  * settings allow a task to be created using either statically or dynamically\r
1074  * allocated RAM, in which case a member of the TCB is used to record whether the\r
1075  * stack and/or TCB were allocated statically or dynamically, so when a task is\r
1076  * deleted the RAM that was allocated dynamically is freed again and no attempt is\r
1077  * made to free the RAM that was allocated statically.\r
1078  * tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE is only true if it is possible for a\r
1079  * task to be created using either statically or dynamically allocated RAM.  Note\r
1080  * that if portUSING_MPU_WRAPPERS is 1 then a protected task can be created with\r
1081  * a statically allocated stack and a dynamically allocated TCB.\r
1082  *\r
1083  * The following table lists various combinations of portUSING_MPU_WRAPPERS,\r
1084  * configSUPPORT_DYNAMIC_ALLOCATION and configSUPPORT_STATIC_ALLOCATION and\r
1085  * when it is possible to have both static and dynamic allocation:\r
1086  *  +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
1087  * | MPU | Dynamic | Static |     Available Functions     |       Possible Allocations        | Both Dynamic and | Need Free |\r
1088  * |     |         |        |                             |                                   | Static Possible  |           |\r
1089  * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
1090  * | 0   | 0       | 1      | xTaskCreateStatic           | TCB - Static, Stack - Static      | No               | No        |\r
1091  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1092  * | 0   | 1       | 0      | xTaskCreate                 | TCB - Dynamic, Stack - Dynamic    | No               | Yes       |\r
1093  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1094  * | 0   | 1       | 1      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
1095  * |     |         |        | xTaskCreateStatic           | 2. TCB - Static, Stack - Static   |                  |           |\r
1096  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1097  * | 1   | 0       | 1      | xTaskCreateStatic,          | TCB - Static, Stack - Static      | No               | No        |\r
1098  * |     |         |        | xTaskCreateRestrictedStatic |                                   |                  |           |\r
1099  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1100  * | 1   | 1       | 0      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
1101  * |     |         |        | xTaskCreateRestricted       | 2. TCB - Dynamic, Stack - Static  |                  |           |\r
1102  * +-----|---------|--------|-----------------------------|-----------------------------------|------------------|-----------|\r
1103  * | 1   | 1       | 1      | xTaskCreate,                | 1. TCB - Dynamic, Stack - Dynamic | Yes              | Yes       |\r
1104  * |     |         |        | xTaskCreateStatic,          | 2. TCB - Dynamic, Stack - Static  |                  |           |\r
1105  * |     |         |        | xTaskCreateRestricted,      | 3. TCB - Static, Stack - Static   |                  |           |\r
1106  * |     |         |        | xTaskCreateRestrictedStatic |                                   |                  |           |\r
1107  * +-----+---------+--------+-----------------------------+-----------------------------------+------------------+-----------+\r
1108  */\r
1109 #define tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE                                                                                     \\r
1110     ( ( ( portUSING_MPU_WRAPPERS == 0 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) || \\r
1111       ( ( portUSING_MPU_WRAPPERS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) )\r
1112 \r
1113 /*\r
1114  * In line with software engineering best practice, FreeRTOS implements a strict\r
1115  * data hiding policy, so the real structures used by FreeRTOS to maintain the\r
1116  * state of tasks, queues, semaphores, etc. are not accessible to the application\r
1117  * code.  However, if the application writer wants to statically allocate such\r
1118  * an object then the size of the object needs to be known.  Dummy structures\r
1119  * that are guaranteed to have the same size and alignment requirements of the\r
1120  * real objects are used for this purpose.  The dummy list and list item\r
1121  * structures below are used for inclusion in such a dummy structure.\r
1122  */\r
1123 struct xSTATIC_LIST_ITEM\r
1124 {\r
1125     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1126         TickType_t xDummy1;\r
1127     #endif\r
1128     TickType_t xDummy2;\r
1129     void * pvDummy3[ 4 ];\r
1130     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1131         TickType_t xDummy4;\r
1132     #endif\r
1133 };\r
1134 typedef struct xSTATIC_LIST_ITEM StaticListItem_t;\r
1135 \r
1136 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
1137 struct xSTATIC_MINI_LIST_ITEM\r
1138 {\r
1139     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1140         TickType_t xDummy1;\r
1141     #endif\r
1142     TickType_t xDummy2;\r
1143     void * pvDummy3[ 2 ];\r
1144 };\r
1145 typedef struct xSTATIC_MINI_LIST_ITEM StaticMiniListItem_t;\r
1146 \r
1147 /* See the comments above the struct xSTATIC_LIST_ITEM definition. */\r
1148 typedef struct xSTATIC_LIST\r
1149 {\r
1150     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1151         TickType_t xDummy1;\r
1152     #endif\r
1153     UBaseType_t uxDummy2;\r
1154     void * pvDummy3;\r
1155     StaticMiniListItem_t xDummy4;\r
1156     #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )\r
1157         TickType_t xDummy5;\r
1158     #endif\r
1159 } StaticList_t;\r
1160 \r
1161 /*\r
1162  * In line with software engineering best practice, especially when supplying a\r
1163  * library that is likely to change in future versions, FreeRTOS implements a\r
1164  * strict data hiding policy.  This means the Task structure used internally by\r
1165  * FreeRTOS is not accessible to application code.  However, if the application\r
1166  * writer wants to statically allocate the memory required to create a task then\r
1167  * the size of the task object needs to be known.  The StaticTask_t structure\r
1168  * below is provided for this purpose.  Its sizes and alignment requirements are\r
1169  * guaranteed to match those of the genuine structure, no matter which\r
1170  * architecture is being used, and no matter how the values in FreeRTOSConfig.h\r
1171  * are set.  Its contents are somewhat obfuscated in the hope users will\r
1172  * recognise that it would be unwise to make direct use of the structure members.\r
1173  */\r
1174 typedef struct xSTATIC_TCB\r
1175 {\r
1176     void * pxDummy1;\r
1177     #if ( portUSING_MPU_WRAPPERS == 1 )\r
1178         xMPU_SETTINGS xDummy2;\r
1179     #endif\r
1180     StaticListItem_t xDummy3[ 2 ];\r
1181     UBaseType_t uxDummy5;\r
1182     void * pxDummy6;\r
1183     uint8_t ucDummy7[ configMAX_TASK_NAME_LEN ];\r
1184     #if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )\r
1185         void * pxDummy8;\r
1186     #endif\r
1187     #if ( portCRITICAL_NESTING_IN_TCB == 1 )\r
1188         UBaseType_t uxDummy9;\r
1189     #endif\r
1190     #if ( configUSE_TRACE_FACILITY == 1 )\r
1191         UBaseType_t uxDummy10[ 2 ];\r
1192     #endif\r
1193     #if ( configUSE_MUTEXES == 1 )\r
1194         UBaseType_t uxDummy12[ 2 ];\r
1195     #endif\r
1196     #if ( configUSE_APPLICATION_TASK_TAG == 1 )\r
1197         void * pxDummy14;\r
1198     #endif\r
1199     #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )\r
1200         void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];\r
1201     #endif\r
1202     #if ( configGENERATE_RUN_TIME_STATS == 1 )\r
1203         uint32_t ulDummy16;\r
1204     #endif\r
1205     #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
1206         struct  _reent xDummy17;\r
1207     #endif\r
1208     #if ( configUSE_TASK_NOTIFICATIONS == 1 )\r
1209         uint32_t ulDummy18[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];\r
1210         uint8_t ucDummy19[ configTASK_NOTIFICATION_ARRAY_ENTRIES ];\r
1211     #endif\r
1212     #if ( tskSTATIC_AND_DYNAMIC_ALLOCATION_POSSIBLE != 0 )\r
1213         uint8_t uxDummy20;\r
1214     #endif\r
1215 \r
1216     #if ( INCLUDE_xTaskAbortDelay == 1 )\r
1217         uint8_t ucDummy21;\r
1218     #endif\r
1219     #if ( configUSE_POSIX_ERRNO == 1 )\r
1220         int iDummy22;\r
1221     #endif\r
1222 } StaticTask_t;\r
1223 \r
1224 /*\r
1225  * In line with software engineering best practice, especially when supplying a\r
1226  * library that is likely to change in future versions, FreeRTOS implements a\r
1227  * strict data hiding policy.  This means the Queue structure used internally by\r
1228  * FreeRTOS is not accessible to application code.  However, if the application\r
1229  * writer wants to statically allocate the memory required to create a queue\r
1230  * then the size of the queue object needs to be known.  The StaticQueue_t\r
1231  * structure below is provided for this purpose.  Its sizes and alignment\r
1232  * requirements are guaranteed to match those of the genuine structure, no\r
1233  * matter which architecture is being used, and no matter how the values in\r
1234  * FreeRTOSConfig.h are set.  Its contents are somewhat obfuscated in the hope\r
1235  * users will recognise that it would be unwise to make direct use of the\r
1236  * structure members.\r
1237  */\r
1238 typedef struct xSTATIC_QUEUE\r
1239 {\r
1240     void * pvDummy1[ 3 ];\r
1241 \r
1242     union\r
1243     {\r
1244         void * pvDummy2;\r
1245         UBaseType_t uxDummy2;\r
1246     } u;\r
1247 \r
1248     StaticList_t xDummy3[ 2 ];\r
1249     UBaseType_t uxDummy4[ 3 ];\r
1250     uint8_t ucDummy5[ 2 ];\r
1251 \r
1252     #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
1253         uint8_t ucDummy6;\r
1254     #endif\r
1255 \r
1256     #if ( configUSE_QUEUE_SETS == 1 )\r
1257         void * pvDummy7;\r
1258     #endif\r
1259 \r
1260     #if ( configUSE_TRACE_FACILITY == 1 )\r
1261         UBaseType_t uxDummy8;\r
1262         uint8_t ucDummy9;\r
1263     #endif\r
1264 } StaticQueue_t;\r
1265 typedef StaticQueue_t StaticSemaphore_t;\r
1266 \r
1267 /*\r
1268  * In line with software engineering best practice, especially when supplying a\r
1269  * library that is likely to change in future versions, FreeRTOS implements a\r
1270  * strict data hiding policy.  This means the event group structure used\r
1271  * internally by FreeRTOS is not accessible to application code.  However, if\r
1272  * the application writer wants to statically allocate the memory required to\r
1273  * create an event group then the size of the event group object needs to be\r
1274  * know.  The StaticEventGroup_t structure below is provided for this purpose.\r
1275  * Its sizes and alignment requirements are guaranteed to match those of the\r
1276  * genuine structure, no matter which architecture is being used, and no matter\r
1277  * how the values in FreeRTOSConfig.h are set.  Its contents are somewhat\r
1278  * obfuscated in the hope users will recognise that it would be unwise to make\r
1279  * direct use of the structure members.\r
1280  */\r
1281 typedef struct xSTATIC_EVENT_GROUP\r
1282 {\r
1283     TickType_t xDummy1;\r
1284     StaticList_t xDummy2;\r
1285 \r
1286     #if ( configUSE_TRACE_FACILITY == 1 )\r
1287         UBaseType_t uxDummy3;\r
1288     #endif\r
1289 \r
1290     #if ( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )\r
1291         uint8_t ucDummy4;\r
1292     #endif\r
1293 } StaticEventGroup_t;\r
1294 \r
1295 /*\r
1296  * In line with software engineering best practice, especially when supplying a\r
1297  * library that is likely to change in future versions, FreeRTOS implements a\r
1298  * strict data hiding policy.  This means the software timer structure used\r
1299  * internally by FreeRTOS is not accessible to application code.  However, if\r
1300  * the application writer wants to statically allocate the memory required to\r
1301  * create a software timer then the size of the queue object needs to be known.\r
1302  * The StaticTimer_t structure below is provided for this purpose.  Its sizes\r
1303  * and alignment requirements are guaranteed to match those of the genuine\r
1304  * structure, no matter which architecture is being used, and no matter how the\r
1305  * values in FreeRTOSConfig.h are set.  Its contents are somewhat obfuscated in\r
1306  * the hope users will recognise that it would be unwise to make direct use of\r
1307  * the structure members.\r
1308  */\r
1309 typedef struct xSTATIC_TIMER\r
1310 {\r
1311     void * pvDummy1;\r
1312     StaticListItem_t xDummy2;\r
1313     TickType_t xDummy3;\r
1314     void * pvDummy5;\r
1315     TaskFunction_t pvDummy6;\r
1316     #if ( configUSE_TRACE_FACILITY == 1 )\r
1317         UBaseType_t uxDummy7;\r
1318     #endif\r
1319     uint8_t ucDummy8;\r
1320 } StaticTimer_t;\r
1321 \r
1322 /*\r
1323  * In line with software engineering best practice, especially when supplying a\r
1324  * library that is likely to change in future versions, FreeRTOS implements a\r
1325  * strict data hiding policy.  This means the stream buffer structure used\r
1326  * internally by FreeRTOS is not accessible to application code.  However, if\r
1327  * the application writer wants to statically allocate the memory required to\r
1328  * create a stream buffer then the size of the stream buffer object needs to be\r
1329  * known.  The StaticStreamBuffer_t structure below is provided for this\r
1330  * purpose.  Its size and alignment requirements are guaranteed to match those\r
1331  * of the genuine structure, no matter which architecture is being used, and\r
1332  * no matter how the values in FreeRTOSConfig.h are set.  Its contents are\r
1333  * somewhat obfuscated in the hope users will recognise that it would be unwise\r
1334  * to make direct use of the structure members.\r
1335  */\r
1336 typedef struct xSTATIC_STREAM_BUFFER\r
1337 {\r
1338     size_t uxDummy1[ 4 ];\r
1339     void * pvDummy2[ 3 ];\r
1340     uint8_t ucDummy3;\r
1341     #if ( configUSE_TRACE_FACILITY == 1 )\r
1342         UBaseType_t uxDummy4;\r
1343     #endif\r
1344 } StaticStreamBuffer_t;\r
1345 \r
1346 /* Message buffers are built on stream buffers. */\r
1347 typedef StaticStreamBuffer_t StaticMessageBuffer_t;\r
1348 \r
1349 /* *INDENT-OFF* */\r
1350 #ifdef __cplusplus\r
1351     }\r
1352 #endif\r
1353 /* *INDENT-ON* */\r
1354 \r
1355 #endif /* INC_FREERTOS_H */\r