2022-08-11 15:36:19 -04:00
|
|
|
//$file${include::qv.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
|
|
//
|
|
|
|
// Model: qpcpp.qm
|
|
|
|
// File: ${include::qv.hpp}
|
|
|
|
//
|
2022-11-17 14:13:33 -05:00
|
|
|
// This code has been generated by QM 5.2.3 <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
|
|
|
|
// Support ends : 2023-12-31
|
|
|
|
// License scope:
|
|
|
|
//
|
|
|
|
// Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
|
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} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-04-19 19:23:30 -04:00
|
|
|
//! @file
|
|
|
|
//! @brief QV/C++ platform-independent public interface.
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2022-09-22 11:13:20 -04:00
|
|
|
#ifndef QP_INC_QV_HPP_
|
|
|
|
#define QP_INC_QV_HPP_
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2022-04-19 19:23:30 -04:00
|
|
|
//============================================================================
|
2022-08-11 15:36:19 -04:00
|
|
|
// QF customization for QV -- data members of the QActive class...
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2020-08-24 16:42:48 -04:00
|
|
|
// QV event-queue used for AOs
|
2022-08-11 15:36:19 -04:00
|
|
|
#define QF_EQUEUE_TYPE QEQueue
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//============================================================================
|
|
|
|
#include "qequeue.hpp" // QV kernel uses the native QF event queue
|
|
|
|
#include "qmpool.hpp" // QV kernel uses the native QF memory pool
|
|
|
|
#include "qf.hpp" // QF framework integrates directly with QV
|
2015-05-14 16:05:04 -04:00
|
|
|
|
2022-04-19 19:23:30 -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
|
|
|
|
2022-08-11 15:36:19 -04:00
|
|
|
//${QV::QV-base::onIdle} .....................................................
|
|
|
|
//! QV idle callback (customized in BSPs for QV)
|
2022-04-19 19:23:30 -04:00
|
|
|
//!
|
2022-08-11 15:36:19 -04:00
|
|
|
//! @attention
|
|
|
|
//! QV::onIdle() must be called with interrupts DISABLED because the
|
|
|
|
//! determination of the idle condition (no events in the queues) can
|
|
|
|
//! change at any time by an interrupt posting events to a queue.
|
|
|
|
//! QV::onIdle() MUST enable interrupts internally, ideally **atomically**
|
|
|
|
//! with putting the CPU into a power-saving mode.
|
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} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2022-04-19 19:23:30 -04:00
|
|
|
//============================================================================
|
2015-05-14 16:05:04 -04:00
|
|
|
// interface used only inside QF, but not in applications
|
|
|
|
#ifdef QP_IMPL
|
2022-08-11 15:36:19 -04:00
|
|
|
// QV-specific scheduler locking and event queue...
|
|
|
|
//$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_} .................................................
|
|
|
|
//! QV scheduler lock status (not needed in QV)
|
|
|
|
#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_} .................................................
|
|
|
|
//! QV scheduler locking (not needed in QV)
|
|
|
|
#define QF_SCHED_LOCK_(dummy) (static_cast<void>(0))
|
|
|
|
|
|
|
|
//${QV-impl::QF_SCHED_UNLOCK_} ...............................................
|
|
|
|
//! QV scheduler unlocking (not needed in QV)
|
|
|
|
#define QF_SCHED_UNLOCK_() (static_cast<void>(0))
|
|
|
|
|
|
|
|
//${QV-impl::QACTIVE_EQUEUE_WAIT_} ...........................................
|
|
|
|
//! QV native event queue waiting
|
|
|
|
#define QACTIVE_EQUEUE_WAIT_(me_) \
|
|
|
|
Q_ASSERT_ID(110, (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_} .........................................
|
|
|
|
//! QV native event queue signaling
|
|
|
|
#define QACTIVE_EQUEUE_SIGNAL_(me_) \
|
|
|
|
(QF::readySet_.insert(static_cast<std::uint_fast8_t>((me_)->m_prio)))
|
|
|
|
//$enddecl${QV-impl} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
// Native QF event pool operations...
|
|
|
|
//$declare${QF-QMPool-impl} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
|
|
|
|
|
|
|
//${QF-QMPool-impl::QF_EPOOL_TYPE_} ..........................................
|
|
|
|
#define QF_EPOOL_TYPE_ QMPool
|
|
|
|
|
|
|
|
//${QF-QMPool-impl::QF_EPOOL_INIT_} ..........................................
|
|
|
|
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
|
|
|
|
(p_).init((poolSto_), (poolSize_), (evtSize_))
|
|
|
|
|
|
|
|
//${QF-QMPool-impl::QF_EPOOL_EVENT_SIZE_} ....................................
|
|
|
|
#define QF_EPOOL_EVENT_SIZE_(p_) ((p_).getBlockSize())
|
|
|
|
|
|
|
|
//${QF-QMPool-impl::QF_EPOOL_GET_} ...........................................
|
|
|
|
#define QF_EPOOL_GET_(p_, e_, m_, qs_id_) \
|
|
|
|
((e_) = static_cast<QEvt *>((p_).get((m_), (qs_id_))))
|
|
|
|
|
|
|
|
//${QF-QMPool-impl::QF_EPOOL_PUT_} ...........................................
|
|
|
|
#define QF_EPOOL_PUT_(p_, e_, qs_id_) ((p_).put((e_), (qs_id_)))
|
|
|
|
//$enddecl${QF-QMPool-impl} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
#endif // QP_IMPL
|
2022-09-22 11:13:20 -04:00
|
|
|
|
|
|
|
#endif // QP_INC_QV_HPP_
|