FreeRTOS.h 35 KB

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