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