chconf.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @file rt/templates/chconf.h
  15. * @brief Configuration file template.
  16. * @details A copy of this file must be placed in each project directory, it
  17. * contains the application specific kernel settings.
  18. *
  19. * @addtogroup config
  20. * @details Kernel related settings and hooks.
  21. * @{
  22. */
  23. #ifndef CHCONF_H
  24. #define CHCONF_H
  25. #define _CHIBIOS_RT_CONF_
  26. #define _CHIBIOS_RT_CONF_VER_6_0_
  27. /*===========================================================================*/
  28. /**
  29. * @name System timers settings
  30. * @{
  31. */
  32. /*===========================================================================*/
  33. /**
  34. * @brief System time counter resolution.
  35. * @note Allowed values are 16 or 32 bits.
  36. */
  37. #if !defined(CH_CFG_ST_RESOLUTION)
  38. #define CH_CFG_ST_RESOLUTION 32
  39. #endif
  40. /**
  41. * @brief System tick frequency.
  42. * @details Frequency of the system timer that drives the system ticks. This
  43. * setting also defines the system tick time unit.
  44. */
  45. #if !defined(CH_CFG_ST_FREQUENCY)
  46. #define CH_CFG_ST_FREQUENCY 1000
  47. #endif
  48. /**
  49. * @brief Time intervals data size.
  50. * @note Allowed values are 16, 32 or 64 bits.
  51. */
  52. #if !defined(CH_CFG_INTERVALS_SIZE)
  53. #define CH_CFG_INTERVALS_SIZE 32
  54. #endif
  55. /**
  56. * @brief Time types data size.
  57. * @note Allowed values are 16 or 32 bits.
  58. */
  59. #if !defined(CH_CFG_TIME_TYPES_SIZE)
  60. #define CH_CFG_TIME_TYPES_SIZE 32
  61. #endif
  62. /**
  63. * @brief Time delta constant for the tick-less mode.
  64. * @note If this value is zero then the system uses the classic
  65. * periodic tick. This value represents the minimum number
  66. * of ticks that is safe to specify in a timeout directive.
  67. * The value one is not valid, timeouts are rounded up to
  68. * this value.
  69. */
  70. #if !defined(CH_CFG_ST_TIMEDELTA)
  71. #define CH_CFG_ST_TIMEDELTA 0
  72. #endif
  73. /** @} */
  74. /*===========================================================================*/
  75. /**
  76. * @name Kernel parameters and options
  77. * @{
  78. */
  79. /*===========================================================================*/
  80. /**
  81. * @brief Round robin interval.
  82. * @details This constant is the number of system ticks allowed for the
  83. * threads before preemption occurs. Setting this value to zero
  84. * disables the preemption for threads with equal priority and the
  85. * round robin becomes cooperative. Note that higher priority
  86. * threads can still preempt, the kernel is always preemptive.
  87. * @note Disabling the round robin preemption makes the kernel more compact
  88. * and generally faster.
  89. * @note The round robin preemption is not supported in tickless mode and
  90. * must be set to zero in that case.
  91. */
  92. #if !defined(CH_CFG_TIME_QUANTUM)
  93. #define CH_CFG_TIME_QUANTUM 0
  94. #endif
  95. /**
  96. * @brief Managed RAM size.
  97. * @details Size of the RAM area to be managed by the OS. If set to zero
  98. * then the whole available RAM is used. The core memory is made
  99. * available to the heap allocator and/or can be used directly through
  100. * the simplified core memory allocator.
  101. *
  102. * @note In order to let the OS manage the whole RAM the linker script must
  103. * provide the @p __heap_base__ and @p __heap_end__ symbols.
  104. * @note Requires @p CH_CFG_USE_MEMCORE.
  105. */
  106. #if !defined(CH_CFG_MEMCORE_SIZE)
  107. #define CH_CFG_MEMCORE_SIZE 0
  108. #endif
  109. /**
  110. * @brief Idle thread automatic spawn suppression.
  111. * @details When this option is activated the function @p chSysInit()
  112. * does not spawn the idle thread. The application @p main()
  113. * function becomes the idle thread and must implement an
  114. * infinite loop.
  115. */
  116. #if !defined(CH_CFG_NO_IDLE_THREAD)
  117. #define CH_CFG_NO_IDLE_THREAD FALSE
  118. #endif
  119. /** @} */
  120. /*===========================================================================*/
  121. /**
  122. * @name Performance options
  123. * @{
  124. */
  125. /*===========================================================================*/
  126. /**
  127. * @brief OS optimization.
  128. * @details If enabled then time efficient rather than space efficient code
  129. * is used when two possible implementations exist.
  130. *
  131. * @note This is not related to the compiler optimization options.
  132. * @note The default is @p TRUE.
  133. */
  134. #if !defined(CH_CFG_OPTIMIZE_SPEED)
  135. #define CH_CFG_OPTIMIZE_SPEED TRUE
  136. #endif
  137. /** @} */
  138. /*===========================================================================*/
  139. /**
  140. * @name Subsystem options
  141. * @{
  142. */
  143. /*===========================================================================*/
  144. /**
  145. * @brief Time Measurement APIs.
  146. * @details If enabled then the time measurement APIs are included in
  147. * the kernel.
  148. *
  149. * @note The default is @p TRUE.
  150. */
  151. #if !defined(CH_CFG_USE_TM)
  152. #define CH_CFG_USE_TM TRUE
  153. #endif
  154. /**
  155. * @brief Threads registry APIs.
  156. * @details If enabled then the registry APIs are included in the kernel.
  157. *
  158. * @note The default is @p TRUE.
  159. */
  160. #if !defined(CH_CFG_USE_REGISTRY)
  161. #define CH_CFG_USE_REGISTRY TRUE
  162. #endif
  163. /**
  164. * @brief Threads synchronization APIs.
  165. * @details If enabled then the @p chThdWait() function is included in
  166. * the kernel.
  167. *
  168. * @note The default is @p TRUE.
  169. */
  170. #if !defined(CH_CFG_USE_WAITEXIT)
  171. #define CH_CFG_USE_WAITEXIT TRUE
  172. #endif
  173. /**
  174. * @brief Semaphores APIs.
  175. * @details If enabled then the Semaphores APIs are included in the kernel.
  176. *
  177. * @note The default is @p TRUE.
  178. */
  179. #if !defined(CH_CFG_USE_SEMAPHORES)
  180. #define CH_CFG_USE_SEMAPHORES TRUE
  181. #endif
  182. /**
  183. * @brief Semaphores queuing mode.
  184. * @details If enabled then the threads are enqueued on semaphores by
  185. * priority rather than in FIFO order.
  186. *
  187. * @note The default is @p FALSE. Enable this if you have special
  188. * requirements.
  189. * @note Requires @p CH_CFG_USE_SEMAPHORES.
  190. */
  191. #if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
  192. #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
  193. #endif
  194. /**
  195. * @brief Mutexes APIs.
  196. * @details If enabled then the mutexes APIs are included in the kernel.
  197. *
  198. * @note The default is @p TRUE.
  199. */
  200. #if !defined(CH_CFG_USE_MUTEXES)
  201. #define CH_CFG_USE_MUTEXES TRUE
  202. #endif
  203. /**
  204. * @brief Enables recursive behavior on mutexes.
  205. * @note Recursive mutexes are heavier and have an increased
  206. * memory footprint.
  207. *
  208. * @note The default is @p FALSE.
  209. * @note Requires @p CH_CFG_USE_MUTEXES.
  210. */
  211. #if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
  212. #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
  213. #endif
  214. /**
  215. * @brief Conditional Variables APIs.
  216. * @details If enabled then the conditional variables APIs are included
  217. * in the kernel.
  218. *
  219. * @note The default is @p TRUE.
  220. * @note Requires @p CH_CFG_USE_MUTEXES.
  221. */
  222. #if !defined(CH_CFG_USE_CONDVARS)
  223. #define CH_CFG_USE_CONDVARS TRUE
  224. #endif
  225. /**
  226. * @brief Conditional Variables APIs with timeout.
  227. * @details If enabled then the conditional variables APIs with timeout
  228. * specification are included in the kernel.
  229. *
  230. * @note The default is @p TRUE.
  231. * @note Requires @p CH_CFG_USE_CONDVARS.
  232. */
  233. #if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
  234. #define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
  235. #endif
  236. /**
  237. * @brief Events Flags APIs.
  238. * @details If enabled then the event flags APIs are included in the kernel.
  239. *
  240. * @note The default is @p TRUE.
  241. */
  242. #if !defined(CH_CFG_USE_EVENTS)
  243. #define CH_CFG_USE_EVENTS TRUE
  244. #endif
  245. /**
  246. * @brief Events Flags APIs with timeout.
  247. * @details If enabled then the events APIs with timeout specification
  248. * are included in the kernel.
  249. *
  250. * @note The default is @p TRUE.
  251. * @note Requires @p CH_CFG_USE_EVENTS.
  252. */
  253. #if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
  254. #define CH_CFG_USE_EVENTS_TIMEOUT TRUE
  255. #endif
  256. /**
  257. * @brief Synchronous Messages APIs.
  258. * @details If enabled then the synchronous messages APIs are included
  259. * in the kernel.
  260. *
  261. * @note The default is @p TRUE.
  262. */
  263. #if !defined(CH_CFG_USE_MESSAGES)
  264. #define CH_CFG_USE_MESSAGES TRUE
  265. #endif
  266. /**
  267. * @brief Synchronous Messages queuing mode.
  268. * @details If enabled then messages are served by priority rather than in
  269. * FIFO order.
  270. *
  271. * @note The default is @p FALSE. Enable this if you have special
  272. * requirements.
  273. * @note Requires @p CH_CFG_USE_MESSAGES.
  274. */
  275. #if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
  276. #define CH_CFG_USE_MESSAGES_PRIORITY FALSE
  277. #endif
  278. /**
  279. * @brief Mailboxes APIs.
  280. * @details If enabled then the asynchronous messages (mailboxes) APIs are
  281. * included in the kernel.
  282. *
  283. * @note The default is @p TRUE.
  284. * @note Requires @p CH_CFG_USE_SEMAPHORES.
  285. */
  286. #if !defined(CH_CFG_USE_MAILBOXES)
  287. #define CH_CFG_USE_MAILBOXES TRUE
  288. #endif
  289. /**
  290. * @brief Core Memory Manager APIs.
  291. * @details If enabled then the core memory manager APIs are included
  292. * in the kernel.
  293. *
  294. * @note The default is @p TRUE.
  295. */
  296. #if !defined(CH_CFG_USE_MEMCORE)
  297. #define CH_CFG_USE_MEMCORE TRUE
  298. #endif
  299. /**
  300. * @brief Heap Allocator APIs.
  301. * @details If enabled then the memory heap allocator APIs are included
  302. * in the kernel.
  303. *
  304. * @note The default is @p TRUE.
  305. * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
  306. * @p CH_CFG_USE_SEMAPHORES.
  307. * @note Mutexes are recommended.
  308. */
  309. #if !defined(CH_CFG_USE_HEAP)
  310. #define CH_CFG_USE_HEAP TRUE
  311. #endif
  312. /**
  313. * @brief Memory Pools Allocator APIs.
  314. * @details If enabled then the memory pools allocator APIs are included
  315. * in the kernel.
  316. *
  317. * @note The default is @p TRUE.
  318. */
  319. #if !defined(CH_CFG_USE_MEMPOOLS)
  320. #define CH_CFG_USE_MEMPOOLS TRUE
  321. #endif
  322. /**
  323. * @brief Objects FIFOs APIs.
  324. * @details If enabled then the objects FIFOs APIs are included
  325. * in the kernel.
  326. *
  327. * @note The default is @p TRUE.
  328. */
  329. #if !defined(CH_CFG_USE_OBJ_FIFOS)
  330. #define CH_CFG_USE_OBJ_FIFOS TRUE
  331. #endif
  332. /**
  333. * @brief Pipes APIs.
  334. * @details If enabled then the pipes APIs are included
  335. * in the kernel.
  336. *
  337. * @note The default is @p TRUE.
  338. */
  339. #if !defined(CH_CFG_USE_PIPES)
  340. #define CH_CFG_USE_PIPES TRUE
  341. #endif
  342. /**
  343. * @brief Dynamic Threads APIs.
  344. * @details If enabled then the dynamic threads creation APIs are included
  345. * in the kernel.
  346. *
  347. * @note The default is @p TRUE.
  348. * @note Requires @p CH_CFG_USE_WAITEXIT.
  349. * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
  350. */
  351. #if !defined(CH_CFG_USE_DYNAMIC)
  352. #define CH_CFG_USE_DYNAMIC TRUE
  353. #endif
  354. /** @} */
  355. /*===========================================================================*/
  356. /**
  357. * @name Objects factory options
  358. * @{
  359. */
  360. /*===========================================================================*/
  361. /**
  362. * @brief Objects Factory APIs.
  363. * @details If enabled then the objects factory APIs are included in the
  364. * kernel.
  365. *
  366. * @note The default is @p FALSE.
  367. */
  368. #if !defined(CH_CFG_USE_FACTORY)
  369. #define CH_CFG_USE_FACTORY FALSE
  370. #endif
  371. /**
  372. * @brief Maximum length for object names.
  373. * @details If the specified length is zero then the name is stored by
  374. * pointer but this could have unintended side effects.
  375. */
  376. #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
  377. #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
  378. #endif
  379. /**
  380. * @brief Enables the registry of generic objects.
  381. */
  382. #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
  383. #define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
  384. #endif
  385. /**
  386. * @brief Enables factory for generic buffers.
  387. */
  388. #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
  389. #define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
  390. #endif
  391. /**
  392. * @brief Enables factory for semaphores.
  393. */
  394. #if !defined(CH_CFG_FACTORY_SEMAPHORES)
  395. #define CH_CFG_FACTORY_SEMAPHORES TRUE
  396. #endif
  397. /**
  398. * @brief Enables factory for mailboxes.
  399. */
  400. #if !defined(CH_CFG_FACTORY_MAILBOXES)
  401. #define CH_CFG_FACTORY_MAILBOXES TRUE
  402. #endif
  403. /**
  404. * @brief Enables factory for objects FIFOs.
  405. */
  406. #if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
  407. #define CH_CFG_FACTORY_OBJ_FIFOS TRUE
  408. #endif
  409. /**
  410. * @brief Enables factory for Pipes.
  411. */
  412. #if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__)
  413. #define CH_CFG_FACTORY_PIPES TRUE
  414. #endif
  415. /** @} */
  416. /*===========================================================================*/
  417. /**
  418. * @name Debug options
  419. * @{
  420. */
  421. /*===========================================================================*/
  422. /**
  423. * @brief Debug option, kernel statistics.
  424. *
  425. * @note The default is @p FALSE.
  426. */
  427. #if !defined(CH_DBG_STATISTICS)
  428. #define CH_DBG_STATISTICS FALSE
  429. #endif
  430. /**
  431. * @brief Debug option, system state check.
  432. * @details If enabled the correct call protocol for system APIs is checked
  433. * at runtime.
  434. *
  435. * @note The default is @p FALSE.
  436. */
  437. #if !defined(CH_DBG_SYSTEM_STATE_CHECK)
  438. #define CH_DBG_SYSTEM_STATE_CHECK FALSE
  439. #endif
  440. /**
  441. * @brief Debug option, parameters checks.
  442. * @details If enabled then the checks on the API functions input
  443. * parameters are activated.
  444. *
  445. * @note The default is @p FALSE.
  446. */
  447. #if !defined(CH_DBG_ENABLE_CHECKS)
  448. #define CH_DBG_ENABLE_CHECKS FALSE
  449. #endif
  450. /**
  451. * @brief Debug option, consistency checks.
  452. * @details If enabled then all the assertions in the kernel code are
  453. * activated. This includes consistency checks inside the kernel,
  454. * runtime anomalies and port-defined checks.
  455. *
  456. * @note The default is @p FALSE.
  457. */
  458. #if !defined(CH_DBG_ENABLE_ASSERTS)
  459. #define CH_DBG_ENABLE_ASSERTS FALSE
  460. #endif
  461. /**
  462. * @brief Debug option, trace buffer.
  463. * @details If enabled then the trace buffer is activated.
  464. *
  465. * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
  466. */
  467. #if !defined(CH_DBG_TRACE_MASK)
  468. #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
  469. #endif
  470. /**
  471. * @brief Trace buffer entries.
  472. * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
  473. * different from @p CH_DBG_TRACE_MASK_DISABLED.
  474. */
  475. #if !defined(CH_DBG_TRACE_BUFFER_SIZE)
  476. #define CH_DBG_TRACE_BUFFER_SIZE 128
  477. #endif
  478. /**
  479. * @brief Debug option, stack checks.
  480. * @details If enabled then a runtime stack check is performed.
  481. *
  482. * @note The default is @p FALSE.
  483. * @note The stack check is performed in a architecture/port dependent way.
  484. * It may not be implemented or some ports.
  485. * @note The default failure mode is to halt the system with the global
  486. * @p panic_msg variable set to @p NULL.
  487. */
  488. #if !defined(CH_DBG_ENABLE_STACK_CHECK)
  489. #define CH_DBG_ENABLE_STACK_CHECK FALSE
  490. #endif
  491. /**
  492. * @brief Debug option, stacks initialization.
  493. * @details If enabled then the threads working area is filled with a byte
  494. * value when a thread is created. This can be useful for the
  495. * runtime measurement of the used stack.
  496. *
  497. * @note The default is @p FALSE.
  498. */
  499. #if !defined(CH_DBG_FILL_THREADS)
  500. #define CH_DBG_FILL_THREADS FALSE
  501. #endif
  502. /**
  503. * @brief Debug option, threads profiling.
  504. * @details If enabled then a field is added to the @p thread_t structure that
  505. * counts the system ticks occurred while executing the thread.
  506. *
  507. * @note The default is @p FALSE.
  508. * @note This debug option is not currently compatible with the
  509. * tickless mode.
  510. */
  511. #if !defined(CH_DBG_THREADS_PROFILING)
  512. #define CH_DBG_THREADS_PROFILING TRUE
  513. #endif
  514. /** @} */
  515. /*===========================================================================*/
  516. /**
  517. * @name Kernel hooks
  518. * @{
  519. */
  520. /*===========================================================================*/
  521. /**
  522. * @brief System structure extension.
  523. * @details User fields added to the end of the @p ch_system_t structure.
  524. */
  525. #define CH_CFG_SYSTEM_EXTRA_FIELDS \
  526. /* Add threads custom fields here.*/
  527. /**
  528. * @brief System initialization hook.
  529. * @details User initialization code added to the @p chSysInit() function
  530. * just before interrupts are enabled globally.
  531. */
  532. #define CH_CFG_SYSTEM_INIT_HOOK() { \
  533. /* Add threads initialization code here.*/ \
  534. }
  535. /**
  536. * @brief Threads descriptor structure extension.
  537. * @details User fields added to the end of the @p thread_t structure.
  538. */
  539. #define CH_CFG_THREAD_EXTRA_FIELDS \
  540. /* Add threads custom fields here.*/ \
  541. void *osal_delete_handler;
  542. /**
  543. * @brief Threads initialization hook.
  544. * @details User initialization code added to the @p _thread_init() function.
  545. *
  546. * @note It is invoked from within @p _thread_init() and implicitly from all
  547. * the threads creation APIs.
  548. */
  549. #define CH_CFG_THREAD_INIT_HOOK(tp) { \
  550. /* Add threads initialization code here.*/ \
  551. }
  552. /**
  553. * @brief Threads finalization hook.
  554. * @details User finalization code added to the @p chThdExit() API.
  555. */
  556. #define CH_CFG_THREAD_EXIT_HOOK(tp) { \
  557. /* Add threads finalization code here.*/ \
  558. }
  559. /**
  560. * @brief Context switch hook.
  561. * @details This hook is invoked just before switching between threads.
  562. */
  563. #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
  564. /* Context switch code here.*/ \
  565. }
  566. /**
  567. * @brief ISR enter hook.
  568. */
  569. #define CH_CFG_IRQ_PROLOGUE_HOOK() { \
  570. /* IRQ prologue code here.*/ \
  571. }
  572. /**
  573. * @brief ISR exit hook.
  574. */
  575. #define CH_CFG_IRQ_EPILOGUE_HOOK() { \
  576. /* IRQ epilogue code here.*/ \
  577. }
  578. /**
  579. * @brief Idle thread enter hook.
  580. * @note This hook is invoked within a critical zone, no OS functions
  581. * should be invoked from here.
  582. * @note This macro can be used to activate a power saving mode.
  583. */
  584. #define CH_CFG_IDLE_ENTER_HOOK() { \
  585. /* Idle-enter code here.*/ \
  586. }
  587. /**
  588. * @brief Idle thread leave hook.
  589. * @note This hook is invoked within a critical zone, no OS functions
  590. * should be invoked from here.
  591. * @note This macro can be used to deactivate a power saving mode.
  592. */
  593. #define CH_CFG_IDLE_LEAVE_HOOK() { \
  594. /* Idle-leave code here.*/ \
  595. }
  596. /**
  597. * @brief Idle Loop hook.
  598. * @details This hook is continuously invoked by the idle thread loop.
  599. */
  600. #define CH_CFG_IDLE_LOOP_HOOK() { \
  601. /* Idle loop code here.*/ \
  602. }
  603. /**
  604. * @brief System tick event hook.
  605. * @details This hook is invoked in the system tick handler immediately
  606. * after processing the virtual timers queue.
  607. */
  608. #define CH_CFG_SYSTEM_TICK_HOOK() { \
  609. /* System tick event code here.*/ \
  610. }
  611. /**
  612. * @brief System halt hook.
  613. * @details This hook is invoked in case to a system halting error before
  614. * the system is halted.
  615. */
  616. #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
  617. /* System halt code here.*/ \
  618. }
  619. /**
  620. * @brief Trace hook.
  621. * @details This hook is invoked each time a new record is written in the
  622. * trace buffer.
  623. */
  624. #define CH_CFG_TRACE_HOOK(tep) { \
  625. /* Trace code here.*/ \
  626. }
  627. /** @} */
  628. /*===========================================================================*/
  629. /* Port-specific settings (override port settings defaulted in chcore.h). */
  630. /*===========================================================================*/
  631. #endif /* CHCONF_H */
  632. /** @} */