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