qpc.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*$file${include::qpc.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
  2. /*
  3. * Model: qpc.qm
  4. * File: ${include::qpc.h}
  5. *
  6. * This code has been generated by QM 5.2.5 <www.state-machine.com/qm>.
  7. * DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
  8. *
  9. * This code is covered by the following QP license:
  10. * License # : LicenseRef-QL-dual
  11. * Issued to : Any user of the QP/C real-time embedded framework
  12. * Framework(s) : qpc
  13. * Support ends : 2023-12-31
  14. * License scope:
  15. *
  16. * Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
  17. *
  18. * SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
  19. *
  20. * This software is dual-licensed under the terms of the open source GNU
  21. * General Public License version 3 (or any later version), or alternatively,
  22. * under the terms of one of the closed source Quantum Leaps commercial
  23. * licenses.
  24. *
  25. * The terms of the open source GNU General Public License version 3
  26. * can be found at: <www.gnu.org/licenses/gpl-3.0>
  27. *
  28. * The terms of the closed source Quantum Leaps commercial licenses
  29. * can be found at: <www.state-machine.com/licensing>
  30. *
  31. * Redistributions in source code must retain this top-level comment block.
  32. * Plagiarizing this software to sidestep the license obligations is illegal.
  33. *
  34. * Contact information:
  35. * <www.state-machine.com/licensing>
  36. * <info@state-machine.com>
  37. */
  38. /*$endhead${include::qpc.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
  39. /*! @file
  40. * @brief QP/C public interface including backwards-compatibility layer
  41. * @details
  42. * This header file must be included directly or indirectly
  43. * in all application modules (*.c files) that use QP/C.
  44. */
  45. #ifndef QPC_H_
  46. #define QPC_H_
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. /*==========================================================================*/
  51. #include "qf_port.h" /* QF/C port from the port directory */
  52. #include "qassert.h" /* QP embedded systems-friendly assertions */
  53. #ifdef Q_SPY /* software tracing enabled? */
  54. #include "qs_port.h" /* QS/C port from the port directory */
  55. #else
  56. #include "qs_dummy.h" /* QS/C dummy (inactive) interface */
  57. #endif
  58. /*==========================================================================*/
  59. #ifndef QP_API_VERSION
  60. /*! Specifies the backwards compatibility with the QP/C API version.
  61. * @details
  62. * For example, QP_API_VERSION==691 will cause generating the compatibility
  63. * layer with QP/C version 6.9.1 and newer, but not older than 6.9.1.
  64. * QP_API_VERSION==0 causes generation of the maximum currently supported
  65. * backwards compatibility. This is the default.<br>
  66. * <br>
  67. * Conversely, QP_API_VERSION==9999 means that no compatibility layer should
  68. * be generated. This setting is useful for checking if an application
  69. * complies with the latest QP/C API.
  70. */
  71. #define QP_API_VERSION 0
  72. #endif /* #ifndef QP_API_VERSION */
  73. /*==========================================================================*/
  74. /* QP API compatibility layer... */
  75. #if (QP_API_VERSION < 700)
  76. /*! @deprecated plain 'char' is no longer forbidden in MISRA-C 2012 */
  77. typedef char char_t;
  78. /*! Static (compile-time) assertion.
  79. *
  80. * @deprecated
  81. * Use Q_ASSERT_STATIC() or better yet `_Static_assert()` instead.
  82. */
  83. #define Q_ASSERT_COMPILE(expr_) Q_ASSERT_STATIC(expr_)
  84. /*==========================================================================*/
  85. #if (QP_API_VERSION < 691)
  86. /*! @deprecated enable the QS global filter */
  87. #define QS_FILTER_ON(rec_) QS_GLB_FILTER((rec_))
  88. /*! @deprecated disable the QS global filter */
  89. #define QS_FILTER_OFF(rec_) QS_GLB_FILTER(-(rec_))
  90. /*! @deprecated enable the QS local filter for SM (state machine) object */
  91. #define QS_FILTER_SM_OBJ(obj_) ((void)0)
  92. /*! @deprecated enable the QS local filter for AO (active objects) */
  93. #define QS_FILTER_AO_OBJ(obj_) ((void)0)
  94. /*! @deprecated enable the QS local filter for MP (memory pool) object */
  95. #define QS_FILTER_MP_OBJ(obj_) ((void)0)
  96. /*! @deprecated enable the QS local filter for EQ (event queue) object */
  97. #define QS_FILTER_EQ_OBJ(obj_) ((void)0)
  98. /*! @deprecated enable the QS local filter for TE (time event) object */
  99. #define QS_FILTER_TE_OBJ(obj_) ((void)0)
  100. #ifdef Q_SPY
  101. /*! @deprecated local Filter for a generic application object `obj_`. */
  102. #define QS_FILTER_AP_OBJ(obj_) (QS_priv_.locFilter_AP = (obj_))
  103. /*! @deprecated begin of a user QS record, instead use QS_BEGIN_ID() */
  104. #define QS_BEGIN(rec_, obj_) \
  105. if (((QS_priv_.glbFilter[(uint_fast8_t)(rec_) >> 3U] \
  106. & (1U << ((uint_fast8_t)(rec_) & 7U))) != 0U) \
  107. && ((QS_priv_.locFilter_AP == (void *)0) \
  108. || (QS_priv_.locFilter_AP == (obj_)))) \
  109. { \
  110. QS_CRIT_STAT_ \
  111. QS_CRIT_E_(); \
  112. QS_beginRec_((uint_fast8_t)(rec_)); \
  113. QS_TIME_PRE_(); {
  114. /*! @deprecated Output formatted uint32_t to the QS record */
  115. #define QS_U32_HEX(width_, data_) \
  116. (QS_u32_fmt_((uint8_t)(((width_) << 4)) | QS_HEX_FMT, (data_)))
  117. #else
  118. #define QS_FILTER_AP_OBJ(obj_) ((void)0)
  119. #define QS_BEGIN(rec_, obj_) if (false) {
  120. #define QS_U32_HEX(width_, data_) ((void)0)
  121. #endif
  122. /*==========================================================================*/
  123. #if (QP_API_VERSION < 660)
  124. /*! @deprecated casting to QXThreadHandler
  125. * instead use: the new signature of QXThreadHandler and don't cast
  126. */
  127. #define Q_XTHREAD_CAST(handler_) ((QXThreadHandler)(handler_))
  128. /*==========================================================================*/
  129. #if (QP_API_VERSION < 580)
  130. /*! @deprecated call to the QMSM_INIT() operation; instead use: QHSM_INIT() */
  131. #define QMSM_INIT(me_, e_) QHSM_INIT((me_), (e_))
  132. /*! @deprecated call to the QMSM_DISPATCH() operation;
  133. * instead use: QHSM_DISPATCH() */
  134. #define QMSM_DISPATCH(me_, e_) QHSM_DISPATCH((me_), (e_), 0U)
  135. #endif /* QP_API_VERSION < 580 */
  136. #endif /* QP_API_VERSION < 660 */
  137. #endif /* QP_API_VERSION < 691 */
  138. #endif /* QP_API_VERSION < 700 */
  139. #ifdef __cplusplus
  140. }
  141. #endif
  142. #endif /* QPC_H_ */