FreeRTOS.h 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  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. #ifndef configUSE_CO_ROUTINES
  129. #define configUSE_CO_ROUTINES 0
  130. #endif
  131. #if configUSE_CO_ROUTINES != 0
  132. #ifndef configMAX_CO_ROUTINE_PRIORITIES
  133. #error configMAX_CO_ROUTINE_PRIORITIES must be greater than or equal to 1.
  134. #endif
  135. #endif
  136. #ifndef INCLUDE_xTaskGetIdleTaskHandle
  137. #define INCLUDE_xTaskGetIdleTaskHandle 0
  138. #endif
  139. #ifndef INCLUDE_xTimerGetTimerDaemonTaskHandle
  140. #define INCLUDE_xTimerGetTimerDaemonTaskHandle 0
  141. #endif
  142. #ifndef INCLUDE_xQueueGetMutexHolder
  143. #define INCLUDE_xQueueGetMutexHolder 0
  144. #endif
  145. #ifndef INCLUDE_xSemaphoreGetMutexHolder
  146. #define INCLUDE_xSemaphoreGetMutexHolder INCLUDE_xQueueGetMutexHolder
  147. #endif
  148. #ifndef INCLUDE_pcTaskGetTaskName
  149. #define INCLUDE_pcTaskGetTaskName 1
  150. #endif
  151. #ifndef configUSE_APPLICATION_TASK_TAG
  152. #define configUSE_APPLICATION_TASK_TAG 0
  153. #endif
  154. #ifndef configNUM_THREAD_LOCAL_STORAGE_POINTERS
  155. #define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
  156. #endif
  157. #ifndef INCLUDE_uxTaskGetStackHighWaterMark
  158. #define INCLUDE_uxTaskGetStackHighWaterMark 0
  159. #endif
  160. #ifndef INCLUDE_eTaskGetState
  161. #define INCLUDE_eTaskGetState 0
  162. #endif
  163. #ifndef configUSE_RECURSIVE_MUTEXES
  164. #define configUSE_RECURSIVE_MUTEXES 0
  165. #endif
  166. #ifndef configUSE_MUTEXES
  167. #define configUSE_MUTEXES 0
  168. #endif
  169. #ifndef configUSE_TIMERS
  170. #define configUSE_TIMERS 0
  171. #endif
  172. #ifndef configUSE_COUNTING_SEMAPHORES
  173. #define configUSE_COUNTING_SEMAPHORES 0
  174. #endif
  175. #ifndef configUSE_ALTERNATIVE_API
  176. #define configUSE_ALTERNATIVE_API 0
  177. #endif
  178. #ifndef portCRITICAL_NESTING_IN_TCB
  179. #define portCRITICAL_NESTING_IN_TCB 0
  180. #endif
  181. #ifndef configMAX_TASK_NAME_LEN
  182. #define configMAX_TASK_NAME_LEN 16
  183. #endif
  184. #ifndef configIDLE_SHOULD_YIELD
  185. #define configIDLE_SHOULD_YIELD 1
  186. #endif
  187. #if configMAX_TASK_NAME_LEN < 1
  188. #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
  189. #endif
  190. #ifndef INCLUDE_xTaskResumeFromISR
  191. #define INCLUDE_xTaskResumeFromISR 1
  192. #endif
  193. #ifndef INCLUDE_xEventGroupSetBitFromISR
  194. #define INCLUDE_xEventGroupSetBitFromISR 0
  195. #endif
  196. #ifndef INCLUDE_xTimerPendFunctionCall
  197. #define INCLUDE_xTimerPendFunctionCall 0
  198. #endif
  199. #ifndef configASSERT
  200. #define configASSERT( x )
  201. #define configASSERT_DEFINED 0
  202. #else
  203. #define configASSERT_DEFINED 1
  204. #endif
  205. /* The timers module relies on xTaskGetSchedulerState(). */
  206. #if configUSE_TIMERS == 1
  207. #ifndef configTIMER_TASK_PRIORITY
  208. #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined.
  209. #endif /* configTIMER_TASK_PRIORITY */
  210. #ifndef configTIMER_QUEUE_LENGTH
  211. #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined.
  212. #endif /* configTIMER_QUEUE_LENGTH */
  213. #ifndef configTIMER_TASK_STACK_DEPTH
  214. #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined.
  215. #endif /* configTIMER_TASK_STACK_DEPTH */
  216. #endif /* configUSE_TIMERS */
  217. #ifndef INCLUDE_xTaskGetSchedulerState
  218. #define INCLUDE_xTaskGetSchedulerState 0
  219. #endif
  220. #ifndef INCLUDE_xTaskGetCurrentTaskHandle
  221. #define INCLUDE_xTaskGetCurrentTaskHandle 0
  222. #endif
  223. #ifndef portSET_INTERRUPT_MASK_FROM_ISR
  224. #define portSET_INTERRUPT_MASK_FROM_ISR() 0
  225. #endif
  226. #ifndef portCLEAR_INTERRUPT_MASK_FROM_ISR
  227. #define portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedStatusValue ) ( void ) uxSavedStatusValue
  228. #endif
  229. #ifndef portCLEAN_UP_TCB
  230. #define portCLEAN_UP_TCB( pxTCB ) ( void ) pxTCB
  231. #endif
  232. #ifndef portPRE_TASK_DELETE_HOOK
  233. #define portPRE_TASK_DELETE_HOOK( pvTaskToDelete, pxYieldPending )
  234. #endif
  235. #ifndef portSETUP_TCB
  236. #define portSETUP_TCB( pxTCB ) ( void ) pxTCB
  237. #endif
  238. #ifndef configQUEUE_REGISTRY_SIZE
  239. #define configQUEUE_REGISTRY_SIZE 0U
  240. #endif
  241. #if ( configQUEUE_REGISTRY_SIZE < 1 )
  242. #define vQueueAddToRegistry( xQueue, pcName )
  243. #define vQueueUnregisterQueue( xQueue )
  244. #endif
  245. #ifndef portPOINTER_SIZE_TYPE
  246. #define portPOINTER_SIZE_TYPE uint32_t
  247. #endif
  248. /* Remove any unused trace macros. */
  249. #ifndef traceSTART
  250. /* Used to perform any necessary initialisation - for example, open a file
  251. into which trace is to be written. */
  252. #define traceSTART()
  253. #endif
  254. #ifndef traceEND
  255. /* Use to close a trace, for example close a file into which trace has been
  256. written. */
  257. #define traceEND()
  258. #endif
  259. #ifndef traceTASK_SWITCHED_IN
  260. /* Called after a task has been selected to run. pxCurrentTCB holds a pointer
  261. to the task control block of the selected task. */
  262. #define traceTASK_SWITCHED_IN()
  263. #endif
  264. #ifndef traceINCREASE_TICK_COUNT
  265. /* Called before stepping the tick count after waking from tickless idle
  266. sleep. */
  267. #define traceINCREASE_TICK_COUNT( x )
  268. #endif
  269. #ifndef traceLOW_POWER_IDLE_BEGIN
  270. /* Called immediately before entering tickless idle. */
  271. #define traceLOW_POWER_IDLE_BEGIN()
  272. #endif
  273. #ifndef traceLOW_POWER_IDLE_END
  274. /* Called when returning to the Idle task after a tickless idle. */
  275. #define traceLOW_POWER_IDLE_END()
  276. #endif
  277. #ifndef traceTASK_SWITCHED_OUT
  278. /* Called before a task has been selected to run. pxCurrentTCB holds a pointer
  279. to the task control block of the task being switched out. */
  280. #define traceTASK_SWITCHED_OUT()
  281. #endif
  282. #ifndef traceTASK_PRIORITY_INHERIT
  283. /* Called when a task attempts to take a mutex that is already held by a
  284. lower priority task. pxTCBOfMutexHolder is a pointer to the TCB of the task
  285. that holds the mutex. uxInheritedPriority is the priority the mutex holder
  286. will inherit (the priority of the task that is attempting to obtain the
  287. muted. */
  288. #define traceTASK_PRIORITY_INHERIT( pxTCBOfMutexHolder, uxInheritedPriority )
  289. #endif
  290. #ifndef traceTASK_PRIORITY_DISINHERIT
  291. /* Called when a task releases a mutex, the holding of which had resulted in
  292. the task inheriting the priority of a higher priority task.
  293. pxTCBOfMutexHolder is a pointer to the TCB of the task that is releasing the
  294. mutex. uxOriginalPriority is the task's configured (base) priority. */
  295. #define traceTASK_PRIORITY_DISINHERIT( pxTCBOfMutexHolder, uxOriginalPriority )
  296. #endif
  297. #ifndef traceBLOCKING_ON_QUEUE_RECEIVE
  298. /* Task is about to block because it cannot read from a
  299. queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
  300. upon which the read was attempted. pxCurrentTCB points to the TCB of the
  301. task that attempted the read. */
  302. #define traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue )
  303. #endif
  304. #ifndef traceBLOCKING_ON_QUEUE_SEND
  305. /* Task is about to block because it cannot write to a
  306. queue/mutex/semaphore. pxQueue is a pointer to the queue/mutex/semaphore
  307. upon which the write was attempted. pxCurrentTCB points to the TCB of the
  308. task that attempted the write. */
  309. #define traceBLOCKING_ON_QUEUE_SEND( pxQueue )
  310. #endif
  311. #ifndef configCHECK_FOR_STACK_OVERFLOW
  312. #define configCHECK_FOR_STACK_OVERFLOW 0
  313. #endif
  314. /* The following event macros are embedded in the kernel API calls. */
  315. #ifndef traceMOVED_TASK_TO_READY_STATE
  316. #define traceMOVED_TASK_TO_READY_STATE( pxTCB )
  317. #endif
  318. #ifndef traceQUEUE_CREATE
  319. #define traceQUEUE_CREATE( pxNewQueue )
  320. #endif
  321. #ifndef traceQUEUE_CREATE_FAILED
  322. #define traceQUEUE_CREATE_FAILED( ucQueueType )
  323. #endif
  324. #ifndef traceCREATE_MUTEX
  325. #define traceCREATE_MUTEX( pxNewQueue )
  326. #endif
  327. #ifndef traceCREATE_MUTEX_FAILED
  328. #define traceCREATE_MUTEX_FAILED()
  329. #endif
  330. #ifndef traceGIVE_MUTEX_RECURSIVE
  331. #define traceGIVE_MUTEX_RECURSIVE( pxMutex )
  332. #endif
  333. #ifndef traceGIVE_MUTEX_RECURSIVE_FAILED
  334. #define traceGIVE_MUTEX_RECURSIVE_FAILED( pxMutex )
  335. #endif
  336. #ifndef traceTAKE_MUTEX_RECURSIVE
  337. #define traceTAKE_MUTEX_RECURSIVE( pxMutex )
  338. #endif
  339. #ifndef traceTAKE_MUTEX_RECURSIVE_FAILED
  340. #define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )
  341. #endif
  342. #ifndef traceCREATE_COUNTING_SEMAPHORE
  343. #define traceCREATE_COUNTING_SEMAPHORE()
  344. #endif
  345. #ifndef traceCREATE_COUNTING_SEMAPHORE_FAILED
  346. #define traceCREATE_COUNTING_SEMAPHORE_FAILED()
  347. #endif
  348. #ifndef traceQUEUE_SEND
  349. #define traceQUEUE_SEND( pxQueue )
  350. #endif
  351. #ifndef traceQUEUE_SEND_FAILED
  352. #define traceQUEUE_SEND_FAILED( pxQueue )
  353. #endif
  354. #ifndef traceQUEUE_RECEIVE
  355. #define traceQUEUE_RECEIVE( pxQueue )
  356. #endif
  357. #ifndef traceQUEUE_PEEK
  358. #define traceQUEUE_PEEK( pxQueue )
  359. #endif
  360. #ifndef traceQUEUE_PEEK_FROM_ISR
  361. #define traceQUEUE_PEEK_FROM_ISR( pxQueue )
  362. #endif
  363. #ifndef traceQUEUE_RECEIVE_FAILED
  364. #define traceQUEUE_RECEIVE_FAILED( pxQueue )
  365. #endif
  366. #ifndef traceQUEUE_SEND_FROM_ISR
  367. #define traceQUEUE_SEND_FROM_ISR( pxQueue )
  368. #endif
  369. #ifndef traceQUEUE_SEND_FROM_ISR_FAILED
  370. #define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )
  371. #endif
  372. #ifndef traceQUEUE_RECEIVE_FROM_ISR
  373. #define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )
  374. #endif
  375. #ifndef traceQUEUE_RECEIVE_FROM_ISR_FAILED
  376. #define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )
  377. #endif
  378. #ifndef traceQUEUE_PEEK_FROM_ISR_FAILED
  379. #define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )
  380. #endif
  381. #ifndef traceQUEUE_DELETE
  382. #define traceQUEUE_DELETE( pxQueue )
  383. #endif
  384. #ifndef traceTASK_CREATE
  385. #define traceTASK_CREATE( pxNewTCB )
  386. #endif
  387. #ifndef traceTASK_CREATE_FAILED
  388. #define traceTASK_CREATE_FAILED()
  389. #endif
  390. #ifndef traceTASK_DELETE
  391. #define traceTASK_DELETE( pxTaskToDelete )
  392. #endif
  393. #ifndef traceTASK_DELAY_UNTIL
  394. #define traceTASK_DELAY_UNTIL()
  395. #endif
  396. #ifndef traceTASK_DELAY
  397. #define traceTASK_DELAY()
  398. #endif
  399. #ifndef traceTASK_PRIORITY_SET
  400. #define traceTASK_PRIORITY_SET( pxTask, uxNewPriority )
  401. #endif
  402. #ifndef traceTASK_SUSPEND
  403. #define traceTASK_SUSPEND( pxTaskToSuspend )
  404. #endif
  405. #ifndef traceTASK_RESUME
  406. #define traceTASK_RESUME( pxTaskToResume )
  407. #endif
  408. #ifndef traceTASK_RESUME_FROM_ISR
  409. #define traceTASK_RESUME_FROM_ISR( pxTaskToResume )
  410. #endif
  411. #ifndef traceTASK_INCREMENT_TICK
  412. #define traceTASK_INCREMENT_TICK( xTickCount )
  413. #endif
  414. #ifndef traceTIMER_CREATE
  415. #define traceTIMER_CREATE( pxNewTimer )
  416. #endif
  417. #ifndef traceTIMER_CREATE_FAILED
  418. #define traceTIMER_CREATE_FAILED()
  419. #endif
  420. #ifndef traceTIMER_COMMAND_SEND
  421. #define traceTIMER_COMMAND_SEND( xTimer, xMessageID, xMessageValueValue, xReturn )
  422. #endif
  423. #ifndef traceTIMER_EXPIRED
  424. #define traceTIMER_EXPIRED( pxTimer )
  425. #endif
  426. #ifndef traceTIMER_COMMAND_RECEIVED
  427. #define traceTIMER_COMMAND_RECEIVED( pxTimer, xMessageID, xMessageValue )
  428. #endif
  429. #ifndef traceMALLOC
  430. #define traceMALLOC( pvAddress, uiSize )
  431. #endif
  432. #ifndef traceFREE
  433. #define traceFREE( pvAddress, uiSize )
  434. #endif
  435. #ifndef traceEVENT_GROUP_CREATE
  436. #define traceEVENT_GROUP_CREATE( xEventGroup )
  437. #endif
  438. #ifndef traceEVENT_GROUP_CREATE_FAILED
  439. #define traceEVENT_GROUP_CREATE_FAILED()
  440. #endif
  441. #ifndef traceEVENT_GROUP_SYNC_BLOCK
  442. #define traceEVENT_GROUP_SYNC_BLOCK( xEventGroup, uxBitsToSet, uxBitsToWaitFor )
  443. #endif
  444. #ifndef traceEVENT_GROUP_SYNC_END
  445. #define traceEVENT_GROUP_SYNC_END( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
  446. #endif
  447. #ifndef traceEVENT_GROUP_WAIT_BITS_BLOCK
  448. #define traceEVENT_GROUP_WAIT_BITS_BLOCK( xEventGroup, uxBitsToWaitFor )
  449. #endif
  450. #ifndef traceEVENT_GROUP_WAIT_BITS_END
  451. #define traceEVENT_GROUP_WAIT_BITS_END( xEventGroup, uxBitsToWaitFor, xTimeoutOccurred ) ( void ) xTimeoutOccurred
  452. #endif
  453. #ifndef traceEVENT_GROUP_CLEAR_BITS
  454. #define traceEVENT_GROUP_CLEAR_BITS( xEventGroup, uxBitsToClear )
  455. #endif
  456. #ifndef traceEVENT_GROUP_CLEAR_BITS_FROM_ISR
  457. #define traceEVENT_GROUP_CLEAR_BITS_FROM_ISR( xEventGroup, uxBitsToClear )
  458. #endif
  459. #ifndef traceEVENT_GROUP_SET_BITS
  460. #define traceEVENT_GROUP_SET_BITS( xEventGroup, uxBitsToSet )
  461. #endif
  462. #ifndef traceEVENT_GROUP_SET_BITS_FROM_ISR
  463. #define traceEVENT_GROUP_SET_BITS_FROM_ISR( xEventGroup, uxBitsToSet )
  464. #endif
  465. #ifndef traceEVENT_GROUP_DELETE
  466. #define traceEVENT_GROUP_DELETE( xEventGroup )
  467. #endif
  468. #ifndef tracePEND_FUNC_CALL
  469. #define tracePEND_FUNC_CALL(xFunctionToPend, pvParameter1, ulParameter2, ret)
  470. #endif
  471. #ifndef tracePEND_FUNC_CALL_FROM_ISR
  472. #define tracePEND_FUNC_CALL_FROM_ISR(xFunctionToPend, pvParameter1, ulParameter2, ret)
  473. #endif
  474. #ifndef traceQUEUE_REGISTRY_ADD
  475. #define traceQUEUE_REGISTRY_ADD(xQueue, pcQueueName)
  476. #endif
  477. #ifndef traceTASK_NOTIFY_TAKE_BLOCK
  478. #define traceTASK_NOTIFY_TAKE_BLOCK()
  479. #endif
  480. #ifndef traceTASK_NOTIFY_TAKE
  481. #define traceTASK_NOTIFY_TAKE()
  482. #endif
  483. #ifndef traceTASK_NOTIFY_WAIT_BLOCK
  484. #define traceTASK_NOTIFY_WAIT_BLOCK()
  485. #endif
  486. #ifndef traceTASK_NOTIFY_WAIT
  487. #define traceTASK_NOTIFY_WAIT()
  488. #endif
  489. #ifndef traceTASK_NOTIFY
  490. #define traceTASK_NOTIFY()
  491. #endif
  492. #ifndef traceTASK_NOTIFY_FROM_ISR
  493. #define traceTASK_NOTIFY_FROM_ISR()
  494. #endif
  495. #ifndef traceTASK_NOTIFY_GIVE_FROM_ISR
  496. #define traceTASK_NOTIFY_GIVE_FROM_ISR()
  497. #endif
  498. #ifndef configGENERATE_RUN_TIME_STATS
  499. #define configGENERATE_RUN_TIME_STATS 0
  500. #endif
  501. #if ( configGENERATE_RUN_TIME_STATS == 1 )
  502. #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
  503. #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.
  504. #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
  505. #ifndef portGET_RUN_TIME_COUNTER_VALUE
  506. #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
  507. #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.
  508. #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
  509. #endif /* portGET_RUN_TIME_COUNTER_VALUE */
  510. #endif /* configGENERATE_RUN_TIME_STATS */
  511. #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
  512. #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
  513. #endif
  514. #ifndef configUSE_MALLOC_FAILED_HOOK
  515. #define configUSE_MALLOC_FAILED_HOOK 0
  516. #endif
  517. #ifndef portPRIVILEGE_BIT
  518. #define portPRIVILEGE_BIT ( ( UBaseType_t ) 0x00 )
  519. #endif
  520. #ifndef portYIELD_WITHIN_API
  521. #define portYIELD_WITHIN_API portYIELD
  522. #endif
  523. #ifndef pvPortMallocAligned
  524. #define pvPortMallocAligned( x, puxStackBuffer ) ( ( ( puxStackBuffer ) == NULL ) ? ( pvPortMalloc( ( x ) ) ) : ( puxStackBuffer ) )
  525. #endif
  526. #ifndef vPortFreeAligned
  527. #define vPortFreeAligned( pvBlockToFree ) vPortFree( pvBlockToFree )
  528. #endif
  529. #ifndef portSUPPRESS_TICKS_AND_SLEEP
  530. #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )
  531. #endif
  532. #ifndef configEXPECTED_IDLE_TIME_BEFORE_SLEEP
  533. #define configEXPECTED_IDLE_TIME_BEFORE_SLEEP 2
  534. #endif
  535. #if configEXPECTED_IDLE_TIME_BEFORE_SLEEP < 2
  536. #error configEXPECTED_IDLE_TIME_BEFORE_SLEEP must not be less than 2
  537. #endif
  538. #ifndef configUSE_TICKLESS_IDLE
  539. #define configUSE_TICKLESS_IDLE 0
  540. #endif
  541. #ifndef configPRE_SLEEP_PROCESSING
  542. #define configPRE_SLEEP_PROCESSING( x )
  543. #endif
  544. #ifndef configPOST_SLEEP_PROCESSING
  545. #define configPOST_SLEEP_PROCESSING( x )
  546. #endif
  547. #ifndef configUSE_QUEUE_SETS
  548. #define configUSE_QUEUE_SETS 0
  549. #endif
  550. #ifndef portTASK_USES_FLOATING_POINT
  551. #define portTASK_USES_FLOATING_POINT()
  552. #endif
  553. #ifndef configUSE_TIME_SLICING
  554. #define configUSE_TIME_SLICING 1
  555. #endif
  556. #ifndef configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS
  557. #define configINCLUDE_APPLICATION_DEFINED_PRIVILEGED_FUNCTIONS 0
  558. #endif
  559. #ifndef configUSE_NEWLIB_REENTRANT
  560. #define configUSE_NEWLIB_REENTRANT 0
  561. #endif
  562. #ifndef configUSE_STATS_FORMATTING_FUNCTIONS
  563. #define configUSE_STATS_FORMATTING_FUNCTIONS 0
  564. #endif
  565. #ifndef portASSERT_IF_INTERRUPT_PRIORITY_INVALID
  566. #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID()
  567. #endif
  568. #ifndef configUSE_TRACE_FACILITY
  569. #define configUSE_TRACE_FACILITY 0
  570. #endif
  571. #ifndef mtCOVERAGE_TEST_MARKER
  572. #define mtCOVERAGE_TEST_MARKER()
  573. #endif
  574. #ifndef mtCOVERAGE_TEST_DELAY
  575. #define mtCOVERAGE_TEST_DELAY()
  576. #endif
  577. #ifndef portASSERT_IF_IN_ISR
  578. #define portASSERT_IF_IN_ISR()
  579. #endif
  580. #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
  581. #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
  582. #endif
  583. #ifndef configAPPLICATION_ALLOCATED_HEAP
  584. #define configAPPLICATION_ALLOCATED_HEAP 0
  585. #endif
  586. #ifndef configUSE_TASK_NOTIFICATIONS
  587. #define configUSE_TASK_NOTIFICATIONS 1
  588. #endif
  589. #ifndef portTICK_TYPE_IS_ATOMIC
  590. #define portTICK_TYPE_IS_ATOMIC 0
  591. #endif
  592. #if( portTICK_TYPE_IS_ATOMIC == 0 )
  593. /* Either variables of tick type cannot be read atomically, or
  594. portTICK_TYPE_IS_ATOMIC was not set - map the critical sections used when
  595. the tick count is returned to the standard critical section macros. */
  596. #define portTICK_TYPE_ENTER_CRITICAL() portENTER_CRITICAL()
  597. #define portTICK_TYPE_EXIT_CRITICAL() portEXIT_CRITICAL()
  598. #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() portSET_INTERRUPT_MASK_FROM_ISR()
  599. #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) portCLEAR_INTERRUPT_MASK_FROM_ISR( ( x ) )
  600. #else
  601. /* The tick type can be read atomically, so critical sections used when the
  602. tick count is returned can be defined away. */
  603. #define portTICK_TYPE_ENTER_CRITICAL()
  604. #define portTICK_TYPE_EXIT_CRITICAL()
  605. #define portTICK_TYPE_SET_INTERRUPT_MASK_FROM_ISR() 0
  606. #define portTICK_TYPE_CLEAR_INTERRUPT_MASK_FROM_ISR( x ) ( void ) x
  607. #endif
  608. /* Definitions to allow backward compatibility with FreeRTOS versions prior to
  609. V8 if desired. */
  610. #ifndef configENABLE_BACKWARD_COMPATIBILITY
  611. #define configENABLE_BACKWARD_COMPATIBILITY 1
  612. #endif
  613. #if configENABLE_BACKWARD_COMPATIBILITY == 1
  614. #define eTaskStateGet eTaskGetState
  615. #define portTickType TickType_t
  616. #define xTaskHandle TaskHandle_t
  617. #define xQueueHandle QueueHandle_t
  618. #define xSemaphoreHandle SemaphoreHandle_t
  619. #define xQueueSetHandle QueueSetHandle_t
  620. #define xQueueSetMemberHandle QueueSetMemberHandle_t
  621. #define xTimeOutType TimeOut_t
  622. #define xMemoryRegion MemoryRegion_t
  623. #define xTaskParameters TaskParameters_t
  624. #define xTaskStatusType TaskStatus_t
  625. #define xTimerHandle TimerHandle_t
  626. #define xCoRoutineHandle CoRoutineHandle_t
  627. #define pdTASK_HOOK_CODE TaskHookFunction_t
  628. #define portTICK_RATE_MS portTICK_PERIOD_MS
  629. /* Backward compatibility within the scheduler code only - these definitions
  630. are not really required but are included for completeness. */
  631. #define tmrTIMER_CALLBACK TimerCallbackFunction_t
  632. #define pdTASK_CODE TaskFunction_t
  633. #define xListItem ListItem_t
  634. #define xList List_t
  635. #endif /* configENABLE_BACKWARD_COMPATIBILITY */
  636. /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even
  637. if floating point hardware is otherwise supported by the FreeRTOS port in use.
  638. This constant is not supported by all FreeRTOS ports that include floating
  639. point support. */
  640. #ifndef configUSE_TASK_FPU_SUPPORT
  641. #define configUSE_TASK_FPU_SUPPORT 1
  642. #endif
  643. #ifdef __cplusplus
  644. }
  645. #endif
  646. #endif /* INC_FREERTOS_H */