Skip to content

Commit 3d7b331

Browse files
author
Nguyen Do
committed
Attemp to upgrade QP/C++ to v8.0.2
1 parent a137d3d commit 3d7b331

Some content is hidden

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

49 files changed

+5595
-12979
lines changed

examples/blinky_bsp-esp32/blinky.hpp

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
1-
//.$file${.::blinky.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
1+
//$file${.::blinky.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
33
// Model: blinky_bsp-esp32.qm
44
// File: ${.::blinky.hpp}
55
//
6-
// This code has been generated by QM 5.1.1 <www.state-machine.com/qm/>.
6+
// This code has been generated by QM 7.0.1 <www.state-machine.com/qm>.
77
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
88
//
9-
// This program is open source software: you can redistribute it and/or
10-
// modify it under the terms of the GNU General Public License as published
11-
// by the Free Software Foundation.
9+
// Copyright (c) 2005 Quantum Leaps, LLC. All rights reserved.
1210
//
13-
// This program is distributed in the hope that it will be useful, but
14-
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15-
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16-
// for more details.
11+
// ____________________________________
12+
// / /
13+
// / GGGGGGG PPPPPPPP LL /
14+
// / GG GG PP PP LL /
15+
// / GG PP PP LL /
16+
// / GG GGGGG PPPPPPPP LL /
17+
// / GG GG PP LL /
18+
// / GGGGGGG PP LLLLLLL /
19+
// /___________________________________/
1720
//
18-
//.$endhead${.::blinky.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
// SPDX-License-Identifier: GPL-3.0-or-later
22+
//
23+
// This generated code is open-source software licensed under the GNU
24+
// General Public License (GPL) as published by the Free Software Foundation
25+
// (see <https://www.gnu.org/licenses>).
26+
//
27+
// NOTE:
28+
// The GPL does NOT permit the incorporation of this code into proprietary
29+
// programs. Please contact Quantum Leaps for commercial licensing options,
30+
// which expressly supersede the GPL and are designed explicitly for
31+
// closed-source distribution.
32+
//
33+
// Quantum Leaps contact information:
34+
// <www.state-machine.com/licensing>
35+
36+
//
37+
//$endhead${.::blinky.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1938
#ifndef BLINKY_HPP
2039
#define BLINKY_HPP
2140

@@ -25,9 +44,12 @@ enum BlinkySignals {
2544
};
2645

2746
// genearate declarations of all opaque AO pointers
28-
//.$declare${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
47+
//$declare${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
48+
49+
//${AOs::AO_Blinky} ..........................................................
2950
extern QP::QActive * const AO_Blinky;
30-
//.$enddecl${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
51+
//$enddecl${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3152
//...
3253

3354
#endif // BLINKY_HPP
55+
Lines changed: 77 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,69 @@
1-
//.$file${.::blinky_bsp-esp32.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
1+
//$file${.::main.cpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
33
// Model: blinky_bsp-esp32.qm
4-
// File: ${.::blinky_bsp-esp32.ino}
4+
// File: ${.::main.cpp}
55
//
6-
// This code has been generated by QM 5.1.1 <www.state-machine.com/qm/>.
6+
// This code has been generated by QM 7.0.1 <www.state-machine.com/qm>.
77
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
88
//
9-
// This program is open source software: you can redistribute it and/or
10-
// modify it under the terms of the GNU General Public License as published
11-
// by the Free Software Foundation.
9+
// Copyright (c) 2005 Quantum Leaps, LLC. All rights reserved.
1210
//
13-
// This program is distributed in the hope that it will be useful, but
14-
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15-
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16-
// for more details.
11+
// ____________________________________
12+
// / /
13+
// / GGGGGGG PPPPPPPP LL /
14+
// / GG GG PP PP LL /
15+
// / GG PP PP LL /
16+
// / GG GGGGG PPPPPPPP LL /
17+
// / GG GG PP LL /
18+
// / GGGGGGG PP LLLLLLL /
19+
// /___________________________________/
1720
//
18-
//.$endhead${.::blinky_bsp-esp32.ino} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
// SPDX-License-Identifier: GPL-3.0-or-later
22+
//
23+
// This generated code is open-source software licensed under the GNU
24+
// General Public License (GPL) as published by the Free Software Foundation
25+
// (see <https://www.gnu.org/licenses>).
26+
//
27+
// NOTE:
28+
// The GPL does NOT permit the incorporation of this code into proprietary
29+
// programs. Please contact Quantum Leaps for commercial licensing options,
30+
// which expressly supersede the GPL and are designed explicitly for
31+
// closed-source distribution.
32+
//
33+
// Quantum Leaps contact information:
34+
// <www.state-machine.com/licensing>
35+
36+
//
37+
//$endhead${.::main.cpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1938
#include "qpcpp.hpp" // QP-C++ framework
2039
#include "blinky.hpp" // Blinky application interface
2140
#include "bsp.hpp" // Board Support Package (BSP)
2241

2342
using namespace QP;
24-
static constexpr unsigned stack_size = 1000;
25-
43+
static constexpr unsigned stack_size = 1700;
2644
//............................................................................
2745
void setup() {
2846
QF::init(); // initialize the framework
2947
BSP::init(); // initialize the BSP
3048

49+
// initialize event pools
50+
static QF_MPOOL_EL(QP::QEvt) smlPoolSto[20];
51+
QP::QF::poolInit(smlPoolSto, sizeof(smlPoolSto), sizeof(smlPoolSto[0]));
52+
53+
// initialize publish-subscribe
54+
static QP::QSubscrList subscrSto[10];
55+
QP::QActive::psInit(subscrSto, Q_DIM(subscrSto));
56+
3157
// statically allocate event queues for the AOs and start them...
32-
static QEvt const *blinky_queueSto[30];
58+
static QP::QEvtPtr blinky_queueSto[30];
59+
static StackType_t stack[stack_size];
3360
AO_Blinky->start(1U, // priority
34-
blinky_queueSto, // queu storage for evets
61+
blinky_queueSto, // queue storage for events
3562
Q_DIM(blinky_queueSto), //len of queue
36-
nullptr, // No static stack
37-
stack_size);
38-
QF::run(); // Normally QF Run is located in a loop
63+
stack,
64+
sizeof(stack));
65+
66+
QF::run(); // Normally QF Run is located in a loop
3967
//but since using Arduino SDK not necessary
4068
// Called once to call QF::OnStartup and produce the QS trace
4169
}
@@ -46,8 +74,9 @@ void loop() {
4674

4775
//============================================================================
4876
// generate declarations and definitions of all AO classes (state machines)...
49-
//.$declare${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
50-
//.${AOs::Blinky} ............................................................
77+
//$declare${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
78+
79+
//${AOs::Blinky} .............................................................
5180
class Blinky : public QP::QActive {
5281
private:
5382
QP::QTimeEvt m_timeEvt;
@@ -62,26 +91,28 @@ protected:
6291
Q_STATE_DECL(initial);
6392
Q_STATE_DECL(off);
6493
Q_STATE_DECL(on);
65-
};
66-
//.$enddecl${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67-
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
68-
//. Check for the minimum required QP version
69-
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
70-
#error qpcpp version 6.9.0 or higher required
94+
}; // class Blinky
95+
//$enddecl${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96+
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
97+
// Check for the minimum required QP version
98+
#if (QP_VERSION < 730U) || (QP_VERSION != ((QP_RELEASE^4294967295U)%0x2710U))
99+
#error qpcpp version 7.3.0 or higher required
71100
#endif
72-
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73-
//.$define${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
74-
//.${AOs::Blinky} ............................................................
101+
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
102+
//$define${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
103+
104+
//${AOs::Blinky} .............................................................
75105
Blinky Blinky::instance;
76-
//.${AOs::Blinky::Blinky} ....................................................
106+
107+
//${AOs::Blinky::Blinky} .....................................................
77108
Blinky::Blinky()
78109
: QActive(Q_STATE_CAST(&Blinky::initial)),
79110
m_timeEvt(this, TIMEOUT_SIG, 0U)
80111
{}
81112

82-
//.${AOs::Blinky::SM} ........................................................
113+
//${AOs::Blinky::SM} .........................................................
83114
Q_STATE_DEF(Blinky, initial) {
84-
//.${AOs::Blinky::SM::initial}
115+
//${AOs::Blinky::SM::initial}
85116
(void)e; // unused parameter
86117
m_timeEvt.armX(BSP::TICKS_PER_SEC/2, BSP::TICKS_PER_SEC/2);
87118

@@ -93,17 +124,18 @@ Q_STATE_DEF(Blinky, initial) {
93124

94125
return tran(&off);
95126
}
96-
//.${AOs::Blinky::SM::off} ...................................................
127+
128+
//${AOs::Blinky::SM::off} ....................................................
97129
Q_STATE_DEF(Blinky, off) {
98130
QP::QState status_;
99131
switch (e->sig) {
100-
//.${AOs::Blinky::SM::off}
132+
//${AOs::Blinky::SM::off}
101133
case Q_ENTRY_SIG: {
102134
BSP::ledOff();
103135
status_ = Q_RET_HANDLED;
104136
break;
105137
}
106-
//.${AOs::Blinky::SM::off::TIMEOUT}
138+
//${AOs::Blinky::SM::off::TIMEOUT}
107139
case TIMEOUT_SIG: {
108140
status_ = tran(&on);
109141
break;
@@ -115,17 +147,18 @@ Q_STATE_DEF(Blinky, off) {
115147
}
116148
return status_;
117149
}
118-
//.${AOs::Blinky::SM::on} ....................................................
150+
151+
//${AOs::Blinky::SM::on} .....................................................
119152
Q_STATE_DEF(Blinky, on) {
120153
QP::QState status_;
121154
switch (e->sig) {
122-
//.${AOs::Blinky::SM::on}
155+
//${AOs::Blinky::SM::on}
123156
case Q_ENTRY_SIG: {
124157
BSP::ledOn();
125158
status_ = Q_RET_HANDLED;
126159
break;
127160
}
128-
//.${AOs::Blinky::SM::on::TIMEOUT}
161+
//${AOs::Blinky::SM::on::TIMEOUT}
129162
case TIMEOUT_SIG: {
130163
status_ = tran(&off);
131164
break;
@@ -137,13 +170,15 @@ Q_STATE_DEF(Blinky, on) {
137170
}
138171
return status_;
139172
}
140-
//.$enddef${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
173+
//$enddef${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
141174
//...
142175

143176
//============================================================================
144177
// generate definitions of all AO opaque pointers...
145-
//.$define${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
146-
//.${AOs::AO_Blinky} .........................................................
178+
//$define${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
179+
180+
//${AOs::AO_Blinky} ..........................................................
147181
QP::QActive * const AO_Blinky = &Blinky::instance;
148-
//.$enddef${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
182+
//$enddef${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
149183
//...
184+

0 commit comments

Comments
 (0)