aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-04-16 10:25:03 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-04-16 10:25:03 +0000
commitbb42a06ea099afc1070c8421e2695bb037434e97 (patch)
tree5b32a03ed2d0f38bf024c22e043e17fee60f70fb /os/nil
parent3c90d99b01319a4c36261b0f0f6b02a2410c7c7b (diff)
downloadChibiOS-bb42a06ea099afc1070c8421e2695bb037434e97.tar.gz
ChibiOS-bb42a06ea099afc1070c8421e2695bb037434e97.tar.bz2
ChibiOS-bb42a06ea099afc1070c8421e2695bb037434e97.zip
More licensing checks.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9288 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/nil')
-rw-r--r--os/nil/include/ch.h49
1 files changed, 48 insertions, 1 deletions
diff --git a/os/nil/include/ch.h b/os/nil/include/ch.h
index e517b9551..31ec8bfe3 100644
--- a/os/nil/include/ch.h
+++ b/os/nil/include/ch.h
@@ -30,8 +30,9 @@
#ifndef CH_H
#define CH_H
-#include "chconf.h"
#include "chtypes.h"
+#include "chconf.h"
+#include "chlicense.h"
/*===========================================================================*/
/* Module constants. */
@@ -353,6 +354,52 @@
/* Derived constants and error checks. */
/*===========================================================================*/
+#if CH_CUSTOMER_LICENSED_NIL == FALSE
+#error "ChibiOS/NIL not licensed"
+#endif
+
+#if (CH_LICENSE_FEATURES != CH_FEATURES_FULL) && \
+ (CH_LICENSE_FEATURES != CH_FEATURES_INTERMEDIATE) && \
+ (CH_LICENSE_FEATURES == CH_FEATURES_BASIC)
+#error "invalid CH_LICENSE_FEATURES setting"
+#endif
+
+/* Restrictions in basic and intermediate modes.*/
+#if (CH_LICENSE_FEATURES == CH_FEATURES_INTERMEDIATE) || \
+ (CH_LICENSE_FEATURES == CH_FEATURES_BASIC)
+
+/* System tick limited to 1000hz.*/
+#if CH_CFG_ST_FREQUENCY > 1000
+#undef CH_CFG_ST_FREQUENCY
+#define CH_CFG_ST_FREQUENCY 1000
+#endif
+
+/* Restricted subsystems.*/
+#undef CH_CFG_USE_MAILBOXES
+
+#define CH_CFG_USE_MAILBOXES FALSE
+
+#endif /* (CH_LICENSE_FEATURES == CH_FEATURES_INTERMEDIATE) ||
+ (CH_LICENSE_FEATURES == CH_FEATURES_BASIC) */
+
+/* Restrictions in basic mode.*/
+#if CH_LICENSE_FEATURES == CH_FEATURES_BASIC
+
+/* Tick-Less mode restricted.*/
+#undef CH_CFG_ST_TIMEDELTA
+#define CH_CFG_ST_TIMEDELTA 0
+
+/* Restricted subsystems.*/
+#undef CH_CFG_USE_MEMCORE
+#undef CH_CFG_USE_MEMPOOLS
+#undef CH_CFG_USE_HEAP
+
+#define CH_CFG_USE_MEMCORE FALSE
+#define CH_CFG_USE_MEMPOOLS FALSE
+#define CH_CFG_USE_HEAP FALSE
+
+#endif /* CH_LICENSE_FEATURES == CH_FEATURES_BASIC */
+
#if !defined(_CHIBIOS_NIL_CONF_)
#error "missing or wrong configuration file"
#endif