More licensing checks.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9288 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
Giovanni Di Sirio 2016-04-16 10:25:03 +00:00
parent 3c90d99b01
commit bb42a06ea0
3 changed files with 54 additions and 4 deletions

View File

@ -57,7 +57,6 @@
*/
#define CH_CUSTOMER_LICENSED_RT TRUE
#define CH_CUSTOMER_LICENSED_NIL TRUE
#define CH_CUSTOMER_LICENSED_HAL TRUE
#define CH_CUSTOMER_LICENSED_EX TRUE
#define CH_CUSTOMER_LICENSED_PORT_CM0 TRUE
#define CH_CUSTOMER_LICENSED_PORT_CM3 TRUE

View File

@ -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

View File

@ -40,6 +40,10 @@
/* Derived constants and error checks. */
/*===========================================================================*/
#if CH_CUSTOMER_LICENSED_RT == FALSE
#error "ChibiOS/RT not licensed"
#endif
#if (CH_LICENSE_FEATURES != CH_FEATURES_FULL) && \
(CH_LICENSE_FEATURES != CH_FEATURES_INTERMEDIATE) && \
(CH_LICENSE_FEATURES == CH_FEATURES_BASIC)
@ -56,7 +60,7 @@
#define CH_CFG_ST_FREQUENCY 1000
#endif
/* Statistics and trace buffer restricted.*/
/* Restricted subsystems.*/
#undef CH_DBG_STATISTICS
#undef CH_DBG_TRACE_MASK
@ -73,7 +77,7 @@
#undef CH_CFG_ST_TIMEDELTA
#define CH_CFG_ST_TIMEDELTA 0
/* Several subsystems restricted.*/
/* Restricted subsystems.*/
#undef CH_CFG_USE_TM
#undef CH_CFG_USE_MUTEXES
#undef CH_CFG_USE_CONDVARS