qpc/include/qv.h
2024-08-16 10:58:06 -04:00

155 lines
5.4 KiB
C

//$file${include::qv.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//
// Model: qpc.qm
// File: ${include::qv.h}
//
// This code has been generated by QM 6.2.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 : 2025-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::qv.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#ifndef QV_H_
#define QV_H_
//$declare${QV::QV} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//${QV::QV} ..................................................................
//! @class QV
typedef struct QV {
//! @cond INTERNAL
uint8_t dummy;
//! @endcond
} QV;
//$enddecl${QV::QV} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//$declare${QV::QV-base} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//${QV::QV-base::Attr} .......................................................
//! @class QV_Attr
typedef struct {
// private:
//! @memberof QV_Attr
QPSet readySet;
//! @memberof QV_Attr
uint_fast8_t schedCeil;
#ifndef Q_UNSAFE
//! @memberof QV_Attr
QPSet readySet_dis;
#endif // ndef Q_UNSAFE
#ifndef Q_UNSAFE
//! @memberof QV_Attr
uint_fast8_t schedCeil_dis;
#endif // ndef Q_UNSAFE
} QV_Attr;
//${QV::QV-base::priv_} ......................................................
//! @static @private @memberof QV
extern QV_Attr QV_priv_;
//${QV::QV-base::schedDisable} ...............................................
//! @static @public @memberof QV
void QV_schedDisable(uint_fast8_t const ceiling);
//${QV::QV-base::schedEnable} ................................................
//! @static @public @memberof QV
void QV_schedEnable(void);
//${QV::QV-base::onIdle} .....................................................
//! @static @public @memberof QV
void QV_onIdle(void);
//$enddecl${QV::QV-base} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//============================================================================
// interface used only for internal implementation, but not in applications
#ifdef QP_IMPL
//$declare${QV-impl} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//${QV-impl::QF_SCHED_STAT_} .................................................
#define QF_SCHED_STAT_
//${QV-impl::QF_SCHED_LOCK_} .................................................
#define QF_SCHED_LOCK_(dummy) ((void)0)
//${QV-impl::QF_SCHED_UNLOCK_} ...............................................
#define QF_SCHED_UNLOCK_() ((void)0)
//${QV-impl::QACTIVE_EQUEUE_WAIT_} ...........................................
#define QACTIVE_EQUEUE_WAIT_(me_) \
Q_ASSERT_INCRIT(310, (me_)->eQueue.frontEvt != (QEvt *)0)
//${QV-impl::QACTIVE_EQUEUE_SIGNAL_} .........................................
#ifndef Q_UNSAFE
#define QACTIVE_EQUEUE_SIGNAL_(me_) \
QPSet_insert(&QV_priv_.readySet, (uint_fast8_t)(me_)->prio); \
QPSet_update_(&QV_priv_.readySet, &QV_priv_.readySet_dis)
#endif // ndef Q_UNSAFE
//${QV-impl::QACTIVE_EQUEUE_SIGNAL_} .........................................
#ifdef Q_UNSAFE
#define QACTIVE_EQUEUE_SIGNAL_(me_) \
QPSet_insert(&QV_priv_.readySet, (uint_fast8_t)(me_)->prio)
#endif // def Q_UNSAFE
//$enddecl${QV-impl} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//$declare${QF_EPOOL-impl} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
//${QF_EPOOL-impl::QF_EPOOL_TYPE_} ...........................................
#define QF_EPOOL_TYPE_ QMPool
//${QF_EPOOL-impl::QF_EPOOL_INIT_} ...........................................
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
(QMPool_init(&(p_), (poolSto_), (poolSize_), (evtSize_)))
//${QF_EPOOL-impl::QF_EPOOL_EVENT_SIZE_} .....................................
#define QF_EPOOL_EVENT_SIZE_(p_) ((uint_fast16_t)(p_).blockSize)
//${QF_EPOOL-impl::QF_EPOOL_GET_} ............................................
#define QF_EPOOL_GET_(p_, e_, m_, qsId_) \
((e_) = (QEvt *)QMPool_get(&(p_), (m_), (qsId_)))
//${QF_EPOOL-impl::QF_EPOOL_PUT_} ............................................
#define QF_EPOOL_PUT_(p_, e_, qsId_) \
(QMPool_put(&(p_), (e_), (qsId_)))
//$enddecl${QF_EPOOL-impl} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#endif // QP_IMPL
#endif // QV_H_