FreeRTOS.h 47 KB

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