Skip to content

Commit 7204833

Browse files
committed
8.0.4
1 parent 686e9fe commit 7204833

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1669
-1125
lines changed

3rd_party

Submodule 3rd_party updated 47 files

examples

Submodule examples updated 346 files

include/qp.hpp

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
#define QP_HPP_
3131

3232
//============================================================================
33-
#define QP_VERSION_STR "8.0.3"
34-
#define QP_VERSION 803U
35-
// <VER>=803 <DATE>=250407
36-
#define QP_RELEASE 0x6ABEE96CU
33+
#define QP_VERSION_STR "8.0.4"
34+
#define QP_VERSION 804U
35+
// <VER>=804 <DATE>=250531
36+
#define QP_RELEASE 0x6AABFDABU
3737

3838
//============================================================================
3939
// default configuration settings
@@ -118,21 +118,19 @@ class QEvt {
118118
std::uint8_t poolNum_;
119119
std::uint8_t volatile refCtr_;
120120

121-
public:
122121
enum DynEvt: std::uint8_t { DYNAMIC };
123122

124-
public:
125123
explicit constexpr QEvt(QSignal const s) noexcept
126124
: sig(s),
127125
poolNum_(0x00U),
128126
refCtr_(0xE0U)
129127
{}
130128

131129
QEvt() = delete;
132-
void init() noexcept {
130+
void init() const noexcept {
133131
// no event parameters to initialize
134132
}
135-
void init(DynEvt const dummy) noexcept {
133+
void init(DynEvt const dummy) const noexcept {
136134
Q_UNUSED_PAR(dummy);
137135
// no event parameters to initialize
138136
}
@@ -170,6 +168,7 @@ union QAsmAttr {
170168
QXThreadHandler thr;
171169
QMState const *obj;
172170
QMTranActTable const *tatbl;
171+
std::uintptr_t uint;
173172
};
174173

175174
constexpr enum_t Q_USER_SIG {4};
@@ -180,7 +179,6 @@ class QAsm {
180179
QAsmAttr m_state;
181180
QAsmAttr m_temp;
182181

183-
public:
184182
// All possible return values from state-handlers
185183
// NOTE: The ordering is important for algorithmic correctness.
186184
static constexpr QState Q_RET_SUPER {0U};
@@ -210,14 +208,6 @@ class QAsm {
210208
static constexpr QSignal Q_EXIT_SIG {2U};
211209
static constexpr QSignal Q_INIT_SIG {3U};
212210

213-
protected:
214-
explicit QAsm() noexcept
215-
: m_state(),
216-
m_temp ()
217-
{}
218-
219-
public:
220-
221211
#ifdef Q_XTOR
222212
virtual ~QAsm() noexcept {
223213
// empty
@@ -259,6 +249,11 @@ class QAsm {
259249
}
260250

261251
protected:
252+
explicit QAsm() noexcept
253+
: m_state(),
254+
m_temp ()
255+
{}
256+
262257
QState tran(QStateHandler const target) noexcept {
263258
m_temp.fun = target;
264259
return Q_RET_TRAN;
@@ -386,8 +381,8 @@ class QMsm : public QP::QAsm {
386381
QMTranActTable const * const tatbl,
387382
std::uint_fast8_t const qsId);
388383
void exitToTranSource_(
389-
QMState const * const cs,
390-
QMState const * const ts,
384+
QMState const * const curr_state,
385+
QMState const * const tran_source,
391386
std::uint_fast8_t const qsId);
392387
QState enterHistory_(
393388
QMState const * const hist,

include/qsafe.h

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
//============================================================================
2-
// SafeQP/C Real-Time Embedded Framework (RTEF)
2+
// QP/C/C++ Real-Time Event Framework (RTEF)
33
//
44
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
55
//
66
// Q u a n t u m L e a P s
77
// ------------------------
88
// Modern Embedded Software
99
//
10-
// SPDX-License-Identifier: LicenseRef-QL-commercial
10+
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
1111
//
12-
// This software is licensed under the terms of the Quantum Leaps commercial
13-
// licenses. Please contact Quantum Leaps for more information about the
14-
// available licensing options.
12+
// This software is dual-licensed under the terms of the open-source GNU
13+
// General Public License (GPL) or under the terms of one of the closed-
14+
// source Quantum Leaps commercial licenses.
1515
//
16-
// RESTRICTIONS
17-
// You may NOT :
18-
// (a) redistribute, encumber, sell, rent, lease, sublicense, or otherwise
19-
// transfer rights in this software,
20-
// (b) remove or alter any trademark, logo, copyright or other proprietary
21-
// notices, legends, symbols or labels present in this software,
22-
// (c) plagiarize this software to sidestep the licensing obligations.
16+
// Redistributions in source code must retain this top-level comment block.
17+
// Plagiarizing this software to sidestep the license obligations is illegal.
18+
//
19+
// NOTE:
20+
// The GPL does NOT permit the incorporation of this code into proprietary
21+
// programs. Please contact Quantum Leaps for commercial licensing options,
22+
// which expressly supersede the GPL and are designed explicitly for
23+
// closed-source distribution.
2324
//
2425
// Quantum Leaps contact information:
2526
// <www.state-machine.com/licensing>
@@ -43,6 +44,10 @@
4344
#define QF_CRIT_EXIT() ((void)0)
4445
#endif
4546

47+
#ifndef QF_CRIT_EST
48+
#define QF_CRIT_EST() ((void)0)
49+
#endif
50+
4651
#define Q_DEFINE_THIS_MODULE(name_) \
4752
static char const Q_this_module_[] = name_;
4853

@@ -60,36 +65,50 @@
6065
} while (false)
6166

6267
#define Q_ERROR_ID(id_) do { \
63-
QF_CRIT_STAT \
64-
QF_CRIT_ENTRY(); \
68+
QF_CRIT_EST(); \
6569
Q_onError(&Q_this_module_[0], (id_)); \
66-
QF_CRIT_EXIT(); \
70+
} while (false)
71+
72+
#define Q_ASSERT_LOCAL(id_, expr_) do { \
73+
if (expr_) {} else { \
74+
QF_CRIT_EST(); \
75+
Q_onError(&Q_this_module_[0], (id_)); \
76+
} \
6777
} while (false)
6878

6979
// QF-FuSa disabled ==========================================================
7080
#else
7181

7282
#define Q_DEFINE_THIS_MODULE(name_)
73-
#define Q_ASSERT_INCRIT(id_, expr_) ((void)0)
74-
#define Q_ERROR_INCRIT(id_) ((void)0)
75-
#define Q_ASSERT_ID(id_, expr_) ((void)0)
76-
#define Q_ERROR_ID(id_) ((void)0)
83+
#define Q_ASSERT_INCRIT(id_, expr_) ((void)0)
84+
#define Q_ERROR_INCRIT(id_) ((void)0)
85+
#define Q_ASSERT_ID(id_, expr_) ((void)0)
86+
#define Q_ERROR_ID(id_) ((void)0)
87+
#define Q_ASSERT_LOCAL(id_, expr_) ((void)0)
7788

7889
#endif // QF-FuSa disabled
7990

8091
//============================================================================
8192
#define Q_DEFINE_THIS_FILE Q_DEFINE_THIS_MODULE(__FILE__)
8293
#define Q_ASSERT(expr_) Q_ASSERT_ID(__LINE__, (expr_))
8394
#define Q_ERROR() Q_ERROR_ID(__LINE__)
84-
#define Q_REQUIRE_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
95+
8596
#define Q_REQUIRE(expr_) Q_ASSERT(expr_)
97+
#define Q_REQUIRE_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
8698
#define Q_REQUIRE_INCRIT(id_, expr_) Q_ASSERT_INCRIT((id_), (expr_))
87-
#define Q_ENSURE_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
99+
#define Q_REQUIRE_LOCAL(id_, expr_) Q_ASSERT_LOCAL((id_), (expr_))
100+
88101
#define Q_ENSURE(expr_) Q_ASSERT(expr_)
102+
#define Q_ENSURE_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
89103
#define Q_ENSURE_INCRIT(id_, expr_) Q_ASSERT_INCRIT((id_), (expr_))
90-
#define Q_INVARIANT_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
104+
#define Q_ENSURE_LOCAL(id_, expr_) Q_ASSERT_LOCAL((id_), (expr_))
105+
91106
#define Q_INVARIANT(expr_) Q_ASSERT(expr_)
107+
#define Q_INVARIANT_ID(id_, expr_) Q_ASSERT_ID((id_), (expr_))
92108
#define Q_INVARIANT_INCRIT(id_, expr_) Q_ASSERT_INCRIT((id_), (expr_))
109+
#define Q_INVARIANT_LOCAL(id_, expr_) Q_ASSERT_LOCAL((id_), (expr_))
110+
111+
#define Q_ERROR_LOCAL(id_) Q_ERROR_ID(id_)
93112

94113
#ifndef Q_ASSERT_STATIC
95114
#define Q_ASSERT_STATIC(expr_) extern char Q_static_assert_[(expr_) ? 1 : -1]

ports/arm-cm/config/qp_config.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
//
1919
// NOTE:
2020
// The GPL (see <www.gnu.org/licenses/gpl-3.0>) does NOT permit the
21-
// incorporation of the QP/C software into proprietary programs. Please
21+
// incorporation of the QP/C++ software into proprietary programs. Please
2222
// contact Quantum Leaps for commercial licensing options, which expressly
2323
// supersede the GPL and are designed explicitly for licensees interested
24-
// in using QP/C in closed-source proprietary applications.
24+
// in using QP/C++ in closed-source proprietary applications.
2525
//
2626
// Quantum Leaps contact information:
2727
// <www.state-machine.com/licensing>

ports/arm-cm/qk/armclang/qk_port.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
//
1919
// NOTE:
2020
// The GPL (see <www.gnu.org/licenses/gpl-3.0>) does NOT permit the
21-
// incorporation of the QP/C software into proprietary programs. Please
21+
// incorporation of the QP/C++ software into proprietary programs. Please
2222
// contact Quantum Leaps for commercial licensing options, which expressly
2323
// supersede the GPL and are designed explicitly for licensees interested
24-
// in using QP/C in closed-source proprietary applications.
24+
// in using QP/C++ in closed-source proprietary applications.
2525
//
2626
// Quantum Leaps contact information:
2727
// <www.state-machine.com/licensing>
@@ -65,7 +65,6 @@ void NMI_Handler(void);
6565
// For best performance, these functions are implemented in assembly,
6666
// but they can be implemented in C as well.
6767

68-
//std::int32_t volatile QF_int_lock_nest_; // not used
6968
extern char const QF_port_module_[];
7069
char const QF_port_module_[] = "qk_port";
7170

ports/arm-cm/qk/armclang/qp_port.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//
44
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
55
//
6-
// Q u a n t u m L e a P s
7-
// ------------------------
8-
// Modern Embedded Software
6+
// Q u a n t u m L e a P s
7+
// ------------------------
8+
// Modern Embedded Software
99
//
1010
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
1111
//
@@ -18,10 +18,10 @@
1818
//
1919
// NOTE:
2020
// The GPL (see <www.gnu.org/licenses/gpl-3.0>) does NOT permit the
21-
// incorporation of the QP/C software into proprietary programs. Please
21+
// incorporation of the QP/C++ software into proprietary programs. Please
2222
// contact Quantum Leaps for commercial licensing options, which expressly
2323
// supersede the GPL and are designed explicitly for licensees interested
24-
// in using QP/C in closed-source proprietary applications.
24+
// in using QP/C++ in closed-source proprietary applications.
2525
//
2626
// Quantum Leaps contact information:
2727
// <www.state-machine.com/licensing>
@@ -52,7 +52,7 @@
5252
#define QF_CRIT_STAT
5353
#define QF_CRIT_ENTRY() (QF_crit_entry_())
5454
#define QF_CRIT_EXIT() (QF_crit_exit_())
55-
55+
#define QF_CRIT_EST() (QF_crit_entry_())
5656
#define QF_CRIT_EXIT_NOP() __asm volatile ("isb" ::: "memory")
5757

5858
// Efficient log2() ----------------------------------------------------------
@@ -160,12 +160,12 @@ extern "C" void QK_thread_ret(void);
160160

161161
// prototypes
162162
extern "C" {
163-
void QF_int_disable_(void);
164-
void QF_int_enable_(void);
165-
void QF_crit_entry_(void);
166-
void QF_crit_exit_(void);
167163

168-
extern std::int32_t volatile QF_int_lock_nest_;
164+
void QF_int_disable_(void);
165+
void QF_int_enable_(void);
166+
void QF_crit_entry_(void);
167+
void QF_crit_exit_(void);
168+
169169
} // extern "C"
170170

171171
//============================================================================

ports/arm-cm/qk/armclang/qs_port.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
//
1919
// NOTE:
2020
// The GPL (see <www.gnu.org/licenses/gpl-3.0>) does NOT permit the
21-
// incorporation of the QP/C software into proprietary programs. Please
21+
// incorporation of the QP/C++ software into proprietary programs. Please
2222
// contact Quantum Leaps for commercial licensing options, which expressly
2323
// supersede the GPL and are designed explicitly for licensees interested
24-
// in using QP/C in closed-source proprietary applications.
24+
// in using QP/C++ in closed-source proprietary applications.
2525
//
2626
// Quantum Leaps contact information:
2727
// <www.state-machine.com/licensing>

ports/arm-cm/qk/gnu/qk_port.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
//
1919
// NOTE:
2020
// The GPL (see <www.gnu.org/licenses/gpl-3.0>) does NOT permit the
21-
// incorporation of the QP/C software into proprietary programs. Please
21+
// incorporation of the QP/C++ software into proprietary programs. Please
2222
// contact Quantum Leaps for commercial licensing options, which expressly
2323
// supersede the GPL and are designed explicitly for licensees interested
24-
// in using QP/C in closed-source proprietary applications.
24+
// in using QP/C++ in closed-source proprietary applications.
2525
//
2626
// Quantum Leaps contact information:
2727
// <www.state-machine.com/licensing>
@@ -65,7 +65,6 @@ void NMI_Handler(void);
6565
// For best performance, these functions are implemented in assembly,
6666
// but they can be implemented in C as well.
6767

68-
//std::int32_t volatile QF_int_lock_nest_; // not used
6968
extern char const QF_port_module_[];
7069
char const QF_port_module_[] = "qk_port";
7170

ports/arm-cm/qk/gnu/qp_port.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//
44
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
55
//
6-
// Q u a n t u m L e a P s
7-
// ------------------------
8-
// Modern Embedded Software
6+
// Q u a n t u m L e a P s
7+
// ------------------------
8+
// Modern Embedded Software
99
//
1010
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
1111
//
@@ -18,10 +18,10 @@
1818
//
1919
// NOTE:
2020
// The GPL (see <www.gnu.org/licenses/gpl-3.0>) does NOT permit the
21-
// incorporation of the QP/C software into proprietary programs. Please
21+
// incorporation of the QP/C++ software into proprietary programs. Please
2222
// contact Quantum Leaps for commercial licensing options, which expressly
2323
// supersede the GPL and are designed explicitly for licensees interested
24-
// in using QP/C in closed-source proprietary applications.
24+
// in using QP/C++ in closed-source proprietary applications.
2525
//
2626
// Quantum Leaps contact information:
2727
// <www.state-machine.com/licensing>
@@ -52,7 +52,7 @@
5252
#define QF_CRIT_STAT
5353
#define QF_CRIT_ENTRY() (QF_crit_entry_())
5454
#define QF_CRIT_EXIT() (QF_crit_exit_())
55-
55+
#define QF_CRIT_EST() (QF_crit_entry_())
5656
#define QF_CRIT_EXIT_NOP() __asm volatile ("isb" ::: "memory")
5757

5858
// Efficient log2() ----------------------------------------------------------
@@ -160,12 +160,12 @@ extern "C" void QK_thread_ret(void);
160160

161161
// prototypes
162162
extern "C" {
163-
void QF_int_disable_(void);
164-
void QF_int_enable_(void);
165-
void QF_crit_entry_(void);
166-
void QF_crit_exit_(void);
167163

168-
extern std::int32_t volatile QF_int_lock_nest_;
164+
void QF_int_disable_(void);
165+
void QF_int_enable_(void);
166+
void QF_crit_entry_(void);
167+
void QF_crit_exit_(void);
168+
169169
} // extern "C"
170170

171171
//============================================================================

0 commit comments

Comments
 (0)