FreeRTOS.h 25 KB

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