You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

756 lines
22 KiB

  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_1_
  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 10000
  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 2
  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 Idle thread automatic spawn suppression.
  97. * @details When this option is activated the function @p chSysInit()
  98. * does not spawn the idle thread. The application @p main()
  99. * function becomes the idle thread and must implement an
  100. * infinite loop.
  101. */
  102. #if !defined(CH_CFG_NO_IDLE_THREAD)
  103. #define CH_CFG_NO_IDLE_THREAD FALSE
  104. #endif
  105. /** @} */
  106. /*===========================================================================*/
  107. /**
  108. * @name Performance options
  109. * @{
  110. */
  111. /*===========================================================================*/
  112. /**
  113. * @brief OS optimization.
  114. * @details If enabled then time efficient rather than space efficient code
  115. * is used when two possible implementations exist.
  116. *
  117. * @note This is not related to the compiler optimization options.
  118. * @note The default is @p TRUE.
  119. */
  120. #if !defined(CH_CFG_OPTIMIZE_SPEED)
  121. #define CH_CFG_OPTIMIZE_SPEED TRUE
  122. #endif
  123. /** @} */
  124. /*===========================================================================*/
  125. /**
  126. * @name Subsystem options
  127. * @{
  128. */
  129. /*===========================================================================*/
  130. /**
  131. * @brief Time Measurement APIs.
  132. * @details If enabled then the time measurement APIs are included in
  133. * the kernel.
  134. *
  135. * @note The default is @p TRUE.
  136. */
  137. #if !defined(CH_CFG_USE_TM)
  138. #define CH_CFG_USE_TM TRUE
  139. #endif
  140. /**
  141. * @brief Threads registry APIs.
  142. * @details If enabled then the registry APIs are included in the kernel.
  143. *
  144. * @note The default is @p TRUE.
  145. */
  146. #if !defined(CH_CFG_USE_REGISTRY)
  147. #define CH_CFG_USE_REGISTRY TRUE
  148. #endif
  149. /**
  150. * @brief Threads synchronization APIs.
  151. * @details If enabled then the @p chThdWait() function is included in
  152. * the kernel.
  153. *
  154. * @note The default is @p TRUE.
  155. */
  156. #if !defined(CH_CFG_USE_WAITEXIT)
  157. #define CH_CFG_USE_WAITEXIT TRUE
  158. #endif
  159. /**
  160. * @brief Semaphores APIs.
  161. * @details If enabled then the Semaphores APIs are included in the kernel.
  162. *
  163. * @note The default is @p TRUE.
  164. */
  165. #if !defined(CH_CFG_USE_SEMAPHORES)
  166. #define CH_CFG_USE_SEMAPHORES TRUE
  167. #endif
  168. /**
  169. * @brief Semaphores queuing mode.
  170. * @details If enabled then the threads are enqueued on semaphores by
  171. * priority rather than in FIFO order.
  172. *
  173. * @note The default is @p FALSE. Enable this if you have special
  174. * requirements.
  175. * @note Requires @p CH_CFG_USE_SEMAPHORES.
  176. */
  177. #if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY)
  178. #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
  179. #endif
  180. /**
  181. * @brief Mutexes APIs.
  182. * @details If enabled then the mutexes APIs are included in the kernel.
  183. *
  184. * @note The default is @p TRUE.
  185. */
  186. #if !defined(CH_CFG_USE_MUTEXES)
  187. #define CH_CFG_USE_MUTEXES TRUE
  188. #endif
  189. /**
  190. * @brief Enables recursive behavior on mutexes.
  191. * @note Recursive mutexes are heavier and have an increased
  192. * memory footprint.
  193. *
  194. * @note The default is @p FALSE.
  195. * @note Requires @p CH_CFG_USE_MUTEXES.
  196. */
  197. #if !defined(CH_CFG_USE_MUTEXES_RECURSIVE)
  198. #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
  199. #endif
  200. /**
  201. * @brief Conditional Variables APIs.
  202. * @details If enabled then the conditional variables APIs are included
  203. * in the kernel.
  204. *
  205. * @note The default is @p TRUE.
  206. * @note Requires @p CH_CFG_USE_MUTEXES.
  207. */
  208. #if !defined(CH_CFG_USE_CONDVARS)
  209. #define CH_CFG_USE_CONDVARS TRUE
  210. #endif
  211. /**
  212. * @brief Conditional Variables APIs with timeout.
  213. * @details If enabled then the conditional variables APIs with timeout
  214. * specification are included in the kernel.
  215. *
  216. * @note The default is @p TRUE.
  217. * @note Requires @p CH_CFG_USE_CONDVARS.
  218. */
  219. #if !defined(CH_CFG_USE_CONDVARS_TIMEOUT)
  220. #define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
  221. #endif
  222. /**
  223. * @brief Events Flags APIs.
  224. * @details If enabled then the event flags APIs are included in the kernel.
  225. *
  226. * @note The default is @p TRUE.
  227. */
  228. #if !defined(CH_CFG_USE_EVENTS)
  229. #define CH_CFG_USE_EVENTS TRUE
  230. #endif
  231. /**
  232. * @brief Events Flags APIs with timeout.
  233. * @details If enabled then the events APIs with timeout specification
  234. * are included in the kernel.
  235. *
  236. * @note The default is @p TRUE.
  237. * @note Requires @p CH_CFG_USE_EVENTS.
  238. */
  239. #if !defined(CH_CFG_USE_EVENTS_TIMEOUT)
  240. #define CH_CFG_USE_EVENTS_TIMEOUT TRUE
  241. #endif
  242. /**
  243. * @brief Synchronous Messages APIs.
  244. * @details If enabled then the synchronous messages APIs are included
  245. * in the kernel.
  246. *
  247. * @note The default is @p TRUE.
  248. */
  249. #if !defined(CH_CFG_USE_MESSAGES)
  250. #define CH_CFG_USE_MESSAGES TRUE
  251. #endif
  252. /**
  253. * @brief Synchronous Messages queuing mode.
  254. * @details If enabled then messages are served by priority rather than in
  255. * FIFO order.
  256. *
  257. * @note The default is @p FALSE. Enable this if you have special
  258. * requirements.
  259. * @note Requires @p CH_CFG_USE_MESSAGES.
  260. */
  261. #if !defined(CH_CFG_USE_MESSAGES_PRIORITY)
  262. #define CH_CFG_USE_MESSAGES_PRIORITY FALSE
  263. #endif
  264. /**
  265. * @brief Dynamic Threads APIs.
  266. * @details If enabled then the dynamic threads creation APIs are included
  267. * in the kernel.
  268. *
  269. * @note The default is @p TRUE.
  270. * @note Requires @p CH_CFG_USE_WAITEXIT.
  271. * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
  272. */
  273. #if !defined(CH_CFG_USE_DYNAMIC)
  274. #define CH_CFG_USE_DYNAMIC FALSE
  275. #endif
  276. /** @} */
  277. /*===========================================================================*/
  278. /**
  279. * @name OSLIB options
  280. * @{
  281. */
  282. /*===========================================================================*/
  283. /**
  284. * @brief Mailboxes APIs.
  285. * @details If enabled then the asynchronous messages (mailboxes) APIs are
  286. * included in the kernel.
  287. *
  288. * @note The default is @p TRUE.
  289. * @note Requires @p CH_CFG_USE_SEMAPHORES.
  290. */
  291. #if !defined(CH_CFG_USE_MAILBOXES)
  292. #define CH_CFG_USE_MAILBOXES TRUE
  293. #endif
  294. /**
  295. * @brief Core Memory Manager APIs.
  296. * @details If enabled then the core memory manager APIs are included
  297. * in the kernel.
  298. *
  299. * @note The default is @p TRUE.
  300. */
  301. #if !defined(CH_CFG_USE_MEMCORE)
  302. #define CH_CFG_USE_MEMCORE TRUE
  303. #endif
  304. /**
  305. * @brief Managed RAM size.
  306. * @details Size of the RAM area to be managed by the OS. If set to zero
  307. * then the whole available RAM is used. The core memory is made
  308. * available to the heap allocator and/or can be used directly through
  309. * the simplified core memory allocator.
  310. *
  311. * @note In order to let the OS manage the whole RAM the linker script must
  312. * provide the @p __heap_base__ and @p __heap_end__ symbols.
  313. * @note Requires @p CH_CFG_USE_MEMCORE.
  314. */
  315. #if !defined(CH_CFG_MEMCORE_SIZE)
  316. #define CH_CFG_MEMCORE_SIZE 0
  317. #endif
  318. /**
  319. * @brief Heap Allocator APIs.
  320. * @details If enabled then the memory heap allocator APIs are included
  321. * in the kernel.
  322. *
  323. * @note The default is @p TRUE.
  324. * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
  325. * @p CH_CFG_USE_SEMAPHORES.
  326. * @note Mutexes are recommended.
  327. */
  328. #if !defined(CH_CFG_USE_HEAP)
  329. #define CH_CFG_USE_HEAP TRUE
  330. #endif
  331. /**
  332. * @brief Memory Pools Allocator APIs.
  333. * @details If enabled then the memory pools allocator APIs are included
  334. * in the kernel.
  335. *
  336. * @note The default is @p TRUE.
  337. */
  338. #if !defined(CH_CFG_USE_MEMPOOLS)
  339. #define CH_CFG_USE_MEMPOOLS TRUE
  340. #endif
  341. /**
  342. * @brief Objects FIFOs APIs.
  343. * @details If enabled then the objects FIFOs APIs are included
  344. * in the kernel.
  345. *
  346. * @note The default is @p TRUE.
  347. */
  348. #if !defined(CH_CFG_USE_OBJ_FIFOS)
  349. #define CH_CFG_USE_OBJ_FIFOS TRUE
  350. #endif
  351. /**
  352. * @brief Pipes APIs.
  353. * @details If enabled then the pipes APIs are included
  354. * in the kernel.
  355. *
  356. * @note The default is @p TRUE.
  357. */
  358. #if !defined(CH_CFG_USE_PIPES)
  359. #define CH_CFG_USE_PIPES TRUE
  360. #endif
  361. /**
  362. * @brief Objects Caches APIs.
  363. * @details If enabled then the objects caches APIs are included
  364. * in the kernel.
  365. *
  366. * @note The default is @p TRUE.
  367. */
  368. #if !defined(CH_CFG_USE_OBJ_CACHES)
  369. #define CH_CFG_USE_OBJ_CACHES FALSE
  370. #endif
  371. /**
  372. * @brief Delegate threads APIs.
  373. * @details If enabled then the delegate threads APIs are included
  374. * in the kernel.
  375. *
  376. * @note The default is @p TRUE.
  377. */
  378. #if !defined(CH_CFG_USE_DELEGATES)
  379. #define CH_CFG_USE_DELEGATES FALSE
  380. #endif
  381. /**
  382. * @brief Jobs Queues APIs.
  383. * @details If enabled then the jobs queues APIs are included
  384. * in the kernel.
  385. *
  386. * @note The default is @p TRUE.
  387. */
  388. #if !defined(CH_CFG_USE_JOBS)
  389. #define CH_CFG_USE_JOBS FALSE
  390. #endif
  391. /** @} */
  392. /*===========================================================================*/
  393. /**
  394. * @name Objects factory options
  395. * @{
  396. */
  397. /*===========================================================================*/
  398. /**
  399. * @brief Objects Factory APIs.
  400. * @details If enabled then the objects factory APIs are included in the
  401. * kernel.
  402. *
  403. * @note The default is @p FALSE.
  404. */
  405. #if !defined(CH_CFG_USE_FACTORY)
  406. #define CH_CFG_USE_FACTORY TRUE
  407. #endif
  408. /**
  409. * @brief Maximum length for object names.
  410. * @details If the specified length is zero then the name is stored by
  411. * pointer but this could have unintended side effects.
  412. */
  413. #if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH)
  414. #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
  415. #endif
  416. /**
  417. * @brief Enables the registry of generic objects.
  418. */
  419. #if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY)
  420. #define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
  421. #endif
  422. /**
  423. * @brief Enables factory for generic buffers.
  424. */
  425. #if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS)
  426. #define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
  427. #endif
  428. /**
  429. * @brief Enables factory for semaphores.
  430. */
  431. #if !defined(CH_CFG_FACTORY_SEMAPHORES)
  432. #define CH_CFG_FACTORY_SEMAPHORES TRUE
  433. #endif
  434. /**
  435. * @brief Enables factory for mailboxes.
  436. */
  437. #if !defined(CH_CFG_FACTORY_MAILBOXES)
  438. #define CH_CFG_FACTORY_MAILBOXES TRUE
  439. #endif
  440. /**
  441. * @brief Enables factory for objects FIFOs.
  442. */
  443. #if !defined(CH_CFG_FACTORY_OBJ_FIFOS)
  444. #define CH_CFG_FACTORY_OBJ_FIFOS TRUE
  445. #endif
  446. /**
  447. * @brief Enables factory for Pipes.
  448. */
  449. #if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__)
  450. #define CH_CFG_FACTORY_PIPES TRUE
  451. #endif
  452. /** @} */
  453. /*===========================================================================*/
  454. /**
  455. * @name Debug options
  456. * @{
  457. */
  458. /*===========================================================================*/
  459. /**
  460. * @brief Debug option, kernel statistics.
  461. *
  462. * @note The default is @p FALSE.
  463. */
  464. #if !defined(CH_DBG_STATISTICS)
  465. #define CH_DBG_STATISTICS FALSE
  466. #endif
  467. /**
  468. * @brief Debug option, system state check.
  469. * @details If enabled the correct call protocol for system APIs is checked
  470. * at runtime.
  471. *
  472. * @note The default is @p FALSE.
  473. */
  474. #if !defined(CH_DBG_SYSTEM_STATE_CHECK)
  475. #define CH_DBG_SYSTEM_STATE_CHECK FALSE
  476. #endif
  477. /**
  478. * @brief Debug option, parameters checks.
  479. * @details If enabled then the checks on the API functions input
  480. * parameters are activated.
  481. *
  482. * @note The default is @p FALSE.
  483. */
  484. #if !defined(CH_DBG_ENABLE_CHECKS)
  485. #define CH_DBG_ENABLE_CHECKS FALSE
  486. #endif
  487. /**
  488. * @brief Debug option, consistency checks.
  489. * @details If enabled then all the assertions in the kernel code are
  490. * activated. This includes consistency checks inside the kernel,
  491. * runtime anomalies and port-defined checks.
  492. *
  493. * @note The default is @p FALSE.
  494. */
  495. #if !defined(CH_DBG_ENABLE_ASSERTS)
  496. #define CH_DBG_ENABLE_ASSERTS FALSE
  497. #endif
  498. /**
  499. * @brief Debug option, trace buffer.
  500. * @details If enabled then the trace buffer is activated.
  501. *
  502. * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
  503. */
  504. #if !defined(CH_DBG_TRACE_MASK)
  505. #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
  506. #endif
  507. /**
  508. * @brief Trace buffer entries.
  509. * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
  510. * different from @p CH_DBG_TRACE_MASK_DISABLED.
  511. */
  512. #if !defined(CH_DBG_TRACE_BUFFER_SIZE)
  513. #define CH_DBG_TRACE_BUFFER_SIZE 128
  514. #endif
  515. /**
  516. * @brief Debug option, stack checks.
  517. * @details If enabled then a runtime stack check is performed.
  518. *
  519. * @note The default is @p FALSE.
  520. * @note The stack check is performed in a architecture/port dependent way.
  521. * It may not be implemented or some ports.
  522. * @note The default failure mode is to halt the system with the global
  523. * @p panic_msg variable set to @p NULL.
  524. */
  525. #if !defined(CH_DBG_ENABLE_STACK_CHECK)
  526. #define CH_DBG_ENABLE_STACK_CHECK FALSE
  527. #endif
  528. /**
  529. * @brief Debug option, stacks initialization.
  530. * @details If enabled then the threads working area is filled with a byte
  531. * value when a thread is created. This can be useful for the
  532. * runtime measurement of the used stack.
  533. *
  534. * @note The default is @p FALSE.
  535. */
  536. #if !defined(CH_DBG_FILL_THREADS)
  537. #define CH_DBG_FILL_THREADS FALSE
  538. #endif
  539. /**
  540. * @brief Debug option, threads profiling.
  541. * @details If enabled then a field is added to the @p thread_t structure that
  542. * counts the system ticks occurred while executing the thread.
  543. *
  544. * @note The default is @p FALSE.
  545. * @note This debug option is not currently compatible with the
  546. * tickless mode.
  547. */
  548. #if !defined(CH_DBG_THREADS_PROFILING)
  549. #define CH_DBG_THREADS_PROFILING FALSE
  550. #endif
  551. /** @} */
  552. /*===========================================================================*/
  553. /**
  554. * @name Kernel hooks
  555. * @{
  556. */
  557. /*===========================================================================*/
  558. /**
  559. * @brief System structure extension.
  560. * @details User fields added to the end of the @p ch_system_t structure.
  561. */
  562. #define CH_CFG_SYSTEM_EXTRA_FIELDS \
  563. /* Add threads custom fields here.*/
  564. /**
  565. * @brief System initialization hook.
  566. * @details User initialization code added to the @p chSysInit() function
  567. * just before interrupts are enabled globally.
  568. */
  569. #define CH_CFG_SYSTEM_INIT_HOOK() { \
  570. /* Add threads initialization code here.*/ \
  571. }
  572. /**
  573. * @brief Threads descriptor structure extension.
  574. * @details User fields added to the end of the @p thread_t structure.
  575. */
  576. #define CH_CFG_THREAD_EXTRA_FIELDS \
  577. /* Add threads custom fields here.*/
  578. /**
  579. * @brief Threads initialization hook.
  580. * @details User initialization code added to the @p _thread_init() function.
  581. *
  582. * @note It is invoked from within @p _thread_init() and implicitly from all
  583. * the threads creation APIs.
  584. */
  585. #define CH_CFG_THREAD_INIT_HOOK(tp) { \
  586. /* Add threads initialization code here.*/ \
  587. }
  588. /**
  589. * @brief Threads finalization hook.
  590. * @details User finalization code added to the @p chThdExit() API.
  591. */
  592. #define CH_CFG_THREAD_EXIT_HOOK(tp) { \
  593. /* Add threads finalization code here.*/ \
  594. }
  595. /**
  596. * @brief Context switch hook.
  597. * @details This hook is invoked just before switching between threads.
  598. */
  599. #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
  600. /* Context switch code here.*/ \
  601. }
  602. /**
  603. * @brief ISR enter hook.
  604. */
  605. #define CH_CFG_IRQ_PROLOGUE_HOOK() { \
  606. /* IRQ prologue code here.*/ \
  607. }
  608. /**
  609. * @brief ISR exit hook.
  610. */
  611. #define CH_CFG_IRQ_EPILOGUE_HOOK() { \
  612. /* IRQ epilogue code here.*/ \
  613. }
  614. /**
  615. * @brief Idle thread enter hook.
  616. * @note This hook is invoked within a critical zone, no OS functions
  617. * should be invoked from here.
  618. * @note This macro can be used to activate a power saving mode.
  619. */
  620. #define CH_CFG_IDLE_ENTER_HOOK() { \
  621. /* Idle-enter code here.*/ \
  622. }
  623. /**
  624. * @brief Idle thread leave hook.
  625. * @note This hook is invoked within a critical zone, no OS functions
  626. * should be invoked from here.
  627. * @note This macro can be used to deactivate a power saving mode.
  628. */
  629. #define CH_CFG_IDLE_LEAVE_HOOK() { \
  630. /* Idle-leave code here.*/ \
  631. }
  632. /**
  633. * @brief Idle Loop hook.
  634. * @details This hook is continuously invoked by the idle thread loop.
  635. */
  636. #define CH_CFG_IDLE_LOOP_HOOK() { \
  637. /* Idle loop code here.*/ \
  638. }
  639. /**
  640. * @brief System tick event hook.
  641. * @details This hook is invoked in the system tick handler immediately
  642. * after processing the virtual timers queue.
  643. */
  644. #define CH_CFG_SYSTEM_TICK_HOOK() { \
  645. /* System tick event code here.*/ \
  646. }
  647. /**
  648. * @brief System halt hook.
  649. * @details This hook is invoked in case to a system halting error before
  650. * the system is halted.
  651. */
  652. #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
  653. /* System halt code here.*/ \
  654. }
  655. /**
  656. * @brief Trace hook.
  657. * @details This hook is invoked each time a new record is written in the
  658. * trace buffer.
  659. */
  660. #define CH_CFG_TRACE_HOOK(tep) { \
  661. /* Trace code here.*/ \
  662. }
  663. /** @} */
  664. /*===========================================================================*/
  665. /* Port-specific settings (override port settings defaulted in chcore.h). */
  666. /*===========================================================================*/
  667. #endif /* CHCONF_H */
  668. /** @} */