123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- /*
- ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- */
- /**
- * @file nil/templates/chconf.h
- * @brief Configuration file template.
- * @details A copy of this file must be placed in each project directory, it
- * contains the application specific kernel settings.
- *
- * @addtogroup NIL_CONFIG
- * @details Kernel related settings and hooks.
- * @{
- */
- #ifndef CHCONF_H
- #define CHCONF_H
- #define _CHIBIOS_NIL_CONF_
- #define _CHIBIOS_NIL_CONF_VER_3_2_
- /*===========================================================================*/
- /**
- * @name Kernel parameters and options
- * @{
- */
- /*===========================================================================*/
- /**
- * @brief Number of user threads in the application.
- * @note This number is not inclusive of the idle thread which is
- * Implicitly handled.
- */
- #define CH_CFG_NUM_THREADS 3
- /** @} */
- /*===========================================================================*/
- /**
- * @name System timer settings
- * @{
- */
- /*===========================================================================*/
- /**
- * @brief System time counter resolution.
- * @note Allowed values are 16 or 32 bits.
- */
- #define CH_CFG_ST_RESOLUTION 16
- /**
- * @brief System tick frequency.
- * @note This value together with the @p CH_CFG_ST_RESOLUTION
- * option defines the maximum amount of time allowed for
- * timeouts.
- */
- #define CH_CFG_ST_FREQUENCY 10000
- /**
- * @brief Time delta constant for the tick-less mode.
- * @note If this value is zero then the system uses the classic
- * periodic tick. This value represents the minimum number
- * of ticks that is safe to specify in a timeout directive.
- * The value one is not valid, timeouts are rounded up to
- * this value.
- */
- #define CH_CFG_ST_TIMEDELTA 2
- /** @} */
- /*===========================================================================*/
- /**
- * @name Subsystem options
- * @{
- */
- /*===========================================================================*/
- /**
- * @brief Semaphores APIs.
- * @details If enabled then the Semaphores APIs are included in the kernel.
- *
- * @note The default is @p TRUE.
- */
- #define CH_CFG_USE_SEMAPHORES TRUE
- /**
- * @brief Mutexes APIs.
- * @details If enabled then the mutexes APIs are included in the kernel.
- *
- * @note Feature not currently implemented.
- * @note The default is @p FALSE.
- */
- #define CH_CFG_USE_MUTEXES FALSE
- /**
- * @brief Events Flags APIs.
- * @details If enabled then the event flags APIs are included in the kernel.
- *
- * @note The default is @p TRUE.
- */
- #define CH_CFG_USE_EVENTS TRUE
- /**
- * @brief Mailboxes APIs.
- * @details If enabled then the asynchronous messages (mailboxes) APIs are
- * included in the kernel.
- *
- * @note The default is @p TRUE.
- * @note Requires @p CH_CFG_USE_SEMAPHORES.
- */
- #define CH_CFG_USE_MAILBOXES TRUE
- /**
- * @brief Core Memory Manager APIs.
- * @details If enabled then the core memory manager APIs are included
- * in the kernel.
- *
- * @note The default is @p TRUE.
- */
- #define CH_CFG_USE_MEMCORE TRUE
- /**
- * @brief Heap Allocator APIs.
- * @details If enabled then the memory heap allocator APIs are included
- * in the kernel.
- *
- * @note The default is @p TRUE.
- */
- #define CH_CFG_USE_HEAP TRUE
- /**
- * @brief Memory Pools Allocator APIs.
- * @details If enabled then the memory pools allocator APIs are included
- * in the kernel.
- *
- * @note The default is @p TRUE.
- */
- #define CH_CFG_USE_MEMPOOLS TRUE
- /**
- * @brief Objects FIFOs APIs.
- * @details If enabled then the objects FIFOs APIs are included
- * in the kernel.
- *
- * @note The default is @p TRUE.
- */
- #define CH_CFG_USE_OBJ_FIFOS TRUE
- /**
- * @brief Pipes APIs.
- * @details If enabled then the pipes APIs are included
- * in the kernel.
- *
- * @note The default is @p TRUE.
- */
- #define CH_CFG_USE_PIPES TRUE
- /**
- * @brief Managed RAM size.
- * @details Size of the RAM area to be managed by the OS. If set to zero
- * then the whole available RAM is used. The core memory is made
- * available to the heap allocator and/or can be used directly through
- * the simplified core memory allocator.
- *
- * @note In order to let the OS manage the whole RAM the linker script must
- * provide the @p __heap_base__ and @p __heap_end__ symbols.
- * @note Requires @p CH_CFG_USE_MEMCORE.
- */
- #define CH_CFG_MEMCORE_SIZE 0
- /** @} */
- /*===========================================================================*/
- /**
- * @name Objects factory options
- * @{
- */
- /*===========================================================================*/
- /**
- * @brief Objects Factory APIs.
- * @details If enabled then the objects factory APIs are included in the
- * kernel.
- *
- * @note The default is @p FALSE.
- */
- #define CH_CFG_USE_FACTORY TRUE
- /**
- * @brief Maximum length for object names.
- * @details If the specified length is zero then the name is stored by
- * pointer but this could have unintended side effects.
- */
- #define CH_CFG_FACTORY_MAX_NAMES_LENGTH 8
- /**
- * @brief Enables the registry of generic objects.
- */
- #define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
- /**
- * @brief Enables factory for generic buffers.
- */
- #define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
- /**
- * @brief Enables factory for semaphores.
- */
- #define CH_CFG_FACTORY_SEMAPHORES TRUE
- /**
- * @brief Enables factory for mailboxes.
- */
- #define CH_CFG_FACTORY_MAILBOXES TRUE
- /**
- * @brief Enables factory for objects FIFOs.
- */
- #define CH_CFG_FACTORY_OBJ_FIFOS TRUE
- /**
- * @brief Enables factory for Pipes.
- */
- #define CH_CFG_FACTORY_PIPES TRUE
- /** @} */
- /*===========================================================================*/
- /**
- * @name Debug options
- * @{
- */
- /*===========================================================================*/
- /**
- * @brief Debug option, kernel statistics.
- *
- * @note Feature not currently implemented.
- * @note The default is @p FALSE.
- */
- #define CH_DBG_STATISTICS FALSE
- /**
- * @brief Debug option, system state check.
- *
- * @note The default is @p FALSE.
- */
- #define CH_DBG_SYSTEM_STATE_CHECK TRUE
- /**
- * @brief Debug option, parameters checks.
- *
- * @note The default is @p FALSE.
- */
- #define CH_DBG_ENABLE_CHECKS TRUE
- /**
- * @brief System assertions.
- *
- * @note The default is @p FALSE.
- */
- #define CH_DBG_ENABLE_ASSERTS TRUE
- /**
- * @brief Stack check.
- *
- * @note The default is @p FALSE.
- */
- #define CH_DBG_ENABLE_STACK_CHECK TRUE
- /** @} */
- /*===========================================================================*/
- /**
- * @name Kernel hooks
- * @{
- */
- /*===========================================================================*/
- /**
- * @brief System initialization hook.
- */
- #if !defined(CH_CFG_SYSTEM_INIT_HOOK) || defined(__DOXYGEN__)
- #define CH_CFG_SYSTEM_INIT_HOOK() { \
- }
- #endif
- /**
- * @brief Threads descriptor structure extension.
- * @details User fields added to the end of the @p thread_t structure.
- */
- #define CH_CFG_THREAD_EXT_FIELDS \
- /* Add threads custom fields here.*/
- /**
- * @brief Threads initialization hook.
- */
- #define CH_CFG_THREAD_EXT_INIT_HOOK(tr) { \
- /* Add custom threads initialization code here.*/ \
- }
- /**
- * @brief Idle thread enter hook.
- * @note This hook is invoked within a critical zone, no OS functions
- * should be invoked from here.
- * @note This macro can be used to activate a power saving mode.
- */
- #define CH_CFG_IDLE_ENTER_HOOK() { \
- }
- /**
- * @brief Idle thread leave hook.
- * @note This hook is invoked within a critical zone, no OS functions
- * should be invoked from here.
- * @note This macro can be used to deactivate a power saving mode.
- */
- #define CH_CFG_IDLE_LEAVE_HOOK() { \
- }
- /**
- * @brief System halt hook.
- */
- #if !defined(CH_CFG_SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
- #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
- }
- #endif
- /** @} */
- /*===========================================================================*/
- /* Port-specific settings (override port settings defaulted in nilcore.h). */
- /*===========================================================================*/
- #endif /* CHCONF_H */
- /** @} */
|