RTX_Config.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. /*
  2. * Copyright (c) 2013-2017 ARM Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the License); you may
  7. * not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  14. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. * -----------------------------------------------------------------------------
  19. *
  20. * $Revision: V5.1.0
  21. *
  22. * Project: CMSIS-RTOS RTX
  23. * Title: RTX Configuration definitions
  24. *
  25. * -----------------------------------------------------------------------------
  26. */
  27. #ifndef RTX_CONFIG_H_
  28. #define RTX_CONFIG_H_
  29. //-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
  30. // <h>System Configuration
  31. // =======================
  32. // <o>Global Dynamic Memory size [bytes] <0-1073741824:8>
  33. // <i> Defines the combined global dynamic memory size.
  34. // <i> Default: 4096
  35. #ifndef OS_DYNAMIC_MEM_SIZE
  36. #define OS_DYNAMIC_MEM_SIZE 4096
  37. #endif
  38. // <o>Kernel Tick Frequency [Hz] <1-1000000>
  39. // <i> Defines base time unit for delays and timeouts.
  40. // <i> Default: 1000 (1ms tick)
  41. #ifndef OS_TICK_FREQ
  42. #define OS_TICK_FREQ 1000
  43. #endif
  44. // <e>Round-Robin Thread switching
  45. // <i> Enables Round-Robin Thread switching.
  46. #ifndef OS_ROBIN_ENABLE
  47. #define OS_ROBIN_ENABLE 1
  48. #endif
  49. // <o>Round-Robin Timeout <1-1000>
  50. // <i> Defines how many ticks a thread will execute before a thread switch.
  51. // <i> Default: 5
  52. #ifndef OS_ROBIN_TIMEOUT
  53. #define OS_ROBIN_TIMEOUT 5
  54. #endif
  55. // </e>
  56. // <h>Event Recording
  57. // <q>Memory Management
  58. // <i> Enables Memory Management events recording.
  59. #ifndef OS_EVR_MEMORY
  60. #define OS_EVR_MEMORY 1
  61. #endif
  62. // <q>Kernel
  63. // <i> Enables Kernel events recording.
  64. #ifndef OS_EVR_KERNEL
  65. #define OS_EVR_KERNEL 1
  66. #endif
  67. // <q>Thread
  68. // <i> Enables Thread events recording.
  69. #ifndef OS_EVR_THREAD
  70. #define OS_EVR_THREAD 1
  71. #endif
  72. // <q>Timer
  73. // <i> Enables Timer events recording.
  74. #ifndef OS_EVR_TIMER
  75. #define OS_EVR_TIMER 1
  76. #endif
  77. // <q>Event Flags
  78. // <i> Enables Event Flags events recording.
  79. #ifndef OS_EVR_EVFLAGS
  80. #define OS_EVR_EVFLAGS 1
  81. #endif
  82. // <q>Mutex
  83. // <i> Enables Mutex events recording.
  84. #ifndef OS_EVR_MUTEX
  85. #define OS_EVR_MUTEX 1
  86. #endif
  87. // <q>Semaphore
  88. // <i> Enables Semaphore events recording.
  89. #ifndef OS_EVR_SEMAPHORE
  90. #define OS_EVR_SEMAPHORE 1
  91. #endif
  92. // <q>Memory Pool
  93. // <i> Enables Memory Pool events recording.
  94. #ifndef OS_EVR_MEMPOOL
  95. #define OS_EVR_MEMPOOL 1
  96. #endif
  97. // <q>Message Queue
  98. // <i> Enables Message Queue events recording.
  99. #ifndef OS_EVR_MSGQUEUE
  100. #define OS_EVR_MSGQUEUE 1
  101. #endif
  102. // </h>
  103. // <o>ISR FIFO Queue
  104. // <4=> 4 entries <8=> 8 entries <12=> 12 entries <16=> 16 entries
  105. // <24=> 24 entries <32=> 32 entries <48=> 48 entries <64=> 64 entries
  106. // <96=> 96 entries <128=> 128 entries <196=> 196 entries <256=> 256 entries
  107. // <i> RTOS Functions called from ISR store requests to this buffer.
  108. // <i> Default: 16 entries
  109. #ifndef OS_ISR_FIFO_QUEUE
  110. #define OS_ISR_FIFO_QUEUE 16
  111. #endif
  112. // </h>
  113. // <h>Thread Configuration
  114. // =======================
  115. // <e>Object specific Memory allocation
  116. // <i> Enables object specific memory allocation.
  117. #ifndef OS_THREAD_OBJ_MEM
  118. #define OS_THREAD_OBJ_MEM 0
  119. #endif
  120. // <o>Number of user Threads <1-1000>
  121. // <i> Defines maximum number of user threads that can be active at the same time.
  122. // <i> Applies to user threads with system provided memory for control blocks.
  123. #ifndef OS_THREAD_NUM
  124. #define OS_THREAD_NUM 1
  125. #endif
  126. // <o>Number of user Threads with default Stack size <0-1000>
  127. // <i> Defines maximum number of user threads with default stack size.
  128. // <i> Applies to user threads with zero stack size specified.
  129. #ifndef OS_THREAD_DEF_STACK_NUM
  130. #define OS_THREAD_DEF_STACK_NUM 0
  131. #endif
  132. // <o>Total Stack size [bytes] for user Threads with user-provided Stack size <0-1073741824:8>
  133. // <i> Defines the combined stack size for user threads with user-provided stack size.
  134. // <i> Applies to user threads with user-provided stack size and system provided memory for stack.
  135. // <i> Default: 0
  136. #ifndef OS_THREAD_USER_STACK_SIZE
  137. #define OS_THREAD_USER_STACK_SIZE 0
  138. #endif
  139. // </e>
  140. // <o>Default Thread Stack size [bytes] <96-1073741824:8>
  141. // <i> Defines stack size for threads with zero stack size specified.
  142. // <i> Default: 200
  143. #ifndef OS_STACK_SIZE
  144. #define OS_STACK_SIZE 200
  145. #endif
  146. // <o>Idle Thread Stack size [bytes] <72-1073741824:8>
  147. // <i> Defines stack size for Idle thread.
  148. // <i> Default: 200
  149. #ifndef OS_IDLE_THREAD_STACK_SIZE
  150. #define OS_IDLE_THREAD_STACK_SIZE 200
  151. #endif
  152. // <q>Stack overrun checking
  153. // <i> Enable stack overrun checks at thread switch.
  154. // <i> Enabling this option increases slightly the execution time of a thread switch.
  155. #ifndef OS_STACK_CHECK
  156. #define OS_STACK_CHECK 1
  157. #endif
  158. // <q>Stack usage watermark
  159. // <i> Initialize thread stack with watermark pattern for analyzing stack usage.
  160. // <i> Enabling this option increases significantly the execution time of thread creation.
  161. #ifndef OS_STACK_WATERMARK
  162. #define OS_STACK_WATERMARK 0
  163. #endif
  164. // <o>Processor mode for Thread execution
  165. // <0=> Unprivileged mode
  166. // <1=> Privileged mode
  167. // <i> Default: Privileged mode
  168. #ifndef OS_PRIVILEGE_MODE
  169. #define OS_PRIVILEGE_MODE 1
  170. #endif
  171. // </h>
  172. // <h>Timer Configuration
  173. // ======================
  174. // <e>Object specific Memory allocation
  175. // <i> Enables object specific memory allocation.
  176. #ifndef OS_TIMER_OBJ_MEM
  177. #define OS_TIMER_OBJ_MEM 0
  178. #endif
  179. // <o>Number of Timer objects <1-1000>
  180. // <i> Defines maximum number of objects that can be active at the same time.
  181. // <i> Applies to objects with system provided memory for control blocks.
  182. #ifndef OS_TIMER_NUM
  183. #define OS_TIMER_NUM 1
  184. #endif
  185. // </e>
  186. // <o>Timer Thread Priority
  187. // <8=> Low
  188. // <16=> Below Normal <24=> Normal <32=> Above Normal
  189. // <40=> High
  190. // <48=> Realtime
  191. // <i> Defines priority for timer thread
  192. // <i> Default: High
  193. #ifndef OS_TIMER_THREAD_PRIO
  194. #define OS_TIMER_THREAD_PRIO 40
  195. #endif
  196. // <o>Timer Thread Stack size [bytes] <0-1073741824:8>
  197. // <i> Defines stack size for Timer thread.
  198. // <i> May be set to 0 when timers are not used.
  199. // <i> Default: 200
  200. #ifndef OS_TIMER_THREAD_STACK_SIZE
  201. #define OS_TIMER_THREAD_STACK_SIZE 200
  202. #endif
  203. // <o>Timer Callback Queue entries <0-256>
  204. // <i> Number of concurrent active timer callback functions.
  205. // <i> May be set to 0 when timers are not used.
  206. // <i> Default: 4
  207. #ifndef OS_TIMER_CB_QUEUE
  208. #define OS_TIMER_CB_QUEUE 4
  209. #endif
  210. // </h>
  211. // <h>Event Flags Configuration
  212. // ============================
  213. // <e>Object specific Memory allocation
  214. // <i> Enables object specific memory allocation.
  215. #ifndef OS_EVFLAGS_OBJ_MEM
  216. #define OS_EVFLAGS_OBJ_MEM 0
  217. #endif
  218. // <o>Number of Event Flags objects <1-1000>
  219. // <i> Defines maximum number of objects that can be active at the same time.
  220. // <i> Applies to objects with system provided memory for control blocks.
  221. #ifndef OS_EVFLAGS_NUM
  222. #define OS_EVFLAGS_NUM 1
  223. #endif
  224. // </e>
  225. // </h>
  226. // <h>Mutex Configuration
  227. // ======================
  228. // <e>Object specific Memory allocation
  229. // <i> Enables object specific memory allocation.
  230. #ifndef OS_MUTEX_OBJ_MEM
  231. #define OS_MUTEX_OBJ_MEM 0
  232. #endif
  233. // <o>Number of Mutex objects <1-1000>
  234. // <i> Defines maximum number of objects that can be active at the same time.
  235. // <i> Applies to objects with system provided memory for control blocks.
  236. #ifndef OS_MUTEX_NUM
  237. #define OS_MUTEX_NUM 1
  238. #endif
  239. // </e>
  240. // </h>
  241. // <h>Semaphore Configuration
  242. // ==========================
  243. // <e>Object specific Memory allocation
  244. // <i> Enables object specific memory allocation.
  245. #ifndef OS_SEMAPHORE_OBJ_MEM
  246. #define OS_SEMAPHORE_OBJ_MEM 0
  247. #endif
  248. // <o>Number of Semaphore objects <1-1000>
  249. // <i> Defines maximum number of objects that can be active at the same time.
  250. // <i> Applies to objects with system provided memory for control blocks.
  251. #ifndef OS_SEMAPHORE_NUM
  252. #define OS_SEMAPHORE_NUM 1
  253. #endif
  254. // </e>
  255. // </h>
  256. // <h>Memory Pool Configuration
  257. // ============================
  258. // <e>Object specific Memory allocation
  259. // <i> Enables object specific memory allocation.
  260. #ifndef OS_MEMPOOL_OBJ_MEM
  261. #define OS_MEMPOOL_OBJ_MEM 0
  262. #endif
  263. // <o>Number of Memory Pool objects <1-1000>
  264. // <i> Defines maximum number of objects that can be active at the same time.
  265. // <i> Applies to objects with system provided memory for control blocks.
  266. #ifndef OS_MEMPOOL_NUM
  267. #define OS_MEMPOOL_NUM 1
  268. #endif
  269. // <o>Data Storage Memory size [bytes] <0-1073741824:8>
  270. // <i> Defines the combined data storage memory size.
  271. // <i> Applies to objects with system provided memory for data storage.
  272. // <i> Default: 0
  273. #ifndef OS_MEMPOOL_DATA_SIZE
  274. #define OS_MEMPOOL_DATA_SIZE 0
  275. #endif
  276. // </e>
  277. // </h>
  278. // <h>Message Queue Configuration
  279. // ==============================
  280. // <e>Object specific Memory allocation
  281. // <i> Enables object specific memory allocation.
  282. #ifndef OS_MSGQUEUE_OBJ_MEM
  283. #define OS_MSGQUEUE_OBJ_MEM 0
  284. #endif
  285. // <o>Number of Message Queue objects <1-1000>
  286. // <i> Defines maximum number of objects that can be active at the same time.
  287. // <i> Applies to objects with system provided memory for control blocks.
  288. #ifndef OS_MSGQUEUE_NUM
  289. #define OS_MSGQUEUE_NUM 1
  290. #endif
  291. // <o>Data Storage Memory size [bytes] <0-1073741824:8>
  292. // <i> Defines the combined data storage memory size.
  293. // <i> Applies to objects with system provided memory for data storage.
  294. // <i> Default: 0
  295. #ifndef OS_MSGQUEUE_DATA_SIZE
  296. #define OS_MSGQUEUE_DATA_SIZE 0
  297. #endif
  298. // </e>
  299. // </h>
  300. // Number of Threads which use standard C/C++ library libspace
  301. // (when thread specific memory allocation is not used).
  302. #if (OS_THREAD_OBJ_MEM == 0)
  303. #define OS_THREAD_LIBSPACE_NUM 4
  304. #else
  305. #define OS_THREAD_LIBSPACE_NUM OS_THREAD_NUM
  306. #endif
  307. //------------- <<< end of configuration section >>> ---------------------------
  308. #endif // RTX_CONFIG_H_