ChibiOS/RT  6.0.3
chrestrictions.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio.
3 
4  This file is part of ChibiOS.
5 
6  ChibiOS is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 3 of the License, or
9  (at your option) any later version.
10 
11  ChibiOS is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 /**
21  * @file chrestrictions.h
22  * @brief Licensing restrictions header.
23  *
24  * @addtogroup rt_restrictions
25  * @details This module is responsible for applying license-related
26  * restrictions to the configuration options.
27  * @{
28  */
29 
30 #ifndef CHRESTRICTIONS_H
31 #define CHRESTRICTIONS_H
32 
33 /*===========================================================================*/
34 /* Module constants. */
35 /*===========================================================================*/
36 
37 /*===========================================================================*/
38 /* Module pre-compile time settings. */
39 /*===========================================================================*/
40 
41 /*===========================================================================*/
42 /* Derived constants and error checks. */
43 /*===========================================================================*/
44 
45 /* License checks.*/
46 #if !defined(CH_CUSTOMER_LIC_RT) || !defined(CH_LICENSE_FEATURES)
47 #error "malformed chlicense.h"
48 #endif
49 
50 #if CH_CUSTOMER_LIC_RT == FALSE
51 #error "ChibiOS/RT not licensed"
52 #endif
53 
54 #if (CH_LICENSE_FEATURES != CH_FEATURES_FULL) && \
55  (CH_LICENSE_FEATURES != CH_FEATURES_INTERMEDIATE) && \
56  (CH_LICENSE_FEATURES != CH_FEATURES_BASIC)
57 #error "invalid CH_LICENSE_FEATURES setting"
58 #endif
59 
60 /* Restrictions in basic and intermediate modes.*/
61 #if (CH_LICENSE_FEATURES == CH_FEATURES_INTERMEDIATE) || \
62  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC)
63 
64 /* System tick limited to 1000hz.*/
65 #if CH_CFG_ST_FREQUENCY > 1000
66 #undef CH_CFG_ST_FREQUENCY
67 #define CH_CFG_ST_FREQUENCY 1000
68 #endif
69 
70 /* Restricted subsystems.*/
71 #undef CH_DBG_STATISTICS
72 #undef CH_DBG_TRACE_MASK
73 
74 #define CH_DBG_STATISTICS FALSE
75 #define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
76 
77 #endif /* (CH_LICENSE_FEATURES == CH_FEATURES_INTERMEDIATE) ||
78  (CH_LICENSE_FEATURES == CH_FEATURES_BASIC) */
79 
80 /* Restrictions in basic mode.*/
81 #if CH_LICENSE_FEATURES == CH_FEATURES_BASIC
82 
83 /* Tick-Less mode restricted.*/
84 #undef CH_CFG_ST_TIMEDELTA
85 #define CH_CFG_ST_TIMEDELTA 0
86 
87 /* Restricted subsystems.*/
88 #undef CH_CFG_USE_TM
89 #undef CH_CFG_USE_MUTEXES
90 #undef CH_CFG_USE_CONDVARS
91 #undef CH_CFG_USE_DYNAMIC
92 
93 #define CH_CFG_USE_TM FALSE
94 #define CH_CFG_USE_MUTEXES FALSE
95 #define CH_CFG_USE_CONDVARS FALSE
96 #define CH_CFG_USE_DYNAMIC FALSE
97 
98 #endif /* CH_LICENSE_FEATURES == CH_FEATURES_BASIC */
99 
100 /*===========================================================================*/
101 /* Module data structures and types. */
102 /*===========================================================================*/
103 
104 /*===========================================================================*/
105 /* Module macros. */
106 /*===========================================================================*/
107 
108 /*===========================================================================*/
109 /* External declarations. */
110 /*===========================================================================*/
111 
112 /*===========================================================================*/
113 /* Module inline functions. */
114 /*===========================================================================*/
115 
116 #endif /* CHRESTRICTIONS_H */
117 
118 /** @} */