FreeRTOS.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. /*
  2. FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.
  3. All rights reserved
  4. VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
  5. This file is part of the FreeRTOS distribution.
  6. FreeRTOS is free software; you can redistribute it and/or modify it under
  7. the terms of the GNU General Public License (version 2) as published by the
  8. Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
  9. ***************************************************************************
  10. >>! NOTE: The modification to the GPL is included to allow you to !<<
  11. >>! distribute a combined work that includes FreeRTOS without being !<<
  12. >>! obliged to provide the source code for proprietary components !<<
  13. >>! outside of the FreeRTOS kernel. !<<
  14. ***************************************************************************
  15. FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
  16. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  17. FOR A PARTICULAR PURPOSE. Full license text is available on the following
  18. link: http://www.freertos.org/a00114.html
  19. ***************************************************************************
  20. * *
  21. * FreeRTOS provides completely free yet professionally developed, *
  22. * robust, strictly quality controlled, supported, and cross *
  23. * platform software that is more than just the market leader, it *
  24. * is the industry's de facto standard. *
  25. * *
  26. * Help yourself get started quickly while simultaneously helping *
  27. * to support the FreeRTOS project by purchasing a FreeRTOS *
  28. * tutorial book, reference manual, or both: *
  29. * http://www.FreeRTOS.org/Documentation *
  30. * *
  31. ***************************************************************************
  32. http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
  33. the FAQ page "My application does not run, what could be wrong?". Have you
  34. defined configASSERT()?
  35. http://www.FreeRTOS.org/support - In return for receiving this top quality
  36. embedded software for free we request you assist our global community by
  37. participating in the support forum.
  38. http://www.FreeRTOS.org/training - Investing in training allows your team to
  39. be as productive as possible as early as possible. Now you can receive
  40. FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
  41. Ltd, and the world's leading authority on the world's leading RTOS.
  42. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
  43. including FreeRTOS+Trace - an indispensable productivity tool, a DOS
  44. compatible FAT file system, and our tiny thread aware UDP/IP stack.
  45. http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
  46. Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
  47. http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
  48. Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
  49. licenses offer ticketed support, indemnification and commercial middleware.
  50. http://www.SafeRTOS.com - High Integrity Systems also provide a safety
  51. engineered and independently SIL3 certified version for use in safety and
  52. mission critical applications that require provable dependability.
  53. 1 tab == 4 spaces!
  54. */
  55. #ifndef INC_FREERTOS_H
  56. #define INC_FREERTOS_H
  57. /*
  58. * Include the generic headers required for the FreeRTOS port being used.
  59. */
  60. #include <stddef.h>
  61. /*
  62. * If stdint.h cannot be located then:
  63. * + If using GCC ensure the -nostdint options is *not* being used.
  64. * + Ensure the project's include path includes the directory in which your
  65. * compiler stores stdint.h.
  66. * + Set any compiler options necessary for it to support C99, as technically
  67. * stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any
  68. * other way).
  69. * + The FreeRTOS download includes a simple stdint.h definition that can be
  70. * used in cases where none is provided by the compiler. The files only
  71. * contains the typedefs required to build FreeRTOS. Read the instructions
  72. * in FreeRTOS/source/stdint.readme for more information.
  73. */
  74. #include <stdint.h> /* READ COMMENT ABOVE. */
  75. #ifdef __cplusplus
  76. extern "C" {
  77. #endif
  78. /* Application specific configuration options. */
  79. #include "FreeRTOSConfig.h"
  80. /* Basic FreeRTOS definitions. */
  81. #include "projdefs.h"
  82. /* Definitions specific to the port being used. */
  83. #include "portable.h"
  84. /*
  85. * Check all the required application specific macros have been defined.
  86. * These macros are application specific and (as downloaded) are defined
  87. * within FreeRTOSConfig.h.
  88. */
  89. #ifndef configMINIMAL_STACK_SIZE
  90. #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.
  91. #endif
  92. #ifndef configMAX_PRIORITIES
  93. #error Missing definition: configMAX_PRIORITIES must be defined in FreeRTOSConfig.h. See the Configuration section of the FreeRTOS API documentation for details.
  94. #endif
  95. #ifndef configUSE_PREEMPTION
  96. #error Missing definition: configUSE_PREEMPTION must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
  97. #endif
  98. #ifndef configUSE_IDLE_HOOK
  99. #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.
  100. #endif
  101. #ifndef configUSE_TICK_HOOK
  102. #error Missing definition: configUSE_TICK_HOOK must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
  103. #endif
  104. #ifndef INCLUDE_vTaskPrioritySet
  105. #error Missing definition: INCLUDE_vTaskPrioritySet must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
  106. #endif
  107. #ifndef INCLUDE_uxTaskPriorityGet
  108. #error Missing definition: INCLUDE_uxTaskPriorityGet must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
  109. #endif
  110. #ifndef INCLUDE_vTaskDelete
  111. #error Missing definition: INCLUDE_vTaskDelete must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
  112. #endif
  113. #ifndef INCLUDE_vTaskSuspend
  114. #error Missing definition: INCLUDE_vTaskSuspend must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
  115. #endif
  116. #ifndef INCLUDE_vTaskDelayUntil
  117. #error Missing definition: INCLUDE_vTaskDelayUntil must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
  118. #endif
  119. #ifndef INCLUDE_vTaskDelay
  120. #error Missing definition: INCLUDE_vTaskDelay must be defined in FreeRTOSConfig.h as either 1 or 0. See the Configuration section of the FreeRTOS API documentation for details.
  121. #endif
  122. #ifndef configUSE_16_BIT_TICKS
  123. #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.
  124. #endif
  125. #ifndef configMAX_PRIORITIES
  126. #error configMAX_PRIORITIES must be defined to be greater than or equal to 1.
  127. #endif
  128. /* Configuration sanity check. */
  129. #if ( ( configUSE_RECURSIVE_MUTEXES == 1 ) && ( configUSE_MUTEXES != 1 ) )
  130. #error configUSE_MUTEXES must be set to 1 to use recursive mutexes
  131. #endif
  132. #ifndef configUSE_CO_ROUTINES
  133. #define configUSE_CO_ROUTINES 0
  134. #endif
  135. #if configUSE_CO_ROUTINES != 0
  136. #ifndef configMAX_CO_ROUTINE_PRIORITIES
  137. #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.
  138. #endif
  139. #endif
  140. #ifndef INCLUDE_xTaskGetIdleTaskHandle
  141. #define INCLUDE_xTaskGetIdleTaskHandle 0
  142. #endif
  143. #ifndef INCLUDE_xTimerGetTimerDaemonTaskHandle
  144. #define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
  145. #endif
  146. #ifndef INCLUDE_xQueueGetMutexHolder
  147. #define INCLUDE_xQueueGetMutexHolder 0
  148. #endif
  149. #ifndef INCLUDE_xSemaphoreGetMutexHolder
  150. #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder
  151. #endif
  152. #ifndef INCLUDE_pcTaskGetTaskName
  153. #define INCLUDE_pcTaskGetTaskName 0
  154. #endif
  155. #ifndef configUSE_APPLICATION_TASK_TAG
  156. #define configUSE_APPLICATION_TASK_TAG 0
  157. #endif
  158. #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS
  159. #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
  160. #endif
  161. #ifndef INCLUDE_uxTaskGetStackHighWaterMark
  162. #define INCLUDE_uxTaskGetStackHighWaterMark 0
  163. #endif
  164. #ifndef INCLUDE_eTaskGetState
  165. #define INCLUDE_eTaskGetState 0
  166. #endif
  167. #ifndef configUSE_RECURSIVE_MUTEXES
  168. #define configUSE_RECURSIVE_MUTEXES 0
  169. #endif
  170. #ifndef configUSE_MUTEXES
  171. #define configUSE_MUTEXES 0
  172. #endif
  173. #ifndef configUSE_TIMERS
  174. #define configUSE_TIMERS 0
  175. #endif
  176. #ifndef configUSE_COUNTING_SEMAPHORES
  177. #define configUSE_COUNTING_SEMAPHORES 0
  178. #endif
  179. #ifndef configUSE_ALTERNATIVE_API
  180. #define configUSE_ALTERNATIVE_API 0
  181. #endif
  182. #ifndef portCRITICAL_NESTING_IN_TCB
  183. #define portCRITICAL_NESTING_IN_TCB 0
  184. #endif
  185. #ifndef configMAX_TASK_NAME_LEN
  186. #define configMAX_TASK_NAME_LEN 16
  187. #endif
  188. #ifndef configIDLE_SHOULD_YIELD
  189. #define configIDLE_SHOULD_YIELD 1
  190. #endif
  191. #if configMAX_TASK_NAME_LEN < 1
  192. #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
  193. #endif
  194. #ifndef INCLUDE_xTaskResumeFromISR
  195. #define INCLUDE_xTaskResumeFromISR 1
  196. #endif
  197. #ifndef INCLUDE_xEventGroupSetBitFromISR
  198. #define INCLUDE_xEventGroupSetBitFromISR 0
  199. #endif
  200. #ifndef INCLUDE_xTimerPendFunctionCall
  201. #define INCLUDE_xTimerPendFunctionCall 0
  202. #endif
  203. #ifndef configASSERT
  204. #define configASSERT( x )
  205. #define configASSERT_DEFINED 0
  206. #else
  207. #define configASSERT_DEFINED 1
  208. #endif
  209. /* The timers module relies on xTaskGetSchedulerState(). */
  210. #if configUSE_TIMERS == 1
  211. #ifndef configTIMER_TASK_PRIORITY
  212. #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.
  213. #endif /* configTIMER_TASK_PRIORITY */
  214. #ifndef configTIMER_QUEUE_LENGTH
  215. #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.
  216. #endif /* configTIMER_QUEUE_LENGTH */
  217. #ifndef configTIMER_TASK_STACK_DEPTH
  218. #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.
  219. #endif /* configTIMER_TASK_STACK_DEPTH */
  220. #endif /* configUSE_TIMERS */
  221. #ifndef INCLUDE_xTaskGetSchedulerState
  222. #define INCLUDE_xTaskGetSchedulerState 0
  223. #endif
  224. #ifndef INCLUDE_xTaskGetCurrentTaskHandle
  225. #define INCLUDE_xTaskGetCurrentTaskHandle 0
  226. #endif
  227. #ifndef portSET_INTERRUPT_MASK_FROM_ISR
  228. #define portSET_INTERRUPT_MASK_FROM_ISR() 0
  229. #endif
  230. #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
  231. #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue
  232. #endif
  233. #ifndef portCLEAN_UP_TCB
  234. #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB
  235. #endif
  236. #ifndef portPRE_TASK_DELETE_HOOK
  237. #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )
  238. #endif
  239. #ifndef portSETUP_TCB
  240. #define portSETUP_TCB( pxTCB ) ( void ) pxTCB
  241. #endif
  242. #ifndef configQUEUE_REGISTRY_SIZE
  243. #define configQUEUE_REGISTRY_SIZE 0U
  244. #endif
  245. #if ( configQUEUE_REGISTRY_SIZE < 1 )
  246. #define vQueueAddToRegistry( xQueue, pcName )
  247. #define vQueueUnregisterQueue( xQueue )
  248. #endif
  249. #ifndef portPOINTER_SIZE_TYPE
  250. #define portPOINTER_SIZE_TYPE uint32_t
  251. #endif
  252. /* Remove any unused trace macros. */
  253. #ifndef traceSTART
  254. /* Used to perform any necessary initialisation - for example, open a file
  255. into which trace is to be written. */
  256. #define traceSTART()
  257. #endif
  258. #ifndef traceEND
  259. /* Use to close a trace, for example close a file into which trace has been
  260. written. */
  261. #define traceEND()
  262. #endif
  263. #ifndef traceTASK_SWITCHED_IN
  264. /* Called after a task has been selected to run. pxCurrentTCB holds a pointer
  265. to the task control block of the selected task. */
  266. #define traceTASK_SWITCHED_IN()
  267. #endif
  268. #ifndef traceINCREASE_TICK_COUNT
  269. /* Called before stepping the tick count after waking from tickless idle
  270. sleep. */
  271. #define traceINCREASE_TICK_COUNT( x )
  272. #endif
  273. #ifndef traceLOW_POWER_IDLE_BEGIN
  274. /* Called immediately before entering tickless idle. */
  275. #define traceLOW_POWER_IDLE_BEGIN()
  276. #endif
  277. #ifndef traceLOW_POWER_IDLE_END
  278. /* Called when returning to the Idle task after a tickless idle. */
  279. #define traceLOW_POWER_IDLE_END()
  280. #endif
  281. #ifndef traceTASK_SWITCHED_OUT
  282. /* Called before a task has been selected to run. pxCurrentTCB holds a pointer
  283. to the task control block of the task being switched out. */
  284. #define traceTASK_SWITCHED_OUT()
  285. #endif
  286. #ifndef traceTASK_PRIORITY_INHERIT
  287. /* Called when a task attempts to take a mutex that is already held by a
  288. lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task
  289. that holds the mutex. uxInheritedPriority is the priority the mutex holder
  290. will inherit (the priority of the task that is attempting to obtain the
  291. muted. */
  292. #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )
  293. #endif
  294. #ifndef traceTASK_PRIORITY_DISINHERIT
  295. /* Called when a task releases a mutex, the holding of which had resulted in
  296. the task inheriting the priority of a higher priority task.
  297. pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the
  298. mutex. uxOriginalPriority is the task's configured (base) priority. */
  299. #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )
  300. #endif
  301. #ifndef traceBLOCKING_ON_QUEUE_RECEIVE
  302. /* Task is about to block because it cannot read from a
  303. queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
  304. upon which the read was attempted. pxCurrentTCB points to the TCB of the
  305. task that attempted the read. */
  306. #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )
  307. #endif
  308. #ifndef traceBLOCKING_ON_QUEUE_SEND
  309. /* Task is about to block because it cannot write to a
  310. queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
  311. upon which the write was attempted. pxCurrentTCB points to the TCB of the
  312. task that attempted the write. */
  313. #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )
  314. #endif
  315. #ifndef configCHECK_FOR_STACK_OVERFLOW
  316. #define configCHECK_FOR_STACK_OVERFLOW 0
  317. #endif
  318. /* The following event macros are embedded in the kernel API calls. */
  319. #ifndef traceMOVED_TASK_TO_READY_STATE
  320. #define traceMOVED_TASK_TO_READY_STATE( pxTCB )
  321. #endif
  322. #ifndef traceQUEUE_CREATE
  323. #define traceQUEUE_CREATE( pxNewQueue )
  324. #endif
  325. #ifndef traceQUEUE_CREATE_FAILED
  326. #define traceQUEUE_CREATE_FAILED( ucQueueType )
  327. #endif
  328. #ifndef traceCREATE_MUTEX
  329. #define traceCREATE_MUTEX( pxNewQueue )
  330. #endif
  331. #ifndef traceCREATE_MUTEX_FAILED
  332. #define traceCREATE_MUTEX_FAILED()
  333. #endif
  334. #ifndef traceGIVE_MUTEX_RECURSIVE
  335. #define traceGIVE_MUTEX_RECURSIVE( pxMutex )
  336. #endif
  337. #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED
  338. #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )
  339. #endif
  340. #ifndef traceTAKE_MUTEX_RECURSIVE
  341. #define traceTAKE_MUTEX_RECURSIVE( pxMutex )
  342. #endif
  343. #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED
  344. #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )
  345. #endif
  346. #ifndef traceCREATE_COUNTING_SEMAPHORE
  347. #define traceCREATE_COUNTING_SEMAPHORE()
  348. #endif
  349. #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED
  350. #define traceCREATE_COUNTING_SEMAPHORE_FAILED()
  351. #endif
  352. #ifndef traceQUEUE_SEND
  353. #define traceQUEUE_SEND( pxQueue )
  354. #endif
  355. #ifndef traceQUEUE_SEND_FAILED
  356. #define traceQUEUE_SEND_FAILED( pxQueue )
  357. #endif
  358. #ifndef traceQUEUE_RECEIVE
  359. #define traceQUEUE_RECEIVE( pxQueue )
  360. #endif
  361. #ifndef traceQUEUE_PEEK
  362. #define traceQUEUE_PEEK( pxQueue )
  363. #endif
  364. #ifndef traceQUEUE_PEEK_FROM_ISR
  365. #define traceQUEUE_PEEK_FROM_ISR( pxQueue )
  366. #endif
  367. #ifndef traceQUEUE_RECEIVE_FAILED
  368. #define traceQUEUE_RECEIVE_FAILED( pxQueue )
  369. #endif
  370. #ifndef traceQUEUE_SEND_FROM_ISR
  371. #define traceQUEUE_SEND_FROM_ISR( pxQueue )
  372. #endif
  373. #ifndef traceQUEUE_SEND_FROM_ISR_FAILED
  374. #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )
  375. #endif
  376. #ifndef traceQUEUE_RECEIVE_FROM_ISR
  377. #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )
  378. #endif
  379. #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED
  380. #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )
  381. #endif
  382. #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED
  383. #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )
  384. #endif
  385. #ifndef traceQUEUE_DELETE
  386. #define traceQUEUE_DELETE( pxQueue )
  387. #endif
  388. #ifndef traceTASK_CREATE
  389. #define traceTASK_CREATE( pxNewTCB )
  390. #endif
  391. #ifndef traceTASK_CREATE_FAILED
  392. #define traceTASK_CREATE_FAILED()
  393. #endif
  394. #ifndef traceTASK_DELETE
  395. #define traceTASK_DELETE( pxTaskToDelete )
  396. #endif
  397. #ifndef traceTASK_DELAY_UNTIL
  398. #define traceTASK_DELAY_UNTIL()
  399. #endif
  400. #ifndef traceTASK_DELAY
  401. #define traceTASK_DELAY()
  402. #endif
  403. #ifndef traceTASK_PRIORITY_SET
  404. #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )
  405. #endif
  406. #ifndef traceTASK_SUSPEND
  407. #define traceTASK_SUSPEND( pxTaskToSuspend )
  408. #endif
  409. #ifndef traceTASK_RESUME
  410. #define traceTASK_RESUME( pxTaskToResume )
  411. #endif
  412. #ifndef traceTASK_RESUME_FROM_ISR
  413. #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )
  414. #endif
  415. #ifndef traceTASK_INCREMENT_TICK
  416. #define traceTASK_INCREMENT_TICK( xTickCount )
  417. #endif
  418. #ifndef traceTIMER_CREATE
  419. #define traceTIMER_CREATE( pxNewTimer )
  420. #endif
  421. #ifndef traceTIMER_CREATE_FAILED
  422. #define traceTIMER_CREATE_FAILED()
  423. #endif
  424. #ifndef traceTIMER_COMMAND_SEND
  425. #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )
  426. #endif
  427. #ifndef traceTIMER_EXPIRED
  428. #define traceTIMER_EXPIRED( pxTimer )
  429. #endif
  430. #ifndef traceTIMER_COMMAND_RECEIVED
  431. #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )
  432. #endif
  433. #ifndef traceMALLOC
  434. #define traceMALLOC( pvAddress, uiSize )
  435. #endif
  436. #ifndef traceFREE
  437. #define traceFREE( pvAddress, uiSize )
  438. #endif
  439. #ifndef traceEVENT_GROUP_CREATE
  440. #define traceEVENT_GROUP_CREATE( xEventGroup )
  441. #endif
  442. #ifndef traceEVENT_GROUP_CREATE_FAILED
  443. #define traceEVENT_GROUP_CREATE_FAILED()
  444. #endif
  445. #ifndef traceEVENT_GROUP_SYNC_BLOCK
  446. #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )
  447. #endif
  448. #ifndef traceEVENT_GROUP_SYNC_END
  449. #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
  450. #endif
  451. #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK
  452. #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )
  453. #endif
  454. #ifndef traceEVENT_GROUP_WAIT_BITS_END
  455. #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
  456. #endif
  457. #ifndef traceEVENT_GROUP_CLEAR_BITS
  458. #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )
  459. #endif
  460. #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR
  461. #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )
  462. #endif
  463. #ifndef traceEVENT_GROUP_SET_BITS
  464. #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )
  465. #endif
  466. #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR
  467. #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )
  468. #endif
  469. #ifndef traceEVENT_GROUP_DELETE
  470. #define traceEVENT_GROUP_DELETE( xEventGroup )
  471. #endif
  472. #ifndef tracePEND_FUNC_CALL
  473. #define tracePEND_FUNC_CALL(xFunctionToPend, pvParameter1, ulParameter2, ret)
  474. #endif
  475. #ifndef tracePEND_FUNC_CALL_FROM_ISR
  476. #define tracePEND_FUNC_CALL_FROM_ISR(xFunctionToPend, pvParameter1, ulParameter2, ret)
  477. #endif
  478. #ifndef traceQUEUE_REGISTRY_ADD
  479. #define traceQUEUE_REGISTRY_ADD(xQueue, pcQueueName)
  480. #endif
  481. #ifndef traceTASK_NOTIFY_TAKE_BLOCK
  482. #define traceTASK_NOTIFY_TAKE_BLOCK()
  483. #endif
  484. #ifndef traceTASK_NOTIFY_TAKE
  485. #define traceTASK_NOTIFY_TAKE()
  486. #endif
  487. #ifndef traceTASK_NOTIFY_WAIT_BLOCK
  488. #define traceTASK_NOTIFY_WAIT_BLOCK()
  489. #endif
  490. #ifndef traceTASK_NOTIFY_WAIT
  491. #define traceTASK_NOTIFY_WAIT()
  492. #endif
  493. #ifndef traceTASK_NOTIFY
  494. #define traceTASK_NOTIFY()
  495. #endif
  496. #ifndef traceTASK_NOTIFY_FROM_ISR
  497. #define traceTASK_NOTIFY_FROM_ISR()
  498. #endif
  499. #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR
  500. #define traceTASK_NOTIFY_GIVE_FROM_ISR()
  501. #endif
  502. #ifndef configGENERATE_RUN_TIME_STATS
  503. #define configGENERATE_RUN_TIME_STATS 0
  504. #endif
  505. #if ( configGENERATE_RUN_TIME_STATS == 1 )
  506. #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
  507. #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.
  508. #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
  509. #ifndef portGET_RUN_TIME_COUNTER_VALUE
  510. #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
  511. #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.
  512. #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
  513. #endif /* portGET_RUN_TIME_COUNTER_VALUE */
  514. #endif /* configGENERATE_RUN_TIME_STATS */
  515. #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
  516. #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
  517. #endif
  518. #ifndef configUSE_MALLOC_FAILED_HOOK
  519. #define configUSE_MALLOC_FAILED_HOOK 0
  520. #endif
  521. #ifndef portPRIVILEGE_BIT
  522. #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 )
  523. #endif
  524. #ifndef portYIELD_WITHIN_API
  525. #define portYIELD_WITHIN_API portYIELD
  526. #endif
  527. #ifndef pvPortMallocAligned
  528. #define pvPortMallocAligned( x, puxStackBuffer ) ( ( ( puxStackBuffer ) == NULL ) ? ( pvPortMalloc( ( x ) ) ) : ( puxStackBuffer ) )
  529. #endif
  530. #ifndef vPortFreeAligned
  531. #define vPortFreeAligned( pvBlockToFree ) vPortFree( pvBlockToFree )
  532. #endif
  533. #ifndef portSUPPRESS_TICKS_AND_SLEEP
  534. #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
  535. #endif
  536. #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP
  537. #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
  538. #endif
  539. #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2
  540. #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2
  541. #endif
  542. #ifndef configUSE_TICKLESS_IDLE
  543. #define configUSE_TICKLESS_IDLE 0
  544. #endif
  545. #ifndef configPRE_SLEEP_PROCESSING
  546. #define configPRE_SLEEP_PROCESSING( x )
  547. #endif
  548. #ifndef configPOST_SLEEP_PROCESSING
  549. #define configPOST_SLEEP_PROCESSING( x )
  550. #endif
  551. #ifndef configUSE_QUEUE_SETS
  552. #define configUSE_QUEUE_SETS 0
  553. #endif
  554. #ifndef portTASK_USES_FLOATING_POINT
  555. #define portTASK_USES_FLOATING_POINT()
  556. #endif
  557. #ifndef configUSE_TIME_SLICING
  558. #define configUSE_TIME_SLICING 1
  559. #endif
  560. #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
  561. #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
  562. #endif
  563. #ifndef configUSE_NEWLIB_REENTRANT
  564. #define configUSE_NEWLIB_REENTRANT 0
  565. #endif
  566. #ifndef configUSE_STATS_FORMATTING_FUNCTIONS
  567. #define configUSE_STATS_FORMATTING_FUNCTIONS 0
  568. #endif
  569. #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID
  570. #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()
  571. #endif
  572. #ifndef configUSE_TRACE_FACILITY
  573. #define configUSE_TRACE_FACILITY 0
  574. #endif
  575. #ifndef mtCOVERAGE_TEST_MARKER
  576. #define mtCOVERAGE_TEST_MARKER()
  577. #endif
  578. #ifndef mtCOVERAGE_TEST_DELAY
  579. #define mtCOVERAGE_TEST_DELAY()
  580. #endif
  581. #ifndef portASSERT_IF_IN_ISR
  582. #define portASSERT_IF_IN_ISR()
  583. #endif
  584. #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
  585. #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
  586. #endif
  587. #ifndef configAPPLICATION_ALLOCATED_HEAP
  588. #define configAPPLICATION_ALLOCATED_HEAP 0
  589. #endif
  590. #ifndef configUSE_TASK_NOTIFICATIONS
  591. #define configUSE_TASK_NOTIFICATIONS 1
  592. #endif
  593. #ifndef portTICK_TYPE_IS_ATOMIC
  594. #define portTICK_TYPE_IS_ATOMIC 0
  595. #endif
  596. #if( portTICK_TYPE_IS_ATOMIC == 0 )
  597. /* Either variables of tick type cannot be read atomically, or
  598. portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
  599. the tick count is returned to the standard critical section macros. */
  600. #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
  601. #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
  602. #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
  603. #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
  604. #else
  605. /* The tick type can be read atomically, so critical sections used when the
  606. tick count is returned can be defined away. */
  607. #define portTICK_TYPE_ENTER_CRITICAL()
  608. #define portTICK_TYPE_EXIT_CRITICAL()
  609. #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
  610. #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) x
  611. #endif
  612. /* Definitions to allow backward compatibility with FreeRTOS versions prior to
  613. V8 if desired. */
  614. #ifndef configENABLE_BACKWARD_COMPATIBILITY
  615. #define configENABLE_BACKWARD_COMPATIBILITY 1
  616. #endif
  617. #if configENABLE_BACKWARD_COMPATIBILITY == 1
  618. #define eTaskStateGet eTaskGetState
  619. #define portTickType TickType_t
  620. #define xTaskHandle TaskHandle_t
  621. #define xQueueHandle QueueHandle_t
  622. #define xSemaphoreHandle SemaphoreHandle_t
  623. #define xQueueSetHandle QueueSetHandle_t
  624. #define xQueueSetMemberHandle QueueSetMemberHandle_t
  625. #define xTimeOutType TimeOut_t
  626. #define xMemoryRegion MemoryRegion_t
  627. #define xTaskParameters TaskParameters_t
  628. #define xTaskStatusType TaskStatus_t
  629. #define xTimerHandle TimerHandle_t
  630. #define xCoRoutineHandle CoRoutineHandle_t
  631. #define pdTASK_HOOK_CODE TaskHookFunction_t
  632. #define portTICK_RATE_MS portTICK_PERIOD_MS
  633. /* Backward compatibility within the scheduler code only - these definitions
  634. are not really required but are included for completeness. */
  635. #define tmrTIMER_CALLBACK TimerCallbackFunction_t
  636. #define pdTASK_CODE TaskFunction_t
  637. #define xListItem ListItem_t
  638. #define xList List_t
  639. #endif /* configENABLE_BACKWARD_COMPATIBILITY */
  640. /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even
  641. if floating point hardware is otherwise supported by the FreeRTOS port in use.
  642. This constant is not supported by all FreeRTOS ports that include floating
  643. point support. */
  644. #ifndef configUSE_TASK_FPU_SUPPORT
  645. #define configUSE_TASK_FPU_SUPPORT 1
  646. #endif
  647. #ifdef __cplusplus
  648. }
  649. #endif
  650. #endif /* INC_FREERTOS_H */