qpcpp/source/qk_pkg.h
Quantum Leaps 16708447b9 5.4.0
2015-05-14 16:05:04 -04:00

89 lines
3.5 KiB
C

/// @file
/// @brief Internal (package scope) QK/C++ interface.
/// @ingroup qk
/// @cond
///***************************************************************************
/// Product: QK/C++
/// Last updated for version 5.4.0
/// Last updated on 2014-04-29
///
/// Q u a n t u m L e a P s
/// ---------------------------
/// innovating embedded systems
///
/// Copyright (C) Quantum Leaps, www.state-machine.com.
///
/// This program is open source software: you can redistribute it and/or
/// modify it under the terms of the GNU General Public License as published
/// by the Free Software Foundation, either version 3 of the License, or
/// (at your option) any later version.
///
/// Alternatively, this program may be distributed and modified under the
/// terms of Quantum Leaps commercial licenses, which expressly supersede
/// the GNU General Public License and are specifically designed for
/// licensees interested in retaining the proprietary status of their code.
///
/// This program is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// GNU General Public License for more details.
///
/// You should have received a copy of the GNU General Public License
/// along with this program. If not, see <http://www.gnu.org/licenses/>.
///
/// Contact information:
/// Web: www.state-machine.com
/// Email: info@state-machine.com
///***************************************************************************
/// @endcond
#ifndef qk_pkg_h
#define qk_pkg_h
#ifndef QF_CRIT_STAT_TYPE
//! An internal macro for defining the critical section status type.
/// @description
/// The purpose of this macro is to enable writing the same code for the
/// case when critical sectgion status type is defined and when it is not.
/// If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
/// provides the definition of the critical section status varaible.
/// Otherwise this macro is empty.
/// @sa #QF_CRIT_STAT_TYPE
#define QF_CRIT_STAT_
//! This is an internal macro for entering a critical section.
/// @description
/// The purpose of this macro is to enable writing the same code for the
/// case when critical sectgion status type is defined and when it is not.
/// If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
/// invokes #QF_CRIT_ENTRY passing the key variable as the parameter.
/// Otherwise #QF_CRIT_ENTRY is invoked with a dummy parameter.
/// @sa #QF_CRIT_ENTRY
#define QF_CRIT_ENTRY_() QF_CRIT_ENTRY(dummy)
//! This is an internal macro for exiting a cricial section.
/// @description
/// The purpose of this macro is to enable writing the same code for the
/// case when critical sectgion status type is defined and when it is not.
/// If the macro #QF_CRIT_STAT_TYPE is defined, this internal macro
/// invokes #QF_CRIT_EXIT passing the key variable as the parameter.
/// Otherwise #QF_CRIT_EXIT is invoked with a dummy parameter.
/// @sa #QF_CRIT_EXIT
#define QF_CRIT_EXIT_() QF_CRIT_EXIT(dummy)
#else
#define QF_CRIT_STAT_ QF_CRIT_STAT_TYPE critStat_;
#define QF_CRIT_ENTRY_() QF_CRIT_ENTRY(critStat_)
#define QF_CRIT_EXIT_() QF_CRIT_EXIT(critStat_)
#endif
// package-scope objects...
#ifndef QK_NO_MUTEX
//! QK mutex priority ceiling
extern "C" uint_fast8_t volatile QK_ceilingPrio_;
#endif
#endif // qk_pkg_h