chrestrictions.h 4.3 KB

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