nilconf.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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 nilconf.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 _NILCONF_H_
  24. #define _NILCONF_H_
  25. /*===========================================================================*/
  26. /**
  27. * @name Kernel parameters and options
  28. * @{
  29. */
  30. /*===========================================================================*/
  31. /**
  32. * @brief Number of user threads in the application.
  33. * @note This number is not inclusive of the idle thread which is
  34. * Implicitly handled.
  35. */
  36. #define NIL_CFG_NUM_THREADS 3
  37. /** @} */
  38. /*===========================================================================*/
  39. /**
  40. * @name System timer settings
  41. * @{
  42. */
  43. /*===========================================================================*/
  44. /**
  45. * @brief System time counter resolution.
  46. * @note Allowed values are 16 or 32 bits.
  47. */
  48. #define NIL_CFG_ST_RESOLUTION 32
  49. /**
  50. * @brief System tick frequency.
  51. * @note This value together with the @p NIL_CFG_ST_RESOLUTION
  52. * option defines the maximum amount of time allowed for
  53. * timeouts.
  54. */
  55. #define NIL_CFG_ST_FREQUENCY 1000
  56. /**
  57. * @brief Time delta constant for the tick-less mode.
  58. * @note If this value is zero then the system uses the classic
  59. * periodic tick. This value represents the minimum number
  60. * of ticks that is safe to specify in a timeout directive.
  61. * The value one is not valid, timeouts are rounded up to
  62. * this value.
  63. */
  64. #define NIL_CFG_ST_TIMEDELTA 0
  65. /** @} */
  66. /*===========================================================================*/
  67. /**
  68. * @name Subsystem options
  69. * @{
  70. */
  71. /*===========================================================================*/
  72. /**
  73. * @brief Events Flags APIs.
  74. * @details If enabled then the event flags APIs are included in the kernel.
  75. *
  76. * @note The default is @p TRUE.
  77. */
  78. #define NIL_CFG_USE_EVENTS TRUE
  79. /** @} */
  80. /*===========================================================================*/
  81. /**
  82. * @name Debug options
  83. * @{
  84. */
  85. /*===========================================================================*/
  86. /**
  87. * @brief System assertions.
  88. */
  89. #define NIL_CFG_ENABLE_ASSERTS FALSE
  90. /**
  91. * @brief Stack check.
  92. */
  93. #define NIL_CFG_ENABLE_STACK_CHECK FALSE
  94. /** @} */
  95. /*===========================================================================*/
  96. /**
  97. * @name Kernel hooks
  98. * @{
  99. */
  100. /*===========================================================================*/
  101. /**
  102. * @brief System initialization hook.
  103. */
  104. #if !defined(NIL_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__)
  105. #define NIL_CFG_SYSTEM_INIT_HOOK() { \
  106. }
  107. #endif
  108. /**
  109. * @brief Threads descriptor structure extension.
  110. * @details User fields added to the end of the @p thread_t structure.
  111. */
  112. #define NIL_CFG_THREAD_EXT_FIELDS \
  113. /* Add threads custom fields here.*/
  114. /**
  115. * @brief Threads initialization hook.
  116. */
  117. #define NIL_CFG_THREAD_EXT_INIT_HOOK(tr) { \
  118. /* Add custom threads initialization code here.*/ \
  119. }
  120. /**
  121. * @brief Idle thread enter hook.
  122. * @note This hook is invoked within a critical zone, no OS functions
  123. * should be invoked from here.
  124. * @note This macro can be used to activate a power saving mode.
  125. */
  126. #define NIL_CFG_IDLE_ENTER_HOOK() { \
  127. }
  128. /**
  129. * @brief Idle thread leave hook.
  130. * @note This hook is invoked within a critical zone, no OS functions
  131. * should be invoked from here.
  132. * @note This macro can be used to deactivate a power saving mode.
  133. */
  134. #define NIL_CFG_IDLE_LEAVE_HOOK() { \
  135. }
  136. /**
  137. * @brief System halt hook.
  138. */
  139. #if !defined(NIL_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
  140. #define NIL_CFG_SYSTEM_HALT_HOOK(reason) { \
  141. }
  142. #endif
  143. /** @} */
  144. /*===========================================================================*/
  145. /* Port-specific settings (override port settings defaulted in nilcore.h). */
  146. /*===========================================================================*/
  147. #endif /* _NILCONF_H_ */
  148. /** @} */