Skip to content

Commit 67465bf

Browse files
committed
8.1.0
1 parent 0726fd7 commit 67465bf

Some content is hidden

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

77 files changed

+2486
-1598
lines changed

.gitignore

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
*.qms
2+
*.cov
3+
*.gcov
4+
*.log
25
*.obj
36
*.o
47
*.d
@@ -29,17 +32,37 @@
2932
*.chw
3033
*.sfr
3134
*.ewt
35+
*.csv
3236
*.user
3337
*.avrsuo
3438
*.Debug
3539
*.Release
3640
*.bak
3741
version-*
3842
JLink*.*
43+
*.host
44+
*.trg
45+
46+
dbg/
47+
rel/
48+
spy/
49+
build*/
50+
settings/
51+
.settings/
52+
targetConfigs/
53+
Debug/
54+
Release/
55+
Spy/
56+
QSpy/
57+
58+
lib/
59+
obj/
60+
output/
3961

4062
include/qs.h
4163
include/qs_pkg.h
4264
include/qxk.h
65+
4366
src/qs/qs.c
4467
src/qs/qs_64bit.c
4568
src/qs/qs_fp.c
@@ -49,29 +72,14 @@ src/qxk/qxk.c
4972
src/qxk/qxk_mutex.c
5073
src/qxk/qxk_sema.c
5174
src/qxk/qxk_xthr.c
52-
zephyr/qutest_port.c
5375

5476
ports/arm-cm/qxk/
5577
ports/arm-cm/qutest/
5678
ports/posix-qutest/
5779
ports/win32-qutest/
80+
zephyr/qutest_port.c
5881

59-
priv/
60-
html/
61-
latex/
62-
dbg/
63-
rel/
64-
spy/
65-
build*/
66-
settings/
67-
.settings/
68-
targetConfigs/
69-
70-
Debug/
71-
Release/
72-
Spy/
73-
QSpy/
82+
static-analysis/pclp/
7483

75-
lib/
76-
obj/
77-
output/
84+
tests/TIN*/
85+
tests/TUN*/

3rd_party

Submodule 3rd_party updated 98 files

README.md

Lines changed: 63 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ it is recommended that you clone this repo like that:
1313
git clone https://github.com/QuantumLeaps/qpc --recurse-submodules --depth 1
1414
```
1515

16-
Alternatively, you can also download one of the stable
17-
[QP/C Releases][QP-Rel].
16+
However, the easiest and most recommended way of
17+
[getting started with QP/C](#getting-started-with-qpc) is to download
18+
the QP-bundle, as [described below](#getting-started-with-qpc).
19+
1820

1921
# About QP/C Real-Time Event Framework
2022
QP/C real-time event framework (RTEF) is a lightweight implementation of
@@ -25,25 +27,25 @@ of Active Objects (Actors) and a runtime environment for executing the Active
2527
Objects in a deterministic, real-time fashion. Additionally, QP/C Framework
2628
supports Hierarchical State Machines with which to specify the behavior of
2729
Active Objects [UML 2.5], [Sutter:10], [ROOM:94]. The QP/C Framework can be
28-
viewed as a modern, asynchronous, and truly event driven real-time operating
30+
viewed as a modern, asynchronous, and truly event-driven real-time operating
2931
system (RTOS).
3032

3133
## QP Framework Family
32-
QP/C framework is part of the larger QP family consisting of the following
34+
QP/C framework is part of the larger QP family, consisting of the following
3335
QP editions:
3436

3537
|QP Edition | Language | API | Safety Functions |Certification Artifacts| Licensing
3638
|:----------|:-----------:|:-----------------|:-------------------|:----------------|:---------
3739
| QP/C | C (C11) |same as SafeQP/C |Selected Assertions |Req/Arch/Design | [dual][Lic]
3840
| QP/C++ | C++ (C++17) |same as SafeQP/C++|Selected Assertions |Req/Arch/Design | [dual][Lic]
39-
| SafeQP/C | C (C11) |same as QP/C |All Safety Functions|Extensive<br>Certification Kit| [commercial][Com]
40-
| SafeQP/C++| C++ (C++17) |same as QP/C++ |All Safety Functions|Extensive<br>Certification Kit| [commercial][Com]
41+
| SafeQP/C | C (C11) |same as QP/C |All Safety Functions|Complete<br>Certification Kit| [commercial][Com]
42+
| SafeQP/C++| C++ (C++17) |same as QP/C++ |All Safety Functions|Complete<br>Certification Kit| [commercial][Com]
4143

4244
The **SafeQP/C** and **SafeQP/C++** frameworks were originally derived from QP/C and QP/C++,
4345
respectively, but were extensively reengineered for the safety market using compliant
4446
Software Safety Lifecycle (SSL). In this process, the QP framework functional model has been
4547
subjected to a full Hazard and Risk Analysis, which identified all areas of weakness within
46-
the functional model and API. These findings led to creation of Safety Requirements and risk
48+
the functional model and API. These findings led to the creation of Safety Requirements and risk
4749
mitigation by Safety Functions, which were subsequently implemented, verified, and validated.
4850
The SafeQP frameworks are accompanied by the "SafeQP Certification Kits", which provide
4951
developers with ready-to-use artifacts, enabling them to save time, mitigate risk, and reduce
@@ -53,28 +55,65 @@ for more information about the SafeQP frameworks and the "Certification Kits".
5355

5456
> **NOTE:** The SafeQP/C edition remain fully API- and functionally compatible with the
5557
corresponding standard QP/C framework. This ensures existing QP/C Applications can transition
56-
seamlessly to SafeQP/C without requiring any modifications. SafeQP/C edition retain QP/C
57-
Frameworks' hallmark features, including a small memory footprint, excellent efficiency,
58-
and hard real-time functionality.
58+
seamlessly to SafeQP/C without requiring any modifications. SafeQP/C edition retains QP/C
59+
Frameworks' hallmark features: a small memory footprint, excellent efficiency, and hard
60+
real-time performance.
5961

6062

6163
# Getting Started with QP/C
62-
The most recommended way of obtaining QP/C is by downloading the
63-
[QP-bundle](https://www.state-machine.com/#Downloads), which includes QP/C
64-
as well as the [QM modeling tool][QM] and the [QTools collection][QTools].
65-
The main advantage of obtaining QP/C bundled together like that is
66-
that you get all components, tools and examples ready to go.
67-
68-
### Getting Started Resources
69-
- ["QP/C Tutorial"][Tut]
70-
describes a series of progressively advanced QP/C example applications.
71-
64+
The most recommended way to get started with QP/C is by
65+
[__downloading the QP-bundle__](https://www.state-machine.com/#Downloads),
66+
which includes QP/C as well as the [QM modeling tool][QM] and the
67+
[QTools collection][QTools]. The main advantage of obtaining QP/C bundled
68+
together is that you get all components, tools, and _examples_ all ready to go.
69+
70+
> **NOTE:**
71+
Perhaps the most important fact to remember is that in embedded systems,
72+
nothing works until everything works. This means that you should always start
73+
with a _working system_ and gradually evolve it, changing one thing at a time
74+
and making sure that it keeps working every step of the way.
75+
76+
The provided [__QP/C example projects__](examples), such as the super-simple
77+
[Blinky](examples/arm-cm/blinky_nucleo-u545re/), or a bit more advanced
78+
[Dining Philosophers Problem (DPP)](examples/arm-cm/dpp_nucleo-u545re/),
79+
allow you to get started with a __working project__ rather than starting from
80+
scratch. You should also always try one of the unmodified examples on one
81+
of the very inexpensive evaluation boards (such as
82+
[STM32 NUCLEO-U545RE](examples/arm-cm/dpp_nucleo-u545re/stm32-nucleo-u545re.webp))
83+
that it was designed for, _before_ attempting to immediately adapt the projects
84+
to your specific hardware. Only once an example project is built and runs on
85+
the evaluation board, can you use it as a starting point for your specific hardware
86+
and software development.
87+
88+
89+
## Getting Started Resources
7290
- [Video: "Getting Started with QP Real-Time Event Frameworks"][Video]
7391
provides instructions on how to download, install, and get started with QP.
7492

7593
- [AppNote: "Getting Started with QP Real-Time Event Frameworks"][AN]
7694
contains also a tutorial, in which you build a simple "Blinky" application.
7795

96+
- ["QP/C Tutorial"][Tut]
97+
describes a series of progressively advanced QP/C example applications.
98+
99+
## QP/C Extras
100+
The open source GPL distribution of QP/C can be augmented by the
101+
["QP/C Extras"][QPX/C], which provide more advanced QP/C features, such as:
102+
- [QS software tracing][QS] component (QP Spy)
103+
- [QXK real-time kernel][QXK] component
104+
- Static-analysis configuration and automation scripts for PC-Lint-Plus
105+
- Test suite (based on the [QUTest trace-based test harness][QUTest])
106+
that demonstrates 100% lines of code and 100% MC/DC code coverage for QP/C.
107+
108+
> **NOTE:** The ["QP/C Extras"][QPX/C] are [licensed commercially][Lic] only
109+
and available to the commercial licensees with the active Support Term. Please contact
110+
[Quantum Leaps technical support][Sup] to get the matching ["QP/C Extras"][QPX/C]
111+
for the public QP/C version.
112+
113+
> **NOTE:** The ["QP/C Extras"][QPX/C] are also __available for evaluation__
114+
([upon request][ReqForm]).
115+
116+
78117
# Licensing
79118
The QP/C real-time event framework is licensed under the
80119
[dual licensing model](https://www.state-machine.com/licensing), with
@@ -101,21 +140,6 @@ any open source license and you do not violate your policy.
101140
are licensed commercially only.
102141

103142

104-
## Files Removed from the QP/C Open Source GPL Distribution
105-
Due to the widespread non-compliance with the GPL, as well as infringement on the
106-
[dual-licensing model of QP frameworks][Lic], the following QP/C components
107-
have been **removed from the open-source GPL distribution**:
108-
- QS target-resident software tracing component
109-
- QXK dual-mode kernel
110-
111-
> NOTE: These components are available to the [commercial licensees][Cust] with
112-
the active Support Term. Please contact [Quantum Leaps technical support][Sup]
113-
to get the complete QP/C framework distribution.
114-
115-
> **NOTE:** To request **evaluation** of the complete QP/C framework, please contact
116-
Quantum Leaps at: https://www.state-machine.com/contact
117-
118-
119143
# Documentation
120144
The online HTML documentation for the **latest** version of QP/C is located
121145
at: https://www.state-machine.com/qpc
@@ -146,11 +170,15 @@ If you like this project, please give it a star (in the upper-right corner of yo
146170
[QP]: <https://www.state-machine.com/products/qp>
147171
[QP/C]: <https://github.com/QuantumLeaps/qpc>
148172
[QP/C++]: <https://github.com/QuantumLeaps/qpcpp>
173+
[QPX/C]: https://www.state-machine.com/qpc/gs_extras.html>
174+
[QPX/C++]: https://www.state-machine.com/qpcpp/gs_extras.html>
149175
[Cert]: <https://www.state-machine.com/products/qp#CERT>
150176
[QM]: <https://github.com/QuantumLeaps/qm>
151177
[QTools]: <https://github.com/QuantumLeaps/qtools>
178+
[QUTest]: <https://www.state-machine.com/qtools/qutest.html>
152179
[Lic]: <https://www.state-machine.com/licensing>
153180
[Com]: <https://www.state-machine.com/licensing#Commercial>
181+
[ReqForm]: <https://www.state-machine.com/licensing#RequestForm>
154182
[Cust]: <https://www.state-machine.com/customers>
155183
[Sup]: <mailto:[email protected]>
156184
[AN]: <https://www.state-machine.com/doc/AN_Getting_Started_with_QP.pdf>

examples

Submodule examples updated 277 files

include/README.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

include/qequeue.h

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ struct QEvt; // forward declaration
4646
//============================================================================
4747
//! @class QEQueue
4848
typedef struct QEQueue {
49-
struct QEvt const * volatile frontEvt; //!< @private @memberof QEQueue
50-
struct QEvt const * * ring; //!< @private @memberof QEQueue
51-
QEQueueCtr end; //!< @private @memberof QEQueue
52-
QEQueueCtr volatile head; //!< @private @memberof QEQueue
53-
QEQueueCtr volatile tail; //!< @private @memberof QEQueue
54-
QEQueueCtr volatile nFree; //!< @private @memberof QEQueue
55-
QEQueueCtr nMin; //!< @private @memberof QEQueue
49+
struct QEvt const *frontEvt; //!< @private @memberof QEQueue
50+
struct QEvt const * *ring; //!< @private @memberof QEQueue
51+
QEQueueCtr end; //!< @private @memberof QEQueue
52+
QEQueueCtr head; //!< @private @memberof QEQueue
53+
QEQueueCtr tail; //!< @private @memberof QEQueue
54+
QEQueueCtr nFree; //!< @private @memberof QEQueue
55+
QEQueueCtr nMin; //!< @private @memberof QEQueue
5656
} QEQueue;
5757

5858
//! @public @memberof QEQueue
@@ -76,18 +76,15 @@ struct QEvt const * QEQueue_get(QEQueue * const me,
7676
uint_fast8_t const qsId);
7777

7878
//! @public @memberof QEQueue
79-
static inline QEQueueCtr QEQueue_getNFree(QEQueue const * const me) {
80-
return me->nFree;
81-
}
79+
uint16_t QEQueue_getFree(QEQueue const * const me);
8280

8381
//! @public @memberof QEQueue
84-
static inline QEQueueCtr QEQueue_getNMin(QEQueue const * const me) {
85-
return me->nMin;
86-
}
82+
uint16_t QEQueue_getUse(QEQueue const * const me);
8783

8884
//! @public @memberof QEQueue
89-
static inline bool QEQueue_isEmpty(QEQueue const * const me) {
90-
return me->frontEvt == (struct QEvt *)0;
91-
}
85+
uint16_t QEQueue_getMin(QEQueue const * const me);
86+
87+
//! @public @memberof QEQueue
88+
bool QEQueue_isEmpty(QEQueue const * const me);
9289

9390
#endif // QEQUEUE_H_

include/qk.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ typedef uint_fast8_t QSchedStatus;
4242
//============================================================================
4343
//! @class QK_Attr
4444
typedef struct {
45-
QPSet readySet; //!< @memberof QK_Attr
46-
uint8_t actPrio; //!< @memberof QK_Attr
47-
uint8_t nextPrio; //!< @memberof QK_Attr
48-
uint8_t actThre; //!< @memberof QK_Attr
49-
uint8_t lockCeil; //!< @memberof QK_Attr
50-
uint8_t intNest; //!< @memberof QK_Attr
45+
QPSet readySet; //!< @private @memberof QK_Attr
46+
uint8_t actPrio; //!< @private @memberof QK_Attr
47+
uint8_t nextPrio; //!< @private @memberof QK_Attr
48+
uint8_t actThre; //!< @private @memberof QK_Attr
49+
uint8_t lockCeil; //!< @private @memberof QK_Attr
50+
uint8_t intNest; //!< @private @memberof QK_Attr
5151
} QK_Attr;
5252

5353
//! @static @private @memberof QK
@@ -65,7 +65,7 @@ uint_fast8_t QK_sched_act_(
6565
void QK_activate_(void);
6666

6767
//! @static @public @memberof QK
68-
QSchedStatus QK_schedLock(uint_fast8_t const ceiling);
68+
QSchedStatus QK_schedLock(uint8_t const ceiling);
6969

7070
//! @static @public @memberof QK
7171
void QK_schedUnlock(QSchedStatus const prevCeil);
@@ -104,15 +104,17 @@ void QK_onIdle(void);
104104
} \
105105
} while (false)
106106

107-
// QF event pool customization for QK...
108-
#define QF_EPOOL_TYPE_ QMPool
107+
// QMPool operations
108+
#define QF_EPOOL_TYPE_ QMPool
109109
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
110110
(QMPool_init(&(p_), (poolSto_), (poolSize_), (evtSize_)))
111-
#define QF_EPOOL_EVENT_SIZE_(p_) ((uint_fast16_t)(p_).blockSize)
111+
#define QF_EPOOL_EVENT_SIZE_(p_) ((uint16_t)(p_).blockSize)
112112
#define QF_EPOOL_GET_(p_, e_, m_, qsId_) \
113113
((e_) = (QEvt *)QMPool_get(&(p_), (m_), (qsId_)))
114-
#define QF_EPOOL_PUT_(p_, e_, qsId_) \
115-
(QMPool_put(&(p_), (e_), (qsId_)))
114+
#define QF_EPOOL_PUT_(p_, e_, qsId_) (QMPool_put(&(p_), (e_), (qsId_)))
115+
#define QF_EPOOL_USE_(ePool_) (QMPool_getUse(ePool_))
116+
#define QF_EPOOL_FREE_(ePool_) ((ePool_)->nFree)
117+
#define QF_EPOOL_MIN_(ePool_) ((ePool_)->nMin)
116118

117119
#endif // QP_IMPL
118120

0 commit comments

Comments
 (0)