2022-08-11 15:36:19 -04:00
|
|
|
//$file${include::qv.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
|
|
//
|
|
|
|
// Model: qpcpp.qm
|
|
|
|
// File: ${include::qv.hpp}
|
|
|
|
//
|
2024-01-17 07:50:09 -05:00
|
|
|
// This code has been generated by QM 6.1.1 <www.state-machine.com/qm>.
|
2022-08-11 15:36:19 -04:00
|
|
|
// 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) : qpcpp
|
2023-01-19 21:14:02 -05:00
|
|
|
// Support ends : 2024-12-31
|
2022-08-11 15:36:19 -04:00
|
|
|
// License scope:
|
|
|
|
//
|
|
|
|
// Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
|
2022-04-19 19:23:30 -04:00
|
|
|
//
|
2023-01-19 21:14:02 -05:00
|
|
|
// Q u a n t u m L e a P s
|
|
|
|
// ------------------------
|
|
|
|
// Modern Embedded Software
|
|
|
|
//
|
2022-04-19 19:23:30 -04:00
|
|
|
// 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:
|
2022-08-11 15:36:19 -04:00
|
|
|
// <www.state-machine.com/licensing>
|
2022-04-19 19:23:30 -04:00
|
|
|
// <info@state-machine.com>
|
2022-08-11 15:36:19 -04:00
|
|
|
//
|
|
|
|
//$endhead${include::qv.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2023-01-19 21:14:02 -05:00
|
|
|
#ifndef QV_HPP_
|
|
|
|
#define QV_HPP_
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//$declare${QV::QV-base} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
2015-05-14 16:05:04 -04:00
|
|
|
namespace QP {
|
2022-08-11 15:36:19 -04:00
|
|
|
namespace QV {
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2023-01-19 21:14:02 -05:00
|
|
|
//${QV::QV-base::Attr} .......................................................
|
|
|
|
class Attr {
|
|
|
|
public:
|
|
|
|
QPSet readySet;
|
2023-09-25 11:17:17 -04:00
|
|
|
std::uint_fast8_t schedCeil;
|
2023-01-19 21:14:02 -05:00
|
|
|
|
|
|
|
#ifndef Q_UNSAFE
|
|
|
|
QPSet readySet_dis;
|
|
|
|
#endif // ndef Q_UNSAFE
|
2023-09-25 11:17:17 -04:00
|
|
|
|
|
|
|
#ifndef Q_UNSAFE
|
|
|
|
std::uint_fast8_t schedCeil_dis;
|
|
|
|
#endif // ndef Q_UNSAFE
|
2023-01-19 21:14:02 -05:00
|
|
|
}; // class Attr
|
|
|
|
|
|
|
|
//${QV::QV-base::priv_} ......................................................
|
|
|
|
extern QV::Attr priv_;
|
|
|
|
|
2023-09-25 11:17:17 -04:00
|
|
|
//${QV::QV-base::schedDisable} ...............................................
|
|
|
|
void schedDisable(std::uint_fast8_t const ceiling);
|
|
|
|
|
|
|
|
//${QV::QV-base::schedEnable} ................................................
|
|
|
|
void schedEnable();
|
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${QV::QV-base::onIdle} .....................................................
|
2022-09-22 11:13:20 -04:00
|
|
|
void onIdle();
|
2022-08-11 15:36:19 -04:00
|
|
|
|
|
|
|
} // namespace QV
|
2015-05-14 16:05:04 -04:00
|
|
|
} // namespace QP
|
2022-08-11 15:36:19 -04:00
|
|
|
//$enddecl${QV::QV-base} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2023-01-19 21:14:02 -05:00
|
|
|
|
2022-04-19 19:23:30 -04:00
|
|
|
//============================================================================
|
2023-01-19 21:14:02 -05:00
|
|
|
// interface used only for internal implementation, but not in applications
|
2015-05-14 16:05:04 -04:00
|
|
|
#ifdef QP_IMPL
|
2023-01-19 21:14:02 -05:00
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//$declare${QV-impl} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${QV-impl::QF_SCHED_STAT_} .................................................
|
|
|
|
#define QF_SCHED_STAT_
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${QV-impl::QF_SCHED_LOCK_} .................................................
|
|
|
|
#define QF_SCHED_LOCK_(dummy) (static_cast<void>(0))
|
|
|
|
|
|
|
|
//${QV-impl::QF_SCHED_UNLOCK_} ...............................................
|
|
|
|
#define QF_SCHED_UNLOCK_() (static_cast<void>(0))
|
|
|
|
|
|
|
|
//${QV-impl::QACTIVE_EQUEUE_WAIT_} ...........................................
|
|
|
|
#define QACTIVE_EQUEUE_WAIT_(me_) \
|
2023-01-19 21:14:02 -05:00
|
|
|
Q_ASSERT_INCRIT(310, (me_)->m_eQueue.m_frontEvt != nullptr)
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${QV-impl::QACTIVE_EQUEUE_SIGNAL_} .........................................
|
2023-01-19 21:14:02 -05:00
|
|
|
#ifndef Q_UNSAFE
|
2022-08-11 15:36:19 -04:00
|
|
|
#define QACTIVE_EQUEUE_SIGNAL_(me_) \
|
2023-01-19 21:14:02 -05:00
|
|
|
QV::priv_.readySet.insert((me_)->m_prio); \
|
|
|
|
QV::priv_.readySet.update_(&QV::priv_.readySet_dis)
|
|
|
|
#endif // ndef Q_UNSAFE
|
|
|
|
|
|
|
|
//${QV-impl::QACTIVE_EQUEUE_SIGNAL_} .........................................
|
|
|
|
#ifdef Q_UNSAFE
|
|
|
|
#define QACTIVE_EQUEUE_SIGNAL_(me_) \
|
|
|
|
(QV::priv_.readySet.insert((me_)->m_prio))
|
|
|
|
#endif // def Q_UNSAFE
|
2022-08-11 15:36:19 -04:00
|
|
|
//$enddecl${QV-impl} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2023-01-19 21:14:02 -05:00
|
|
|
//$declare${QF_EPOOL-impl} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
2022-08-11 15:36:19 -04:00
|
|
|
|
2023-01-19 21:14:02 -05:00
|
|
|
//${QF_EPOOL-impl::QF_EPOOL_TYPE_} ...........................................
|
2022-08-11 15:36:19 -04:00
|
|
|
#define QF_EPOOL_TYPE_ QMPool
|
|
|
|
|
2023-01-19 21:14:02 -05:00
|
|
|
//${QF_EPOOL-impl::QF_EPOOL_INIT_} ...........................................
|
2022-08-11 15:36:19 -04:00
|
|
|
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
|
|
|
|
(p_).init((poolSto_), (poolSize_), (evtSize_))
|
|
|
|
|
2023-01-19 21:14:02 -05:00
|
|
|
//${QF_EPOOL-impl::QF_EPOOL_EVENT_SIZE_} .....................................
|
2022-08-11 15:36:19 -04:00
|
|
|
#define QF_EPOOL_EVENT_SIZE_(p_) ((p_).getBlockSize())
|
|
|
|
|
2023-01-19 21:14:02 -05:00
|
|
|
//${QF_EPOOL-impl::QF_EPOOL_GET_} ............................................
|
2024-01-17 07:50:09 -05:00
|
|
|
#define QF_EPOOL_GET_(p_, e_, m_, qsId_) \
|
|
|
|
((e_) = static_cast<QEvt *>((p_).get((m_), (qsId_))))
|
2022-08-11 15:36:19 -04:00
|
|
|
|
2023-01-19 21:14:02 -05:00
|
|
|
//${QF_EPOOL-impl::QF_EPOOL_PUT_} ............................................
|
2024-01-17 07:50:09 -05:00
|
|
|
#define QF_EPOOL_PUT_(p_, e_, qsId_) ((p_).put((e_), (qsId_)))
|
2023-01-19 21:14:02 -05:00
|
|
|
//$enddecl${QF_EPOOL-impl} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
#endif // QP_IMPL
|
2022-09-22 11:13:20 -04:00
|
|
|
|
2023-01-19 21:14:02 -05:00
|
|
|
#endif // QV_HPP_
|