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