Skip to content

Commit 833a8fd

Browse files
author
QL
committed
6.4.0
1 parent a32cf1e commit 833a8fd

File tree

21 files changed

+1532
-195
lines changed

21 files changed

+1532
-195
lines changed

QP-Arduino_GPL_Exception.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ QP-nano FRAMEWORK EXCEPTION FOR ARDUINO
22

33
Version 1.1, 22 June 2016
44

5-
Copyright (c) Quantum Leaps, LLC. <http://state-machine.com/>
5+
Copyright (c) 2016 Quantum Leaps, LLC. <https://www.state-machine.com/>
66

77
Everyone is permitted to copy and distribute verbatim copies of this
88
license document, but changing it is not allowed.
@@ -20,10 +20,10 @@ programs to use, in this way, the QP-nano Framework code covered
2020
by this Exception.
2121

2222
0. Definitions.
23-
"QP-nano Framework for Arduino" is a lightweight state machine
24-
framework as well as supporting build scripts and examples, as
25-
distributed in the QP-nano framework adaptation for Arduino at
26-
<https://sourceforge.net/projects/qpc/files/QP-nano_Arduino/>.
23+
"QP-nano Framework for Arduino" is a lightweight real-time framework,
24+
as well as all supporting ports and examples, as distributed from:
25+
<https://sourceforge.net/projects/qpc/files> and
26+
<https://github.com/QuantumLeaps>
2727

2828
"Arduino-Certified Board" means any board with an Arduino-supported
2929
CPU that bears an official Arduino logo and/or is officially

README.md renamed to README.txt

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
![QP framework](https://state-machine.com/img/qpn-arduino_banner.jpg)
2-
31
This README provides a quick overview of QP-nano for Arduino.
42
Please refer to the companion webiste to this project at:
53

6-
https://state-machine.com/arduino
4+
https://www.state-machine.com/arduino
75

86

9-
---------------------------------------------------------------------------
10-
## Software Installation on Windows
7+
Software Installation on Windows
8+
================================
119
The QP-nano adaptation for Arduino is distributed in a single ZIP
1210
archive qpn-<ver>_arduino-1.8.x.zip, where <ver> stands for version of
1311
the QP-nano framework.
@@ -21,14 +19,15 @@ box. Once you identify the Sketchbook folder, you simply unzip the whole
2119
archive to your Sketchbook.
2220

2321

24-
## Software Installation on MacOS
22+
Software Installation on MacOS
23+
==============================
2524
The Mac funtionality has been tested, but other users will likely find
2625
issues. Please submit issues at https://sourceforge.net/p/qpc/bugs/ and
2726
submit questions and suggestions at
2827
https://sourceforge.net/p/qpc/discussion/668726/
2928

30-
31-
### Install Dependencies
29+
Install Dependencies
30+
--------------------
3231
1. Install the AVR-GCC tooltrain for Mac OS X. Following are the commands
3332
to install using Homebrew (must have Homebrew installed):
3433

@@ -46,8 +45,8 @@ security warnings.
4645

4746
4. Install QM.
4847

48+
Instructions for Configuring External Tools for a Model
4949

50-
### Instructions for Configuring External Tools for a Model
5150
1. Ensure the model is not open in QM.
5251

5352
2. Copy the Blinky model's settings
@@ -61,20 +60,22 @@ Sketchbook folder to the model's folder.
6160
Once you have a working .model file, copy it to other models and use it as
6261
a starting point.
6362

64-
65-
## Known Issues
63+
Known Issues
64+
------------
6665
1. The serialterm External Tool is working by opening a Terminal window.
6766
An additional Terminal window also appears and can be safely closed. When
6867
the Terminal window displaying the Arduino's output is closed, the port is
6968
busy and can no longer be accessed. Work-around is to unplug and
7069
re-connect the Arduino from the Mac's USB port.
7170

7271

73-
---------------------------------------------------------------------------
74-
# Building the Examples in the QM Modeling Tool
72+
Building the Examples in the QM Modeling Tool
73+
=============================================
7574

76-
> **NOTE:** To start working with the freeware QM modeling tool, you need to
75+
****
76+
NOTE: To start working with the freeware QM modeling tool, you need to
7777
download the tool from https://sourceforge.net/projects/qpc/files/QM.
78+
****
7879

7980
Each QP-nano example for Arduino (in the examples_avr folder) contains
8081
a QM model, which is a file with the extension .qm., such as
@@ -86,8 +87,8 @@ you generate the complete Arduino sketch automatically-
8687
press of a button.
8788

8889

89-
---------------------------------------------------------------------------
90-
# Licensing
90+
Licensing
91+
=========
9192
The QP-nano framework for Arduino is licensed under the modified GPLv3
9293
license (see file GPLv3.txt) with the QP-Arduino Exception (see file
9394
QP-Arduino_GPL_Exception.txt). Specifically, the Exception removes the
@@ -98,22 +99,19 @@ The QM graphical modeling tool is freeware. The QM tool is provided
9899
under the terms of a simple End-User License Agreement (EULA).
99100

100101

101-
---------------------------------------------------------------------------
102-
# Documentation
102+
Documentation
103+
=============
103104
Please refer to the companion webiste to this project at:
104105

105-
https://state-machine.com/arduino
106+
https://www.state-machine.com/arduino
106107

107108
Specifically, the Application Note: "Event-Driven Arduino Programming
108109
with QP and QM" is available from:
109110

110-
https://state-machine.com/doc/AN_Event-Driven_Arduino_QP-nano.pdf
111-
111+
https://www.state-machine.com/doc/AN_Event-Driven_Arduino_QP-nano.pdf
112112

113-
---------------------------------------------------------------------------
114-
# How to get help?
115-
- [Free Support Forum](https://sourceforge.net/p/qpc/discussion/668726)
116-
- [Bug Reports](https://sourceforge.net/p/qpc/bugs/)
117-
- [Feature Requests](https://sourceforge.net/p/qpc/feature-requests/)
118-
- [Quantum Leaps website](https://state-machine.com)
119113

114+
Support Questions
115+
=================
116+
Please submit any questions or comments to the free QP support forum at:
117+
http://sourceforge.net/p/qpc/discussion/668726

libraries/qpn_avr/examples/blinky/.blinky

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<session version="4.1.2">
2+
<session version="4.4.0">
33
<item name="license">GPL</item>
44
<group name="locked"/>
55
<group name="settings">
@@ -9,8 +9,8 @@
99
<item name="backups">0</item>
1010
</group>
1111
<group name="windows">
12-
<item id=".::blinky.ino">-225,0,800,445</item>
13-
<item id="AOs::Blinky::SM">0,0,575,407,*</item>
12+
<item id=".::blinky.ino">0,0,800,445</item>
13+
<item id="AOs::Blinky::SM">0,0,1105,359,*</item>
1414
</group>
1515
<group name="search">
1616
<item name="options">4129280</item>

libraries/qpn_avr/examples/blinky/blinky.ino

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Model: blinky.qm
44
* File: ${.::blinky.ino}
55
*
6-
* This code has been generated by QM tool (https://state-machine.com/qm).
6+
* This code has been generated by QM 4.4.0 (https://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
@@ -107,11 +107,13 @@ void Q_onAssert(char const Q_ROM * const file, int line) {
107107

108108
//============================================================================
109109
// define all AO classes (state machine)...
110-
/*$define${AOs::Blinky} ####################################################*/
110+
/*$skip${QP_VERSION} #######################################################*/
111111
/* Check for the minimum required QP version */
112-
#if ((QP_VERSION < 601) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8)))
113-
#error qpn version 6.0.1 or higher required
112+
#if (QP_VERSION < 640U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
113+
#error qpn version 6.4.0 or higher required
114114
#endif
115+
/*$endskip${QP_VERSION} ####################################################*/
116+
/*$define${AOs::Blinky} ####################################################*/
115117
/*${AOs::Blinky} ...........................................................*/
116118
/*${AOs::Blinky::SM} .......................................................*/
117119
static QState Blinky_initial(Blinky * const me) {

libraries/qpn_avr/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.1.2" links="0">
2+
<model version="4.4.0" links="0">
33
<documentation>This is the Blinky example for the Arduino-UNO board, which blinks the on-board LED (L) once per second. The example demonstrates:
44

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

libraries/qpn_avr/examples/dpp/.dpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<session version="4.1.2">
2+
<session version="4.4.0">
33
<item name="license">GPL</item>
44
<group name="locked"/>
55
<group name="settings">
@@ -9,9 +9,9 @@
99
<item name="backups">0</item>
1010
</group>
1111
<group name="windows">
12-
<item id=".::dpp.ino">-225,0,800,445</item>
13-
<item id="AOs::Philo::SM">0,0,575,407,*</item>
14-
<item id="AOs::Table::SM">-65,0,640,480</item>
12+
<item id=".::dpp.ino">0,0,1105,543</item>
13+
<item id="AOs::Philo::SM">0,0,1105,479,*</item>
14+
<item id="AOs::Table::SM">0,0,640,480</item>
1515
</group>
1616
<group name="search">
1717
<item name="options">4129280</item>

libraries/qpn_avr/examples/dpp/dpp.ino

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Model: dpp.qm
44
* File: ${.::dpp.ino}
55
*
6-
* This code has been generated by QM tool (https://state-machine.com/qm).
6+
* This code has been generated by QM 4.4.0 (https://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
@@ -161,11 +161,11 @@ ISR(TIMER2_COMPA_vect) {
161161
switch (Serial.read()) { // read the incoming byte
162162
case 'p':
163163
case 'P':
164-
QACTIVE_POST_ISR(&AO_Table.super, PAUSE_SIG, 0U);
164+
QACTIVE_POST_ISR(&AO_Table, PAUSE_SIG, 0U);
165165
break;
166166
case 's':
167167
case 'S':
168-
QACTIVE_POST_ISR(&AO_Table.super, SERVE_SIG, 0U);
168+
QACTIVE_POST_ISR(&AO_Table, SERVE_SIG, 0U);
169169
break;
170170
}
171171
}
@@ -195,17 +195,24 @@ void QV_onIdle(void) { // called with interrupts DISABLED
195195
//............................................................................
196196
void Q_onAssert(char const Q_ROM * const file, int line) {
197197
// implement the error-handling policy for your application!!!
198+
Serial.print(F("ASSERTION:"));
199+
Serial.print(file);
200+
Serial.print(line, DEC);
201+
for (uint32_t volatile i = 100000; i > 0; --i) {
202+
}
198203
QF_INT_DISABLE(); // disable all interrupts
199204
QF_RESET(); // reset the CPU
200205
}
201206

202207
//============================================================================
203208
// define all AO classes...
204-
/*$define${AOs::Philo} #####################################################*/
209+
/*$skip${QP_VERSION} #######################################################*/
205210
/* Check for the minimum required QP version */
206-
#if ((QP_VERSION < 601) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8)))
207-
#error qpn version 6.0.1 or higher required
211+
#if (QP_VERSION < 640U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
212+
#error qpn version 6.4.0 or higher required
208213
#endif
214+
/*$endskip${QP_VERSION} ####################################################*/
215+
/*$define${AOs::Philo} #####################################################*/
209216
/*${AOs::Philo} ............................................................*/
210217
/*${AOs::Philo::SM} ........................................................*/
211218
static QState Philo_initial(Philo * const me) {

libraries/qpn_avr/examples/dpp/dpp.qm

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<model version="4.1.2" links="0">
2+
<model version="4.4.0" links="0">
33
<documentation>This is the Dining Philosopher Problem (DPP) example for the Arduino-UNO board. The example demonstrates:
44

55
1. Multiple active objects (5 Philosophers and 1 Table AO)
@@ -363,11 +363,11 @@ ISR(TIMER2_COMPA_vect) {
363363
switch (Serial.read()) { // read the incoming byte
364364
case 'p':
365365
case 'P':
366-
QACTIVE_POST_ISR(&amp;AO_Table.super, PAUSE_SIG, 0U);
366+
QACTIVE_POST_ISR(&amp;AO_Table, PAUSE_SIG, 0U);
367367
break;
368368
case 's':
369369
case 'S':
370-
QACTIVE_POST_ISR(&amp;AO_Table.super, SERVE_SIG, 0U);
370+
QACTIVE_POST_ISR(&amp;AO_Table, SERVE_SIG, 0U);
371371
break;
372372
}
373373
}
@@ -397,6 +397,11 @@ void QV_onIdle(void) { // called with interrupts DISABLED
397397
//............................................................................
398398
void Q_onAssert(char const Q_ROM * const file, int line) {
399399
// implement the error-handling policy for your application!!!
400+
Serial.print(F(&quot;ASSERTION:&quot;));
401+
Serial.print(file);
402+
Serial.print(line, DEC);
403+
for (uint32_t volatile i = 100000; i &gt; 0; --i) {
404+
}
400405
QF_INT_DISABLE(); // disable all interrupts
401406
QF_RESET(); // reset the CPU
402407
}

libraries/qpn_avr/examples/dpp_comp/.dpp_comp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<session version="4.1.2">
2+
<session version="4.4.0">
33
<item name="license">GPL</item>
44
<group name="locked"/>
55
<group name="settings">
@@ -9,9 +9,9 @@
99
<item name="backups">0</item>
1010
</group>
1111
<group name="windows">
12-
<item id=".::dpp_comp.ino">-338,0,913,613</item>
12+
<item id=".::dpp_comp.ino">0,0,1105,479,*</item>
1313
<item id="AOs::Philo::SM">0,0,892,660</item>
14-
<item id="AOs::Table::SM">0,0,575,407,*</item>
14+
<item id="AOs::Table::SM">0,0,1105,543</item>
1515
</group>
1616
<group name="search">
1717
<item name="options">2032128</item>

libraries/qpn_avr/examples/dpp_comp/dpp_comp.ino

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Model: dpp_comp.qm
44
* File: ${.::dpp_comp.ino}
55
*
6-
* This code has been generated by QM tool (https://state-machine.com/qm).
6+
* This code has been generated by QM 4.4.0 (https://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
@@ -206,22 +206,24 @@ void QV_onIdle(void) { // called with interrupts DISABLED
206206
//............................................................................
207207
void Q_onAssert(char const Q_ROM * const module, int line) {
208208
// implement the error-handling policy for your application!!!
209-
//Serial.print(F("Assert: "));
209+
Serial.print(F("ASSERT:"));
210210
Serial.print(reinterpret_cast<const __FlashStringHelper *>(module));
211211
Serial.println(line, DEC);
212-
delay(200);
213-
212+
delay(500);
213+
for (;;) {}
214214
QF_INT_DISABLE(); // disable all interrupts
215215
QF_RESET(); // reset the CPU
216216
}
217217

218218
//============================================================================
219219
// define the components...
220-
/*$define${AOs::Philo} #####################################################*/
220+
/*$skip${QP_VERSION} #######################################################*/
221221
/* Check for the minimum required QP version */
222-
#if ((QP_VERSION < 601) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8)))
223-
#error qpn version 6.0.1 or higher required
222+
#if (QP_VERSION < 640U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
223+
#error qpn version 6.4.0 or higher required
224224
#endif
225+
/*$endskip${QP_VERSION} ####################################################*/
226+
/*$define${AOs::Philo} #####################################################*/
225227
/*${AOs::Philo} ............................................................*/
226228
/*${AOs::Philo::ctor} ......................................................*/
227229
static void Philo_ctor(Philo * const me, uint8_t num) {

0 commit comments

Comments
 (0)