Skip to content

Commit d5c6c20

Browse files
author
QL
committed
6.5.1
1 parent c461a22 commit d5c6c20

34 files changed

+1176
-624
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ lint*.txt
3636
JLink*.*
3737
version-*
3838

39+
qm/
3940
eclipse/
4041
test/
4142
test_ports/

GPLv3.txt

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This README provides a quick overview of QP for Arduino.
1+
This README provides a quick overview of QP for Arduino.
22
Please refer to the companion webiste to this project at:
33

44
https://www.state-machine.com/arduino
@@ -17,15 +17,19 @@ you need to open the Arduino IDE and select `File|Preferences` menu.
1717
The Sketchbook location will be shown at the top of the Preferences
1818
dialog box. Once you identify the `<Sketchbook>` folder, you simply unzip
1919
the whole `qp-<ver>_arduino-1.8.x.zip` archive to this folder.
20-
21-
----
22-
# Provided Libraries
2320

24-
The archive `qp-<ver>_arduino-1.8.x.zip` contains two external libraries
25-
for Arduino:
26-
27-
- `qpcpp_sam` -- QP/C++ framework for SAM-based Arduinos
28-
- `qpn_avr` -- QP-nano framework for AVR-based Arduinos
21+
----
22+
# Provided Libraries and Tools
23+
24+
The archive `qp-<ver>_arduino-1.8.x.zip` contains two external libraries
25+
for Arduino:
26+
27+
- `qpcpp_sam` -- QP/C++ framework for SAM-based Arduinos
28+
- `qpn_avr` -- QP-nano framework for AVR-based Arduinos
29+
30+
The archive also contains the QM modeling tool for Windows
31+
32+
- `qm` -- QM modeling tool for Windows 32/64-bit
2933

3034
After the installation, your Arduino `<Sketchbook>` folder should look
3135
as follows:
@@ -58,12 +62,24 @@ as follows:
5862
| | | +-qpn.h - QP-nano library header file
5963
| | | +-... - QP-nano library sources
6064
| | +-library.properties - QP-nano library properties
65+
| |
66+
| +-qm/ - QM modeling tool for Windows
67+
| | +-bin/ - QM binaries (executable and DLLs)
68+
| | | +-qm.exe - QM executable for Windows
69+
| | +-Resources/ - QM resources
70+
| | | +-...
6171
|
6272
+-README.md - this file
6373
+-QP-Arduino-Playground - web link to QP on Arduino Playground
6474
+-QP-Arduino_GPL_Exception.txt - GPL exception for QP on Arduino
6575

66-
76+
77+
NOTE: The QP-Arduino archive contains QM for Windows only. But QM is also
78+
available for Linux and MacOS hosts. If you wish to work on those operating
79+
systems, you will need to install QM separately, as described at:
80+
https://www.state-machine.com/qm/gs.html
81+
82+
6783
----
6884
# Working with the Examples
6985

@@ -77,25 +93,25 @@ The intended way of working with the examples is to use the
7793
[QM modeling tool](https://www.state-machine.com/qm/) to modify the
7894
**models** (`.qm` files) and then to **generate code** from these
7995
models. In this scenario, the Arduino IDE is used only to build and
80-
upload the code to the Arduino board(s).
96+
upload the code to the Arduino board(s).
8197

8298
> **NOTE:** The preferences in the Arduino IDE should be set up to
8399
**Use external editor** so that the IDE will update the code each time
84100
it is re-generated by the QM modeling tool.
85-
101+
86102

87103
----
88-
# Example Documentation
89-
90-
Each example model has documentation, which you can view in the QM tool.
91-
The model documentation shows in the Property Editor when the model item
104+
# Example Documentation
105+
106+
Each example model has documentation, which you can view in the QM tool.
107+
The model documentation shows in the Property Editor when the model item
92108
is active.
93-
109+
94110

95111
----
96112
# Licensing
97113

98-
The QP real-time embedded frameworks for Arduino are licensed under the
114+
The QP real-time embedded frameworks for Arduino are licensed under the
99115
modified GPLv3 license with the
100116
[QP-Arduino Exception](https://www.state-machine.com/licensing/QP-Arduino_GPL_Exception.txt)
101117
(see also the file QP-Arduino_GPL_Exception.txt in the root of the archive).

libraries/qpcpp_sam/examples/blinky/blinky.ino

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
//$file${.::blinky.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
1+
//.$file${.::blinky.ino} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
33
// Model: blinky.qm
44
// File: ${.::blinky.ino}
55
//
6-
// This code has been generated by QM 4.5.1 (https://www.state-machine.com/qm).
6+
// This code has been generated by QM 4.6.0 <www.state-machine.com/qm/>.
77
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
88
//
99
// This program is open source software: you can redistribute it and/or
@@ -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.ino} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
#include "qpcpp.h" // QP-C++ framework
2020
#include "Arduino.h" // Arduino API
2121

@@ -32,9 +32,9 @@ enum {
3232

3333
//============================================================================
3434
// genearate declarations of all opaque AO pointers
35-
//$declare${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
35+
//.$declare${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
3636
extern QP::QActive * const AO_Blinky;
37-
//$enddecl${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37+
//.$enddecl${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3838
//...
3939

4040
//............................................................................
@@ -120,8 +120,8 @@ extern "C" void Q_onAssert(char const * const module, int loc) {
120120

121121
//============================================================================
122122
// generate declarations and definitions of all AO classes (state machines)...
123-
//$declare${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
124-
//${AOs::Blinky} .............................................................
123+
//.$declare${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
124+
//.${AOs::Blinky} ............................................................
125125
class Blinky : public QP::QActive {
126126
private:
127127
QP::QTimeEvt m_timeEvt;
@@ -137,40 +137,40 @@ protected:
137137
Q_STATE_DECL(off);
138138
Q_STATE_DECL(on);
139139
};
140-
//$enddecl${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
141-
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
142-
// Check for the minimum required QP version
140+
//.$enddecl${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
141+
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
142+
//. Check for the minimum required QP version
143143
#if (QP_VERSION < 650U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
144144
#error qpcpp version 6.5.0 or higher required
145145
#endif
146-
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147-
//$define${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
148-
//${AOs::Blinky} .............................................................
146+
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
147+
//.$define${AOs::Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
148+
//.${AOs::Blinky} ............................................................
149149
Blinky Blinky::instance;
150-
//${AOs::Blinky::Blinky} .....................................................
150+
//.${AOs::Blinky::Blinky} ....................................................
151151
Blinky::Blinky()
152152
: QActive(Q_STATE_CAST(&Blinky::initial)),
153153
m_timeEvt(this, TIMEOUT_SIG, 0U)
154154
{}
155155

156-
//${AOs::Blinky::SM} .........................................................
156+
//.${AOs::Blinky::SM} ........................................................
157157
Q_STATE_DEF(Blinky, initial) {
158-
//${AOs::Blinky::SM::initial}
158+
//.${AOs::Blinky::SM::initial}
159159
m_timeEvt.armX(TICKS_PER_SEC/2, TICKS_PER_SEC/2);
160160
(void)e; // unused parameter
161161
return tran(&off);
162162
}
163-
//${AOs::Blinky::SM::off} ....................................................
163+
//.${AOs::Blinky::SM::off} ...................................................
164164
Q_STATE_DEF(Blinky, off) {
165165
QP::QState status_;
166166
switch (e->sig) {
167-
//${AOs::Blinky::SM::off}
167+
//.${AOs::Blinky::SM::off}
168168
case Q_ENTRY_SIG: {
169169
digitalWrite(LED_BUILTIN, LOW); // turn the LED off
170170
status_ = Q_RET_HANDLED;
171171
break;
172172
}
173-
//${AOs::Blinky::SM::off::TIMEOUT}
173+
//.${AOs::Blinky::SM::off::TIMEOUT}
174174
case TIMEOUT_SIG: {
175175
status_ = tran(&on);
176176
break;
@@ -182,17 +182,17 @@ Q_STATE_DEF(Blinky, off) {
182182
}
183183
return status_;
184184
}
185-
//${AOs::Blinky::SM::on} .....................................................
185+
//.${AOs::Blinky::SM::on} ....................................................
186186
Q_STATE_DEF(Blinky, on) {
187187
QP::QState status_;
188188
switch (e->sig) {
189-
//${AOs::Blinky::SM::on}
189+
//.${AOs::Blinky::SM::on}
190190
case Q_ENTRY_SIG: {
191191
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on
192192
status_ = Q_RET_HANDLED;
193193
break;
194194
}
195-
//${AOs::Blinky::SM::on::TIMEOUT}
195+
//.${AOs::Blinky::SM::on::TIMEOUT}
196196
case TIMEOUT_SIG: {
197197
status_ = tran(&off);
198198
break;
@@ -204,13 +204,13 @@ Q_STATE_DEF(Blinky, on) {
204204
}
205205
return status_;
206206
}
207-
//$enddef${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
207+
//.$enddef${AOs::Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
208208
//...
209209

210210
//============================================================================
211211
// generate definitions of all AO opaque pointers...
212-
//$define${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
213-
//${AOs::AO_Blinky} ..........................................................
212+
//.$define${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
213+
//.${AOs::AO_Blinky} .........................................................
214214
QP::QActive * const AO_Blinky = &Blinky::instance;
215-
//$enddef${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
215+
//.$enddef${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
216216
//...

libraries/qpcpp_sam/examples/blinky/blinky.qm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<model version="4.5.1" links="0">
2+
<model version="4.6.0" links="0">
33
<documentation>This is the simple Blinky example for the Arduino DUE board. The example demonstrates:
44

55
1. One active object class &quot;Blinky&quot; (inside the package &quot;AOs&quot;)

libraries/qpcpp_sam/examples/blinky_bsp/blinky.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
//$file${.::blinky.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
1+
//.$file${.::blinky.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
22
//
33
// Model: blinky_bsp.qm
44
// File: ${.::blinky.h}
55
//
6-
// This code has been generated by QM 4.5.1 (https://www.state-machine.com/qm).
6+
// This code has been generated by QM 4.6.0 <www.state-machine.com/qm/>.
77
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
88
//
99
// This program is open source software: you can redistribute it and/or
@@ -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.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18+
//.$endhead${.::blinky.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1919
#ifndef BLINKY_H
2020
#define BLINKY_H
2121

@@ -25,9 +25,9 @@ enum BlinkySignals {
2525
};
2626

2727
// genearate declarations of all opaque AO pointers
28-
//$declare${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
28+
//.$declare${AOs::AO_Blinky} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2929
extern QP::QActive * const AO_Blinky;
30-
//$enddecl${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30+
//.$enddecl${AOs::AO_Blinky} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3131
//...
3232

3333
#endif // BLINKY_H

0 commit comments

Comments
 (0)