qpc/include/qpc.h

213 lines
7.0 KiB
C
Raw Normal View History

//$file${include::qpc.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//
// Model: qpc.qm
// File: ${include::qpc.h}
//
// This code has been generated by QM 5.3.0 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// This code is covered by the following QP license:
// License # : LicenseRef-QL-dual
// Issued to : Any user of the QP/C real-time embedded framework
// Framework(s) : qpc
// Support ends : 2024-12-31
// License scope:
//
// Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
//
// Q u a n t u m L e a P s
// ------------------------
// Modern Embedded Software
//
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
//
// This software is dual-licensed under the terms of the open source GNU
// General Public License version 3 (or any later version), or alternatively,
// under the terms of one of the closed source Quantum Leaps commercial
// licenses.
//
// The terms of the open source GNU General Public License version 3
// can be found at: <www.gnu.org/licenses/gpl-3.0>
//
// The terms of the closed source Quantum Leaps commercial licenses
// can be found at: <www.state-machine.com/licensing>
//
// Redistributions in source code must retain this top-level comment block.
// Plagiarizing this software to sidestep the license obligations is illegal.
//
// Contact information:
// <www.state-machine.com/licensing>
// <info@state-machine.com>
//
//$endhead${include::qpc.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#ifndef QPC_H_
#define QPC_H_
2015-04-28 13:45:35 -04:00
#ifdef __cplusplus
extern "C" {
#endif
//============================================================================
#include "qp_port.h" // QP port from the port directory
#include "qsafe.h" // QP Functional Safety (FuSa) Subsystem
#ifdef Q_SPY // software tracing enabled?
#include "qs_port.h" // QS/C port from the port directory
2015-04-28 13:45:35 -04:00
#else
#include "qs_dummy.h" // QS/C dummy (inactive) interface
2015-04-28 13:45:35 -04:00
#endif
//============================================================================
2015-04-28 13:45:35 -04:00
#ifndef QP_API_VERSION
#define QP_API_VERSION 0
#endif // #ifndef QP_API_VERSION
2015-04-28 13:45:35 -04:00
//============================================================================
// QP API compatibility layer...
2019-02-10 21:00:39 -05:00
#if (QP_API_VERSION < 730)
//! @deprecated plain 'char' is no longer forbidden in MISRA-C:2023
typedef char char_t;
//! @deprecated assertion failure handler
//! Use Q_onError() instead.
#define Q_onAssert(module_, id_) Q_onError(module_, id_)
//! @deprecated #Q_NASSERT preprocessor switch to disable QP assertions
#ifdef Q_NASSERT
// #Q_UNSAFE now replaces the functionality of Q_NASSERT
#define Q_UNSAFE
//! @deprecated general purpose assertion with user-specified ID
//! number that **always** evaluates the `expr_` expression.
#define Q_ALLEGE_ID(id_, expr_) ((void)(expr_))
#else // QP FuSa Subsystem enabled
//! @deprecated general purpose assertion with user-specified ID
//! number that **always** evaluates the `expr_` expression.
//! @note
//! The use of this macro is no longer recommended.
#define Q_ALLEGE_ID(id_, expr_) if (!(expr_)) { \
QF_CRIT_STAT \
QF_CRIT_ENTRY(); \
Q_onError(&Q_this_module_[0], (id_)); \
QF_CRIT_EXIT(); \
} else ((void)0)
#endif
//! @deprecated general purpose assertion without ID number
//! that **always** evaluates the `expr_` expression.
//! Instead of ID number, this macro is based on the standard
//! `__LINE__` macro.
//!
//! @note The use of this macro is no longer recommended.
#define Q_ALLEGE(expr_) Q_ALLEGE_ID(__LINE__, (expr_))
//! Static (compile-time) assertion.
//! @deprecated
//! Use Q_ASSERT_STATIC() or better yet `_Static_assert()` instead.
#define Q_ASSERT_COMPILE(expr_) Q_ASSERT_STATIC(expr_)
//! @static @public @memberof QF
//! @deprecated
static inline void QF_psInit(
QSubscrList * const subscrSto,
enum_t const maxSignal)
{
QActive_psInit(subscrSto, maxSignal);
}
//! @deprecated instead use: QASM_INIT()
#define QHSM_INIT(me_, par_, qs_id_) QASM_INIT((me_), (par_), (qs_id_))
//! @deprecated instead use: QASM_DISPATCH()
#define QHSM_DISPATCH(me_, e_, qs_id_) QASM_DISPATCH((me_), (e_), (qs_id_))
2023-12-14 16:55:37 -05:00
//! @deprecated instead use: QASM_IS_IN()
#define QHsm_isIn(me_, state_) QHsm_isIn_((QAsm *)(me_), (state_))
//============================================================================
2020-10-01 12:48:48 -04:00
#if (QP_API_VERSION < 691)
//! @deprecated enable the QS global filter
2020-10-01 12:48:48 -04:00
#define QS_FILTER_ON(rec_) QS_GLB_FILTER((rec_))
//! @deprecated disable the QS global filter
2020-10-01 12:48:48 -04:00
#define QS_FILTER_OFF(rec_) QS_GLB_FILTER(-(rec_))
//! @deprecated enable the QS local filter for SM (state machine) object
2020-10-01 12:48:48 -04:00
#define QS_FILTER_SM_OBJ(obj_) ((void)0)
//! @deprecated enable the QS local filter for AO (active objects)
2020-10-01 12:48:48 -04:00
#define QS_FILTER_AO_OBJ(obj_) ((void)0)
//! @deprecated enable the QS local filter for MP (memory pool) object
2020-10-01 12:48:48 -04:00
#define QS_FILTER_MP_OBJ(obj_) ((void)0)
//! @deprecated enable the QS local filter for EQ (event queue) object
2020-10-01 12:48:48 -04:00
#define QS_FILTER_EQ_OBJ(obj_) ((void)0)
//! @deprecated enable the QS local filter for TE (time event) object
2020-10-01 12:48:48 -04:00
#define QS_FILTER_TE_OBJ(obj_) ((void)0)
#ifdef Q_SPY
//! @deprecated local Filter for a generic application object `obj_`.
#define QS_FILTER_AP_OBJ(obj_) (QS_filt_.loc_AP = (obj_))
//! @deprecated begin of a user QS record, instead use QS_BEGIN_ID()
#define QS_BEGIN(rec_, obj_) \
if (((QS_filt_.glb[(uint_fast8_t)(rec_) >> 3U] \
& (1U << ((uint_fast8_t)(rec_) & 7U))) != 0U) \
&& ((QS_priv_.locFilter_AP == (void *)0) \
|| (QS_priv_.locFilter_AP == (obj_)))) \
{ \
QS_CRIT_STAT \
QS_CRIT_ENTRY(); \
QS_beginRec_((uint_fast8_t)(rec_)); \
2020-10-01 12:48:48 -04:00
QS_TIME_PRE_(); {
//! @deprecated Output formatted uint32_t to the QS record
2020-10-01 12:48:48 -04:00
#define QS_U32_HEX(width_, data_) \
2022-12-20 17:02:45 -05:00
(QS_u32_fmt_((uint8_t)(((width_) << 4)) | QS_HEX_FMT, (data_)))
2020-10-01 12:48:48 -04:00
#else
#define QS_FILTER_AP_OBJ(obj_) ((void)0)
#define QS_BEGIN(rec_, obj_) if (false) {
#define QS_U32_HEX(width_, data_) ((void)0)
#endif
//============================================================================
2019-12-31 15:55:08 -05:00
#if (QP_API_VERSION < 660)
//! @deprecated casting to QXThreadHandler
//! instead use: the new signature of QXThreadHandler and don't cast
2019-12-31 15:55:08 -05:00
#define Q_XTHREAD_CAST(handler_) ((QXThreadHandler)(handler_))
//============================================================================
2016-11-30 18:14:20 -05:00
#if (QP_API_VERSION < 580)
//! @deprecated instead use: QASM_INIT()
#define QMSM_INIT(me_, par_, qs_id_) QASM_INIT((me_), (par_), (qs_id_))
2016-11-30 18:14:20 -05:00
//! @deprecated instead use: QASM_DISPATCH()
#define QMSM_DISPATCH(me_, e_, qs_id_) QASM_DISPATCH((me_), (e_), (qs_id_))
2015-04-28 13:45:35 -04:00
#endif // QP_API_VERSION < 580
#endif // QP_API_VERSION < 660
#endif // QP_API_VERSION < 691
#endif // QP_API_VERSION < 700
2015-04-28 13:45:35 -04:00
#ifdef __cplusplus
}
#endif
#endif // QPC_H_