Subversion Repositories ChibiGauge

Rev

Rev 8 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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