From 0ca35b4b5a8fc67b2222fa0981cb650f1b938f35 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 17 Mar 2018 11:24:50 +0000 Subject: Removed separated configuration file for oslib. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11795 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/lib/include/chlib.h | 20 ++----- os/lib/readme.txt | 5 +- os/lib/templates/chlibconf.h | 126 ----------------------------------------- os/nil/include/ch.h | 5 ++ os/rt/include/chchecks.h | 55 +----------------- os/rt/include/chrestrictions.h | 5 ++ 6 files changed, 17 insertions(+), 199 deletions(-) delete mode 100644 os/lib/templates/chlibconf.h diff --git a/os/lib/include/chlib.h b/os/lib/include/chlib.h index caf3191ee..f398e1000 100644 --- a/os/lib/include/chlib.h +++ b/os/lib/include/chlib.h @@ -31,14 +31,6 @@ #ifndef CHLIB_H #define CHLIB_H -/* Tmeporary hack.*/ -#if !defined(_CHIBIOS_RT_CONF_VER_5_0_) && !defined(_CHIBIOS_NIL_CONF_VER_3_0_) -#include "chlibconf.h" -#else -#define _CHIBIOS_LIB_CONF_ -#define _CHIBIOS_LIB_CONF_VER_1_0_ -#endif - /*===========================================================================*/ /* Module constants. */ /*===========================================================================*/ @@ -96,6 +88,10 @@ #error "malformed chlicense.h" #endif +#if CH_CUSTOMER_LIC_LIB== FALSE +#error "ChibiOS/LIB not licensed" +#endif + #if (CH_LICENSE_FEATURES != CH_FEATURES_FULL) && \ (CH_LICENSE_FEATURES != CH_FEATURES_INTERMEDIATE) && \ (CH_LICENSE_FEATURES != CH_FEATURES_BASIC) @@ -135,14 +131,6 @@ (CH_LICENSE_FEATURES == CH_FEATURES_BASIC) */ /* Configuration file checks.*/ -#if !defined(_CHIBIOS_LIB_CONF_) -#error "invalid configuration file" -#endif - -#if !defined(_CHIBIOS_LIB_CONF_VER_1_0_) -#error "obsolete or unknown configuration file" -#endif - #if !defined(CH_CFG_USE_SEMAPHORES) #error "CH_CFG_USE_SEMAPHORES not defined in chconf.h" #endif diff --git a/os/lib/readme.txt b/os/lib/readme.txt index e1c274da4..d2e0e7222 100644 --- a/os/lib/readme.txt +++ b/os/lib/readme.txt @@ -1,3 +1,2 @@ -All the code contained under ./os/common/oslib are optional RTOS modules -compatible with both RT and NIL. The code is placed under ./os/common in -order to prevent code duplication and disalignments. +All the code contained under ./os/lib are high level RTOS extension modules +compatible with both RT and NIL. \ No newline at end of file diff --git a/os/lib/templates/chlibconf.h b/os/lib/templates/chlibconf.h deleted file mode 100644 index e51397e19..000000000 --- a/os/lib/templates/chlibconf.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - 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 templates/chlibconf.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 oslib_config - * @details OS Library related settings. - * @{ - */ - -#ifndef CHLIBCONF_H -#define CHLIBCONF_H - -#define _CHIBIOS_LIB_CONF_ -#define _CHIBIOS_LIB_CONF_VER_1_0_ - -/** - * @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 in chconf.h. - */ -#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. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES in chconf.h. - * @note Mutexes are recommended. - */ -#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 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 - -#endif /* CHLIBCONF_H */ - -/** @} */ diff --git a/os/nil/include/ch.h b/os/nil/include/ch.h index 06620573a..b5da42aac 100644 --- a/os/nil/include/ch.h +++ b/os/nil/include/ch.h @@ -418,6 +418,11 @@ /* Derived constants and error checks. */ /*===========================================================================*/ +/* License checks.*/ +#if !defined(CH_CUSTOMER_LIC_NIL) || !defined(CH_LICENSE_FEATURES) +#error "malformed chlicense.h" +#endif + #if CH_CUSTOMER_LIC_NIL == FALSE #error "ChibiOS/NIL not licensed" #endif diff --git a/os/rt/include/chchecks.h b/os/rt/include/chchecks.h index b4ca1c80d..5c38757cd 100644 --- a/os/rt/include/chchecks.h +++ b/os/rt/include/chchecks.h @@ -115,11 +115,7 @@ #endif #if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) -#error " not defined in chconf.h" -#endif - -#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) -#error " not defined in chconf.h" +#error "CH_CFG_USE_CONDVARS_TIMEOUT not defined in chconf.h" #endif #if !defined(CH_CFG_USE_EVENTS) @@ -138,59 +134,10 @@ #error "CH_CFG_USE_MESSAGES_PRIORITY not defined in chconf.h" #endif -#if !defined(CH_CFG_USE_MAILBOXES) -#error "CH_CFG_USE_MAILBOXES not defined in chconf.h" -#endif - -#if !defined(CH_CFG_USE_MEMCORE) -#error "CH_CFG_USE_MEMCORE not defined in chconf.h" -#endif - -#if !defined(CH_CFG_USE_HEAP) -#error "CH_CFG_USE_HEAP not defined in chconf.h" -#endif - -#if !defined(CH_CFG_USE_MEMPOOLS) -#error "CH_CFG_USE_MEMPOOLS not defined in chconf.h" -#endif - -#if !defined(CH_CFG_USE_OBJ_FIFOS) -#error "CH_CFG_USE_OBJ_FIFOS not defined in chconf.h" -#endif - #if !defined(CH_CFG_USE_DYNAMIC) #error "CH_CFG_USE_DYNAMIC not defined in chconf.h" #endif -/* Objects factory options checks.*/ -#if !defined(CH_CFG_USE_FACTORY) -#error "CH_CFG_USE_FACTORY not defined in chconf.h" -#endif - -#if !defined(CH_CFG_FACTORY_MAX_NAMES_LENGTH) -#error "CH_CFG_FACTORY_MAX_NAMES_LENGTH not defined in chconf.h" -#endif - -#if !defined(CH_CFG_FACTORY_OBJECTS_REGISTRY) -#error "CH_CFG_FACTORY_OBJECTS_REGISTRY not defined in chconf.h" -#endif - -#if !defined(CH_CFG_FACTORY_GENERIC_BUFFERS) -#error "CH_CFG_FACTORY_GENERIC_BUFFERS not defined in chconf.h" -#endif - -#if !defined(CH_CFG_FACTORY_SEMAPHORES) -#error "CH_CFG_FACTORY_SEMAPHORES not defined in chconf.h" -#endif - -#if !defined(CH_CFG_FACTORY_MAILBOXES) -#error "CH_CFG_FACTORY_MAILBOXES not defined in chconf.h" -#endif - -#if !defined(CH_CFG_FACTORY_OBJ_FIFOS) -#error "CH_CFG_FACTORY_OBJ_FIFOS not defined in chconf.h" -#endif - /* Debug options checks.*/ #if !defined(CH_DBG_STATISTICS) #error "CH_DBG_STATISTICS not defined in chconf.h" diff --git a/os/rt/include/chrestrictions.h b/os/rt/include/chrestrictions.h index 91dc5401f..3871b3c59 100644 --- a/os/rt/include/chrestrictions.h +++ b/os/rt/include/chrestrictions.h @@ -37,6 +37,11 @@ /* Derived constants and error checks. */ /*===========================================================================*/ +/* License checks.*/ +#if !defined(CH_CUSTOMER_LIC_RT) || !defined(CH_LICENSE_FEATURES) +#error "malformed chlicense.h" +#endif + #if CH_CUSTOMER_LIC_RT == FALSE #error "ChibiOS/RT not licensed" #endif -- cgit v1.2.3