Skip to content

Commit 8da11ad

Browse files
committed
6.9.3
Renamed the qpcpp_sam library to qpcpp_arm-cm and made it for all ARM Cortex-M architectures. Added "blinky" example for Teensy4. Renamed other qpcpp examples to add the arch suffix (-sam and -teensy4)
1 parent 757554d commit 8da11ad

Some content is hidden

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

55 files changed

+565
-49
lines changed

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,20 @@ as follows:
4747
<Sketchbook>/ - your Arduino Sketchbook folder
4848
|
4949
+-libraries/ - libraries folder
50-
| +-qpcpp_sam/ - QP/C++ library for SAM-based Arduinos
51-
| | +-examples/ - QP/C++ library examples
52-
| | | +-blinky/ - Blinky example
53-
| | | | +-blinky.ino - Blinky code (generated)
54-
| | | | +-blinky.qm - Blinky model (for QM tool)
55-
| | | +-blinky2/ - Blinky2 example for blinking two LEDs
56-
| | | | +-blinky2.ino - Blinky2 code (generated)
57-
| | | | +-blinky2.qm - Blinky2 model (for QM tool)
58-
| | | +-blinky_bsp/ - Blinky example with Board Support Package
59-
| | | | +-blinky_bsp.ino - Blinky code (generated)
60-
| | | | +-blinky_bsp.qm - Blinky model (for QM tool)
61-
| | | +-dpp_bsp/ - Dining Philosopher example with BSP
62-
| | | | +-dpp_bsp.ino - DPP code (generated)
63-
| | | | +-dpp_bsp.qm - DPP model (for QM tool)
50+
| +-qpcpp_arm-cm/ - QP/C++ library for ARM Cortex-M based boards
51+
| | +-examples/ - QP/C++ library examples
52+
| | | +-blinky-sam/ - Blinky example for SAM-based Arduinos
53+
| | | | +-blinky-sam.ino - Blinky code (generated)
54+
| | | | +-blinky-sam.qm - Blinky model (for QM tool)
55+
| | | +-blinky_bsp-sam/ - Blinky example with Board Support Package for SAM
56+
| | | | +-blinky_bsp-sam.ino - Blinky code (generated)
57+
| | | | +-blinky_bsp-sam.qm - Blinky model (for QM tool)
58+
| | | +-blinky_bsp-teensy4/ - Blinky example with Board Support Package for Teensy4
59+
| | | | +-blinky_bsp-teensy4.ino - Blinky code (generated)
60+
| | | | +-blinky_bsp-teensy4.qm - Blinky model (for QM tool)
61+
| | | +-dpp_bsp-sam/ - Dining Philosopher example with BSP for SAM
62+
| | | | +-dpp_bsp-sam.ino - DPP code (generated)
63+
| | | | +-dpp_bsp-sam.qm - DPP model (for QM tool)
6464
| | +-src/ - QP/C++ library source code
6565
| | | +-qpcpp.h - QP/C++ library header file
6666
| | | +-... - QP/C++ library sources
@@ -70,19 +70,20 @@ as follows:
7070
| +-qpn_avr/ - QP-nano library for AVR-based Arduinos
7171
| | +-... (now obsolete, for backgwards compatibility only)
7272
| |
73-
| +-qm/ - QM modeling tool (for Windows, Linux, or macOS)
73+
| +-qm/ - QM modeling tool for Windows
7474
| | +-bin/ - QM binaries (executable and DLLs)
75-
| | | +-qm.exe - QM executable (for Windows)
75+
| | | +-qm.exe - QM executable for Windows
7676
| | +-Resources/ - QM resources
7777
| | | +-...
7878
|
7979
+-README.md - this file
8080
+-QP-Arduino_GPL_Exception.txt - GPL exception for QP on Arduino
8181

8282

83-
NOTE: The QP-Arduino archive contains QM for the platform of your choice
84-
(Windows, Linux or macOS), but this requires downloading the corresponding
85-
version of the QP-Arduino integration.
83+
NOTE: The QP-Arduino archive contains QM for Windows only. But QM is also
84+
available for Linux and MacOS hosts. If you wish to work on those operating
85+
systems, you will need to install QM separately, as described at:
86+
https://www.state-machine.com/qm/gs.html
8687

8788

8889
----

libraries/qpcpp_sam/examples/blinky/blinky.ino renamed to libraries/qpcpp_arm-cm/examples/blinky-sam/blinky-sam.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//.$file${.::blinky.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
1+
//.$file${.::blinky-sam.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
3-
// Model: blinky.qm
4-
// File: ${.::blinky.ino}
3+
// Model: blinky-sam.qm
4+
// File: ${.::blinky-sam.ino}
55
//
66
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
77
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
@@ -15,7 +15,7 @@
1515
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1616
// for more details.
1717
//
18-
//.$endhead${.::blinky.ino} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
//.$endhead${.::blinky-sam.ino} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
#include "qpcpp.hpp" // QP-C++ framework
2020

2121
using namespace QP;

libraries/qpcpp_sam/examples/blinky/blinky.qm renamed to libraries/qpcpp_arm-cm/examples/blinky-sam/blinky-sam.qm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ This structure of the code is approprate only for very small applications. More
6666
</attribute>
6767
</package>
6868
<directory name=".">
69-
<file name="blinky.ino">
69+
<file name="blinky-sam.ino">
7070
<text>#include &quot;qpcpp.hpp&quot; // QP-C++ framework
7171

7272
using namespace QP;

libraries/qpcpp_sam/examples/blinky2/blinky2.ino renamed to libraries/qpcpp_arm-cm/examples/blinky2-sam/blinky2-sam.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//.$file${.::blinky2.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
1+
//.$file${.::blinky2-sam.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
3-
// Model: blinky2.qm
4-
// File: ${.::blinky2.ino}
3+
// Model: blinky2-sam.qm
4+
// File: ${.::blinky2-sam.ino}
55
//
66
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
77
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
@@ -15,7 +15,7 @@
1515
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1616
// for more details.
1717
//
18-
//.$endhead${.::blinky2.ino} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
//.$endhead${.::blinky2-sam.ino} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
#include "qpcpp.hpp" // QP-C++ framework
2020

2121
using namespace QP;

libraries/qpcpp_sam/examples/blinky2/blinky2.qm renamed to libraries/qpcpp_arm-cm/examples/blinky2-sam/blinky2-sam.qm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ This structure of the code is approprate only for very small applications. More
112112
</attribute>
113113
</package>
114114
<directory name=".">
115-
<file name="blinky2.ino">
115+
<file name="blinky2-sam.ino">
116116
<text>#include &quot;qpcpp.hpp&quot; // QP-C++ framework
117117

118118
using namespace QP;

libraries/qpcpp_sam/examples/blinky_bsp/blinky.hpp renamed to libraries/qpcpp_arm-cm/examples/blinky_bsp-sam/blinky.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//.$file${.::blinky.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
3-
// Model: blinky_bsp.qm
3+
// Model: blinky_bsp-sam.qm
44
// File: ${.::blinky.hpp}
55
//
66
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.

libraries/qpcpp_sam/examples/blinky_bsp/blinky_bsp.ino renamed to libraries/qpcpp_arm-cm/examples/blinky_bsp-sam/blinky_bsp-sam.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//.$file${.::blinky_bsp.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
1+
//.$file${.::blinky_bsp-sam.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
3-
// Model: blinky_bsp.qm
4-
// File: ${.::blinky_bsp.ino}
3+
// Model: blinky_bsp-sam.qm
4+
// File: ${.::blinky_bsp-sam.ino}
55
//
66
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
77
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
@@ -15,7 +15,7 @@
1515
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1616
// for more details.
1717
//
18-
//.$endhead${.::blinky_bsp.ino} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
//.$endhead${.::blinky_bsp-sam.ino} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
#include "qpcpp.hpp" // QP-C++ framework
2020
#include "blinky.hpp" // Blinky application interface
2121
#include "bsp.hpp" // Board Support Package (BSP)

libraries/qpcpp_sam/examples/blinky_bsp/blinky_bsp.qm renamed to libraries/qpcpp_arm-cm/examples/blinky_bsp-sam/blinky_bsp-sam.qm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ $declare${AOs::AO_Blinky}
198198
#endif // BLINKY_HPP
199199
</text>
200200
</file>
201-
<file name="blinky_bsp.ino">
201+
<file name="blinky_bsp-sam.ino">
202202
<text>#include &quot;qpcpp.hpp&quot; // QP-C++ framework
203203
#include &quot;blinky.hpp&quot; // Blinky application interface
204204
#include &quot;bsp.hpp&quot; // Board Support Package (BSP)

libraries/qpcpp_sam/examples/blinky_bsp/bsp.cpp renamed to libraries/qpcpp_arm-cm/examples/blinky_bsp-sam/bsp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//.$file${.::bsp.cpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
3-
// Model: blinky_bsp.qm
3+
// Model: blinky_bsp-sam.qm
44
// File: ${.::bsp.cpp}
55
//
66
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.

libraries/qpcpp_sam/examples/blinky_bsp/bsp.hpp renamed to libraries/qpcpp_arm-cm/examples/blinky_bsp-sam/bsp.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//.$file${.::bsp.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
3-
// Model: blinky_bsp.qm
3+
// Model: blinky_bsp-sam.qm
44
// File: ${.::bsp.hpp}
55
//
66
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//.$file${.::blinky.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2+
//
3+
// Model: blinky_bsp-teeny4.qm
4+
// File: ${.::blinky.hpp}
5+
//
6+
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
7+
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8+
//
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.
12+
//
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.
17+
//
18+
//.$endhead${.::blinky.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
#ifndef BLINKY_HPP
20+
#define BLINKY_HPP
21+
22+
enum BlinkySignals {
23+
TIMEOUT_SIG = QP::Q_USER_SIG,
24+
MAX_SIG
25+
};
26+
27+
// genearate declarations of all opaque AO pointers
28+
//.$declare${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
29+
extern QP::QActive * const AO_Blinky;
30+
//.$enddecl${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31+
//...
32+
33+
#endif // BLINKY_HPP
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
//.$file${.::blinky_bsp-teensy4.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2+
//
3+
// Model: blinky_bsp-teeny4.qm
4+
// File: ${.::blinky_bsp-teensy4.ino}
5+
//
6+
// This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
7+
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8+
//
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.
12+
//
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.
17+
//
18+
//.$endhead${.::blinky_bsp-teensy4.ino} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19+
#include "qpcpp.hpp" // QP-C++ framework
20+
#include "blinky.hpp" // Blinky application interface
21+
#include "bsp.hpp" // Board Support Package (BSP)
22+
23+
using namespace QP;
24+
25+
//............................................................................
26+
void setup() {
27+
QF::init(); // initialize the framework
28+
BSP::init(); // initialize the BSP
29+
30+
// statically allocate event queues for the AOs and start them...
31+
static QEvt const *blinky_queueSto[10];
32+
AO_Blinky->start(1U, // priority
33+
blinky_queueSto, Q_DIM(blinky_queueSto),
34+
(void *)0, 0U); // no stack
35+
//...
36+
}
37+
38+
//............................................................................
39+
void loop() {
40+
QF::run(); // run the QF/C++ framework
41+
}
42+
43+
//============================================================================
44+
// generate declarations and definitions of all AO classes (state machines)...
45+
//.$declare${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
46+
//.${AOs::Blinky} ............................................................
47+
class Blinky : public QP::QActive {
48+
private:
49+
QP::QTimeEvt m_timeEvt;
50+
51+
public:
52+
static Blinky instance;
53+
54+
public:
55+
Blinky();
56+
57+
protected:
58+
Q_STATE_DECL(initial);
59+
Q_STATE_DECL(off);
60+
Q_STATE_DECL(on);
61+
};
62+
//.$enddecl${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63+
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
64+
//. Check for the minimum required QP version
65+
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
66+
#error qpcpp version 6.9.0 or higher required
67+
#endif
68+
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
69+
//.$define${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
70+
//.${AOs::Blinky} ............................................................
71+
Blinky Blinky::instance;
72+
//.${AOs::Blinky::Blinky} ....................................................
73+
Blinky::Blinky()
74+
: QActive(Q_STATE_CAST(&Blinky::initial)),
75+
m_timeEvt(this, TIMEOUT_SIG, 0U)
76+
{}
77+
78+
//.${AOs::Blinky::SM} ........................................................
79+
Q_STATE_DEF(Blinky, initial) {
80+
//.${AOs::Blinky::SM::initial}
81+
m_timeEvt.armX(BSP::TICKS_PER_SEC/2, BSP::TICKS_PER_SEC/2);
82+
(void)e; // unused parameter
83+
return tran(&off);
84+
}
85+
//.${AOs::Blinky::SM::off} ...................................................
86+
Q_STATE_DEF(Blinky, off) {
87+
QP::QState status_;
88+
switch (e->sig) {
89+
//.${AOs::Blinky::SM::off}
90+
case Q_ENTRY_SIG: {
91+
BSP::ledOff();
92+
status_ = Q_RET_HANDLED;
93+
break;
94+
}
95+
//.${AOs::Blinky::SM::off::TIMEOUT}
96+
case TIMEOUT_SIG: {
97+
status_ = tran(&on);
98+
break;
99+
}
100+
default: {
101+
status_ = super(&top);
102+
break;
103+
}
104+
}
105+
return status_;
106+
}
107+
//.${AOs::Blinky::SM::on} ....................................................
108+
Q_STATE_DEF(Blinky, on) {
109+
QP::QState status_;
110+
switch (e->sig) {
111+
//.${AOs::Blinky::SM::on}
112+
case Q_ENTRY_SIG: {
113+
BSP::ledOn();
114+
status_ = Q_RET_HANDLED;
115+
break;
116+
}
117+
//.${AOs::Blinky::SM::on::TIMEOUT}
118+
case TIMEOUT_SIG: {
119+
status_ = tran(&off);
120+
break;
121+
}
122+
default: {
123+
status_ = super(&top);
124+
break;
125+
}
126+
}
127+
return status_;
128+
}
129+
//.$enddef${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130+
//...
131+
132+
//============================================================================
133+
// generate definitions of all AO opaque pointers...
134+
//.$define${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
135+
//.${AOs::AO_Blinky} .........................................................
136+
QP::QActive * const AO_Blinky = &Blinky::instance;
137+
//.$enddef${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138+
//...

0 commit comments

Comments
 (0)