This commit is contained in:
MMS 2022-08-11 15:56:46 -04:00
parent ca7be0f820
commit 4a92b20105
1022 changed files with 379138 additions and 345906 deletions

3
.gitignore vendored
View File

@ -32,12 +32,11 @@
*.Debug
*.Release
*.bak
*.qlc
JLink*.*
version-*
3rd_party/
html/
cert-pack/
test_priv/
dbg/
rel/

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "3rd_party"]
path = 3rd_party
url = https://github.com/QuantumLeaps/3rd_party.git

1
3rd_party Submodule

@ -0,0 +1 @@
Subproject commit 8a2ebb9e76a63a2f46b8ad906657154ab21a15e8

View File

@ -0,0 +1,26 @@
Any user of the QP/C real-time embedded framework
qpc
2023-12-31
Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
This software is dual-licensed under the terms of the open source GNU
General Public License version 3 (or any later version), or alternatively,
under the terms of one of the closed source Quantum Leaps commercial
licenses.
The terms of the open source GNU General Public License version 3
can be found at: <www.gnu.org/licenses/gpl-3.0>
The terms of the closed source Quantum Leaps commercial licenses
can be found at: <www.state-machine.com/licensing>
Redistributions in source code must retain this top-level comment block.
Plagiarizing this software to sidestep the license obligations is illegal.
Contact information:
<www.state-machine.com/licensing>
<info@state-machine.com>
#F04C7A28E6F84BAFDD11A028A9B7CFE2F4DE1FD7

25
LICENSES/QM-EVAL-QPC.qlc Normal file
View File

@ -0,0 +1,25 @@
Users of QP/C Real-Time Embedded Framework (RTEF)
qpc
2023-12-31
SPDX-License-Identifier: GPL-3.0-or-later
This generated code is free software: you can redistribute it under
the terms of the GNU General Public License as published by the Free
Software Foundation.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
NOTE:
Alternatively, this generated code may be distributed under the terms
of Quantum Leaps commercial licenses, which expressly supersede the GNU
General Public License and are specifically designed for licensees
interested in retaining the proprietary status of their code.
Contact information:
<www.state-machine.com/licensing>
<info@state-machine.com>
#B825C9988DCDDACEDB8D6020A03FCE45174EA0AA

View File

@ -0,0 +1,46 @@
QP/C++ and QP-nano FRAMEWORK EXCEPTION FOR ARDUINO
Version 3.0, December 22, 2021
Copyright (c) 2005-2021 Quantum Leaps, LLC. <https://www.state-machine.com/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
This QP/C++ and QP-nano Framework Exception for Arduino ("Exception")
is an additional permission under section 7 of the GNU General Public
License, version 3 ("GPLv3"). It applies to the QP/C++ and QP-nano
source code (the "QP Frameworks") that is distributed as part of the
QP-Arduino Support Package.
When you use QP Frameworks inside your program, the QP Frameworks' code
is combined with your code of the program. The purpose of this Exception
is to allow non-GPL (including proprietary) programs to use, in this way,
the QP Frameworks' code covered by this Exception.
0. Definitions.
"QP Frameworks" are lightweight real-time embedded frameworks (RTEFs)
as well as all supporting ports and examples, as distributed from:
<https://www.state-machine.com> and
<https://github.com/QuantumLeaps>
"Arduino-Certified Board" means any board with an Arduino-supported
CPU that bears an official Arduino logo and/or is officially certified
under the Arduino Certified Program
(see <https://www.arduino.cc/en/hardware>).
"Target Code" refers to output from any compiler and linker in
executable form suitable for execution by an embedded microcontroller.
1. Grant of Additional Permission
As a special Exception, the copyright holder of QP Frameworks gives you
permission to propagate a work of Target Code formed by combining
the QP Frameworks with your own source code without the requirement
to expose your proprietary source code, provided that all Target Code
will execute on Arduino-Certified Board(s).
2. No Weakening of GPL
The availability of this Exception does not imply any general
presumption that third-party software linking to the QP Framework is
unaffected by the copyleft requirements of the GPLv3 license.

View File

@ -0,0 +1,48 @@
QP/C and QP/C++ FRAMEWORKS EXCEPTION FOR RASPBERRY PI
Version 2.0, 2 August 2022
Copyright (c) 2005-2021 Quantum Leaps, LLC. <https://www.state-machine.com/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
This QP/C++ and QP-nano Framework Exception for Arduino ("Exception")
is an additional permission under section 7 of the GNU General Public
License, version 3 ("GPLv3"). It applies to the QP/C++ and QP-nano
source code (the "QP Frameworks") that is distributed as part of the
QP-Arduino Support Package.
When you use QP Frameworks inside your program, the QP Frameworks' code
is combined with your code of the program. The purpose of this Exception
is to allow non-GPL (including proprietary) programs to use, in this way,
the QP Frameworks' code covered by this Exception.
0. Definitions.
"QP Frameworks" are lightweight real-time embedded frameworks (RTEFs)
as well as all supporting ports and examples, as distributed from:
<https://www.state-machine.com> and
<https://github.com/QuantumLeaps>
"Raspberry Pi" is a low cost, credit-card sized computer that is
designed by the Raspberry Pi Foundation based in the UK and registered
as UK educational charity under the number 1129409. For the purpose of
this license, Raspberry Pi means only genuine Raspberry Pi computer
bearing the Raspberry Pi logo, as described at
<https://www.raspberrypi.com/trademark-rules>.
"Target Code" refers to output from any compiler and linker in
executable form suitable for execution by Raspberry Pi.
1. Grant of Additional Permission
As a special Exception, the copyright holder of QP Frameworks gives you
permission to propagate a work of Target Code formed by combining the QP
Frameworks with your own source code without the requirement to expose
your propriatory source code, provided that all Target Code will execute
on a genuine Raspberry Pi computer(s).
2. No Weakening of GPL
The availability of this Exception does not imply any general
presumption that third-party software linking to the QP Framework is
unaffected by the copyleft requirements of the GPLv3 license.

View File

@ -0,0 +1,42 @@
QP/C and QP/C++ FRAMEWORKS EXCEPTION FOR ARM mbed
Version 2.0, August 2022
Copyright (c) 2005-2014 Quantum Leaps, LLC. <https://www.state-machine.com/>
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
This QP/C++ and QP-nano Framework Exception for Arduino ("Exception")
is an additional permission under section 7 of the GNU General Public
License, version 3 ("GPLv3"). It applies to the QP/C++ and QP-nano
source code (the "QP Frameworks") that is distributed as part of the
QP-Arduino Support Package.
When you use QP Frameworks inside your program, the QP Frameworks' code
is combined with your code of the program. The purpose of this Exception
is to allow non-GPL (including proprietary) programs to use, in this way,
the QP Frameworks' code covered by this Exception.
0. Definitions.
"QP Frameworks" are lightweight real-time embedded frameworks (RTEFs)
as well as all supporting ports and examples, as distributed from:
<https://www.state-machine.com> and
<https://github.com/QuantumLeaps>
"mbed-Enabled Board" means any board with an ARM Cortex-M CPU that is
listed on the official "mbed platforms" website
<https://os.mbed.com/platforms>.
1. Grant of Additional Permission
As a special Exception, the copyright holder of QP Frameworks gives you
permission to propagate a work of Target Code formed by combining
the QP Frameworks with your own source code without the requirement
to expose your proprietary source code, provided that all Target Code will
execute on an "mbed-Enabled Board".
2. No Weakening of GPL
The availability of this Exception does not imply any general
presumption that third-party software linking to the QP Framework is
unaffected by the copyleft requirements of the GPLv3 license.

View File

@ -19,6 +19,9 @@ obtaining QP/C bundled together like that is that you get all components,
tools and examples ready to go.
### Getting Started Resources
- ["QP/C Tutorial"][Tutorial]
describes a series of progressively advanced QP/C example applications.
- [Video: "Getting Started with QP Real-Time Embedded Frameworks"][Video]
provides instructions on how to download, install, and get started with QP.
@ -26,15 +29,6 @@ provides instructions on how to download, install, and get started with QP.
contains also a tutorial, in which you build a simple "Blinky" application.
# Documentation
The online HTML documention for the **latest** version of QP/C is located
at: https://www.state-machine.com/qpc
The offline HTML documentation for **this** particular version of QP/C
is located in the sub-folder [html](html). To view the offline documentation,
open the file [html/index.html](html/index.html) in your web browser.
# About QP/C
QP/C (Quantum Platform in C) is a lightweight, open source
[Real-Time Embedded Framework (RTEF)][RTEF] for building modern embedded
@ -94,7 +88,7 @@ products ranging from implantable medical devices to complex weapon systems.
# QP/C Licensing
QP/C is licensed under the increasingly popular [dual licensing model][Lic],
QP/C is licensed under the sustainable [dual licensing model][Lic],
in which both the open source software distribution mechanism and
traditional closed source software distribution models are combined.
@ -104,7 +98,12 @@ you don't use any open source license and you do not violate your policy.
# QP/C Documentation
The **QP/C Manual** is located online at: https://www.state-machine.com/qpc
The online HTML documention for the **latest** version of QP/C is located
at: https://www.state-machine.com/qpc
The offline HTML documentation for **this** particular version of QP/C
is located in the sub-folder [html](html). To view the offline documentation,
open the file [html/index.html](html/index.html) in your web browser.
# How to Get Help?
@ -115,6 +114,13 @@ The **QP/C Manual** is located online at: https://www.state-machine.com/qpc
- [Quantum Leaps licensing](https://www.state-machine.com/licensing)
- [info@state-machine.com](mailto:info@state-machine.com)
# How to Help this Project?
If you like this project, please give it a star (in the upper-right corner of your browser window):
![GitHub star](doxygen/images/github-star.jpg)
[RTEF]: <https://www.state-machine.com/rtef>
[QP]: <https://www.state-machine.com/products/qp>
[QP/C]: <https://www.state-machine.com/qpc>
@ -125,4 +131,5 @@ The **QP/C Manual** is located online at: https://www.state-machine.com/qpc
[Lic]: <https://www.state-machine.com/licensing>
[Cust]: <https://www.state-machine.com/customers>
[AN]: <https://www.state-machine.com/doc/AN_Getting_Started_with_QP.pdf>
[Tutorial]: <https://www.state-machine.com/qpc/gs_tut.html>
[Video]: <https://youtu.be/O7ER6_VqIH0>

View File

@ -1,17 +1,18 @@
# Doxyfile 1.9.3
# Doxyfile 1.9.4
@INCLUDE = ../../ql-doxygen/Doxyfile-QL
@INCLUDE = ../../ql-doxygen/ql-doxyfile
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = QP/C
PROJECT_NUMBER = 7.0.0
PROJECT_NAME = "QP/C"
PROJECT_NUMBER = 7.0.1
PROJECT_BRIEF = "Real-Time Embedded Framework"
PROJECT_LOGO = images/logo_ql.png
PROJECT_LOGO = ../../ql-doxygen/images/logo_ql.png
OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO
CREATE_SUBDIRS_LEVEL = 6
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
@ -41,7 +42,7 @@ PYTHON_DOCSTRING = YES
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 4
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
@ -116,17 +117,13 @@ WARN_IF_INCOMPLETE_DOC = YES
WARN_NO_PARAMDOC = NO
WARN_AS_ERROR = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LINE_FORMAT = "at line $line of file $file"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = main.dox \
gs.dox \
../../cert-pack/srs.dox \
../../cert-pack/sas.dox \
../../cert-pack/sds.dox \
../../cert-pack/misra.dox \
api.dox \
exa.dox \
exa_native.dox \
exa_rtos.dox \
@ -138,25 +135,19 @@ INPUT = main.dox \
ports_arm-cm.dox \
ports_rtos.dox \
ports_os.dox \
metrics.dox \
api.dox \
history.dox \
modules.dox \
../../ql-doxygen/help.dox \
../../cert-pack/srs.dox \
../../cert-pack/sas.dox \
../../cert-pack/sds.dox \
../../cert-pack/misra.dox \
../../cert-pack/tr.dox \
metrics.dox \
dir.dox \
macros.h \
../include/qpc.h \
../include/qep.h \
../include/qf.h \
../include/qequeue.h \
../include/qmpool.h \
../include/qpset.h \
../include/qv.h \
../include/qk.h \
../include/qxk.h \
../include/qxthread.h \
../include/qs.h \
config.h \
../include \
../src \
../../ql-doxygen/help.dox
../src
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.dox \
@ -169,7 +160,8 @@ FILE_PATTERNS = *.dox \
*.lnt
RECURSIVE = YES
EXCLUDE = ../include/qs_dummy.h
EXCLUDE = ../include/qs_dummy.h \
../include/quit.h
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
@ -218,18 +210,24 @@ IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = ../html
HTML_FILE_EXTENSION = .html
HTML_HEADER = ../../ql-doxygen/header-awesome.html
HTML_FOOTER = ../../ql-doxygen/footer-awesome.html
HTML_HEADER = ../../ql-doxygen/ql-header-awesome.html
HTML_FOOTER = ../../ql-doxygen/ql-footer-awesome.html
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET = ../../ql-doxygen/doxygen-awesome.css \
../../ql-doxygen/doxygen-awesome-sidebar-only.css \
../../ql-doxygen/doxygen-awesome-sidebar-only-darkmode-toggle.css \
../../ql-doxygen/ql-awesome.css
HTML_EXTRA_FILES = ../../ql-doxygen/doxygen-awesome-darkmode-toggle.js \
../../ql-doxygen/preview.js
../../ql-doxygen/doxygen-awesome-fragment-copy-button.js \
../../ql-doxygen/doxygen-awesome-paragraph-link.js \
../../ql-doxygen/ql-preview.js
HTML_COLORSTYLE_HUE = 209
HTML_COLORSTYLE_SAT = 255
HTML_COLORSTYLE_GAMMA = 113
HTML_TIMESTAMP = NO
HTML_DYNAMIC_MENUS = NO
HTML_DYNAMIC_MENUS = YES
HTML_DYNAMIC_SECTIONS = NO
HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = NO
@ -255,11 +253,11 @@ QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = com.state-machine.qp
DISABLE_INDEX = YES
DISABLE_INDEX = NO
GENERATE_TREEVIEW = YES
FULL_SIDEBAR = NO
ENUM_VALUES_PER_LINE = 4
TREEVIEW_WIDTH = 300
TREEVIEW_WIDTH = 335
EXT_LINKS_IN_WINDOW = NO
OBFUSCATE_EMAILS = NO
HTML_FORMULA_FORMAT = png
@ -293,15 +291,15 @@ PREDEFINED = Q_SPY \
Q_UTEST \
QK_ON_CONTEXT_SW \
QXK_ON_CONTEXT_SW \
QF_MAX_ACTIVE \
QF_MAX_TICK_RATE \
QF_MAX_EPOOL \
QF_EVENT_SIZ_SIZE \
QF_EQUEUE_CTR_SIZE \
QF_MPOOL_SIZ_SIZE \
QF_MPOOL_CTR_SIZE \
QF_TIMEEVT_CTR_SIZE \
QF_ACTIVE_STOP \
QS_TIME_SIZE
QF_MAX_ACTIVE=32 \
QF_MAX_TICK_RATE=2 \
QF_MAX_EPOOL=3 \
QF_EVENT_SIZ_SIZE=2 \
QF_EQUEUE_CTR_SIZE=2 \
QF_MPOOL_SIZ_SIZE=2 \
QF_MPOOL_CTR_SIZE=2 \
QF_TIMEEVT_CTR_SIZE=4 \
QF_ACTIVE_STOP=0 \
QS_TIME_SIZE=4
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES

View File

@ -7,4 +7,5 @@
#---------------------------------------------------------------------------
ENABLED_SECTIONS += CERT
HTML_OUTPUT = ../cert-pack

View File

@ -1,4 +1,4 @@
# Doxyfile 1.9.3
# Doxyfile 1.9.4
@INCLUDE = Doxyfile
@ -8,8 +8,8 @@
PROJECT_LOGO = images/logo_ql-comp.png
HTML_OUTPUT = tmp
HTML_HEADER = ../../ql-doxygen/header.html
HTML_FOOTER = ../../ql-doxygen/footer.html
HTML_HEADER = ../../ql-doxygen/ql-header.html
HTML_FOOTER = ../../ql-doxygen/ql-footer.html
HTML_EXTRA_STYLESHEET = ../../ql-doxygen/ql.css
HTML_EXTRA_FILES = ../../ql-doxygen/preview.js
HTML_EXTRA_FILES = ../../ql-doxygen/ql-preview.js
GENERATE_HTMLHELP = YES

240
doxygen/DoxygenLayout.xml Normal file
View File

@ -0,0 +1,240 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.9.4 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="Certification Pack" intro="List of modules comprising the QP/C Certification Pack:"/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="concepts" visible="yes" title="">
</tab>
<tab type="interfaces" visible="yes" title="">
<tab type="interfacelist" visible="yes" title="" intro=""/>
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="interfacehierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="structs" visible="yes" title="">
<tab type="structlist" visible="yes" title="" intro=""/>
<tab type="structindex" visible="$ALPHABETICAL_INDEX" title=""/>
</tab>
<tab type="exceptions" visible="yes" title="">
<tab type="exceptionlist" visible="yes" title="" intro=""/>
<tab type="exceptionindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="exceptionhierarchy" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<concepts visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a concept page -->
<concept>
<briefdescription visible="yes"/>
<includes visible="$SHOW_HEADERFILE"/>
<definition visible="yes" title=""/>
<detaileddescription title=""/>
<authorsection visible="yes"/>
</concept>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<concepts visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<sequences title=""/>
<dictionaries title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@ -1,6 +1,5 @@
/*! @page api API Reference
@tableofcontents
@nav_next{deprecated}
@section api_qep QEP (Hierarchical State Machines)
QEP is a universal, UML-compliant event processor that enables developers to code UML state machines in highly readable ANSI-C, in which every state machine element is mapped to code precisely, unambiguously, and exactly once (traceability). QEP fully supports hierarchical state nesting, which is the fundamental mechanism for reusing behavior across many states instead of repeating the same actions and transitions over and over again.
@ -18,7 +17,7 @@ QEP is a universal, UML-compliant event processor that enables developers to cod
- QMsm_ctor()
- QMsm_isInState()
- QMsm_stateObj()
- Q_STATE_CAST()
@section api_qf QF (Active Object Framework)
@ -49,7 +48,7 @@ QF is a portable, event-driven, real-time framework for execution of active obje
- QActive_unsubscribeAll()
@subsection api_qf_evt Dynamic Events
@subsection api_qf_evt Event Management
- ::QEvt class
- QF_poolInit()
- Q_NEW()
@ -57,6 +56,7 @@ QF is a portable, event-driven, real-time framework for execution of active obje
- Q_NEW_REF()
- Q_DELETE_REF()
- QF_gc()
- Q_EVT_CAST()
@subsection api_qf_time Time Events
@ -89,8 +89,7 @@ QF is a portable, event-driven, real-time framework for execution of active obje
- QMPool_put()
@section api_qs QS ("Quantum Spy" Software Tracing)
@section api_qs QS (Software Tracing)
QS is a software tracing system that enables developers to monitor live event-driven QP applications with minimal target system resources and without stopping or significantly slowing down the code. QS is an ideal tool for testing, troubleshooting, and optimizing QP applications. QS can even be used to support acceptance testing in product manufacturing.
@ -121,6 +120,7 @@ QS is a software tracing system that enables developers to monitor live event-dr
@subsection api_qs_dict QS Dictionaries
- QS_SIG_DICTIONARY()
- QS_OBJ_DICTIONARY()
- QS_OBJ_ARR_DICTIONARY()
- QS_FUN_DICTIONARY()
- QS_USR_DICTIONARY()
@ -156,8 +156,8 @@ Given the simplicity, portability, and low-resource consumption, the QV schedule
- QV_CPU_SLEEP()
@section api_qk QK (Preemptive Run-to-Completion Kernel)
QK is a tiny **preemptive**, priority-based, non-blocking kernel designed specifically for executing active objects. QK runs active objects in the same way as prioritized interrupt controller (such as NVIC in ARM Cortex-M) runs interrupts using the single stack. Active objects process their events in run-to-completion (RTC) fashion and remove themselves from the call stack, the same way as nested interrupts remove themselves from the stack upon completion. At the same time high-priority active objects can preempt lower-priority active objects, just like interrupts can preempt each other under a prioritized interrupt controller. QK meets all the requirement of the Rate Monotonic Scheduling (a.k.a. Rate Monotonic Analysis RMA) and can be used in hard real-time systems.
@section api_qk QK (Preemptive RTC Kernel)
QK is a tiny **preemptive**, run-to-completion (RTC) kernel designed specifically for executing active objects. QK runs active objects in the same way as prioritized interrupt controller (such as NVIC in ARM Cortex-M) runs interrupts using the single stack. Active objects process their events in run-to-completion (RTC) fashion and remove themselves from the call stack, the same way as nested interrupts remove themselves from the stack upon completion. At the same time high-priority active objects can preempt lower-priority active objects, just like interrupts can preempt each other under a prioritized interrupt controller. QK meets all the requirement of the Rate Monotonic Scheduling (a.k.a. Rate Monotonic Analysis RMA) and can be used in hard real-time systems.
@subsection api_qk_ctrl Kernel Initialization and Control
@ -173,9 +173,8 @@ QK is a tiny **preemptive**, priority-based, non-blocking kernel designed specif
- QK_ISR_EXIT()
@section api_qxk QXK (Preemptive Dual-Mode RTOS Kernel)
QXK is a small, preemptive, priority-based, dual-mode **blocking** kernel that executes active objects like the @ref qk "QK kernel", but can also execute traditional __blocking__ threads (extended threads). In this respect, QXK behaves exactly as a conventional __RTOS__ (Real-Time Operating System). QXK has been designed specifically for mixing event-driven active objects with traditional blocking code, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software.
@section api_qxk QXK (Dual-Mode Kernel)
QXK is a small, preemptive, priority-based, dual-mode (run-to-completion/**blocking**) kernel that executes active objects like the @ref srs_qk "QK kernel", but can also execute traditional __blocking__ threads (extended threads). In this respect, QXK behaves exactly as a conventional __RTOS__ (Real-Time Operating System). QXK has been designed specifically for mixing event-driven active objects with traditional blocking code, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software.
@subsection api_qxk_ctrl Kernel Initialization and Control
@ -200,7 +199,8 @@ QXK is a small, preemptive, priority-based, dual-mode **blocking** kernel that e
- QXThread_delay()
- QXThread_delayCancel()
- QXThread_queueGet()
- QXK_current()
- QXK_TLS()
@subsection api_qxk_sema Semaphores
- ::QXSemaphore class (Semaphore Control Block)
@ -224,23 +224,18 @@ QXK is a small, preemptive, priority-based, dual-mode **blocking** kernel that e
- QXThread_queueGet() - waiting (blocking) on message queue
@subsection api_qxk_mem Memory Pools
- ::QMPool class
- QMPool_init()
- QMPool_get()
- QMPool_put()
@subsection api_qxk_tls Thread-Local Storage
- QXK_current()
- QXK_TLS()
@next{deprecated}
<br>
@nav_next{deprecated}
*/
/*##########################################################################*/
##############################################################################
/*! @page deprecated Deprecated APIs
__The following QP/C APIs are now deprecated:__
**The following QP/C APIs are now deprecated:**
*/

411
doxygen/config.h Normal file
View File

@ -0,0 +1,411 @@
/**
* @file
* @brief Various macros for configuring and porting QP/C
*/
/*! The maximum number of active objects in the application.
*
* @description
* This macro *must* be defined in the QF port and should be in range
* of 1U..64U, inclusive. The value of this macro determines the maximum
* priority level of an active object in the system. Not all priority
* levels must be used, but the maximum priority cannot exceed
* #QF_MAX_ACTIVE.
*
* @note Once you choose a certain value of #QF_MAX_ACTIVE, you must
* consistently use the same value in building all the QP component libraries
* and your own application code. The consistency is guaranteed if you define
* this macro only once in the qf_port.h header file and henceforth include
* this header file in all builds.
*/
#define QF_MAX_ACTIVE 32U
/*! The maximum number of clock tick rates in the application.
*
* @description
* This macro can be defined in the QF ports and should be in range
* of 1U..15U, inclusive. The value of this macro determines the maximum
* number of clock tick rates for time events (::QTimeEvt).
*
* If the macro is not defined, the default value is 1U.
*
* @note Once you choose a certain value of #QF_MAX_TICK_RATE, you must
* consistently use the same value in building all the QP component libraries
* and your own application code. The consistency is guaranteed if you define
* this macro only once in the qf_port.h header file and henceforth include
* this header file in all builds.
*/
#define QF_MAX_TICK_RATE 1U
/*! The maximum number of event pools in the application.
*
* @description
* This macro can be defined in the QF ports and should be in range
* of 1U..255U, inclusive. The value of this macro determines the maximum
* event pools in the system. Not all event pools must be actually used,
* but the maximum number of pools cannot exceed #QF_MAX_EPOOL.
*
* If the macro is not defined, the default value is 3U. Defining the value
* below the maximum saves some memory, mostly for the subscriber-lists.
* @sa ::QSubscrList.
*
* @note Once you choose a certain value of #QF_MAX_EPOOL, you must
* consistently use the same value in building all the QP component libraries
* and your own application code. The consistency is guaranteed if you define
* this macro only once in the qf_port.h header file and henceforth include
* this header file in all builds.
*/
#define QF_MAX_EPOOL 3U
/*! The size (in bytes) of the event-size representation in the QF.
* Valid values: 1U, 2U, or 4U; default 2U
*
* @description
* This macro can be defined in the QF ports to configure the size
* of the event-size.
*
* @note Once you choose a certain value of #QF_EVENT_SIZ_SIZE, you must
* consistently use the same value in building all the QP component libraries
* and your own application code. The consistency is guaranteed if you define
* this macro only once in the qf_port.h header file and henceforth include
* this header file in all builds.
*/
#define QF_EVENT_SIZ_SIZE 2U
/*! The size (in bytes) of the ring-buffer counters used in the native QF
* event queue implementation. Valid values: 1U, 2U, or 4U; default 1U
*
* @description
* This macro can be defined in the QF ports to configure the ::QEQueueCtr
* type. If the macro is not defined, the default of 1 byte will be chosen in
* qequeue.h. The valid #QF_EQUEUE_CTR_SIZE values of 1U, 2U, or 4U, correspond
* to ::QEQueueCtr of uint8_t, uint16_t, and uint32_t, respectively. The
* ::QEQueueCtr data type determines the dynamic range of numerical values of
* ring-buffer counters inside event queues, or, in other words, the maximum
* number of events that the native QF event queue can manage.
* @sa ::QEQueue
*
* @note Once you choose a certain value of #QF_EQUEUE_CTR_SIZE, you must
* consistently use the same value in building all the QP component libraries
* and your own application code. The consistency is guaranteed if you define
* this macro only once in the qf_port.h header file and henceforth include
* this header file in all builds.
*/
#define QF_EQUEUE_CTR_SIZE 1U
/*! The size (in bytes) of the block-size representation in the native QF
* event pool. Valid values: 1U, 2U, or 4U; default #QF_EVENT_SIZ_SIZE.
*
* @description
* This macro can be defined in the QF ports to configure the ::QMPoolSize
* type. If the macro is not defined, the default of #QF_EVENT_SIZ_SIZE
* will be chosen in qmpool.h, because the memory pool is primarily used for
* implementing event pools.
*
* The valid #QF_MPOOL_SIZ_SIZE values of 1U, 2U, or 4U, correspond to
* ::QMPoolSize of uint8_t, uint16_t, and uint32_t, respectively. The
* ::QMPoolSize data type determines the dynamic range of block-sizes that
* the native ::QMPool can handle.
* @sa #QF_EVENT_SIZ_SIZE, ::QMPool
*
* @note Once you choose a certain value of #QF_MPOOL_SIZ_SIZE, you must
* consistently use the same value in building all the QP component libraries
* and your own application code. The consistency is guaranteed if you define
* this macro only once in the qf_port.h header file and henceforth include
* this header file in all builds.
*/
#define QF_MPOOL_SIZ_SIZE 2U
/*! The size (in bytes) of the block-counter representation in the
* native QF event pool. Valid values: 1U, 2U, or 4U; default 2U.
*
* @description
* This macro can be defined in the QF ports to configure the ::QMPoolCtr
* type. If the macro is not defined, the default of 2 bytes will be chosen
* in qmpool.h. The valid #QF_MPOOL_CTR_SIZE values of 1U, 2U, or 4U,
* correspond to ::QMPoolSize of uint8_t, uint16_t, and uint32_t, respectively.
* The ::QMPoolCtr data type determines the dynamic range of block-counters
* that the native ::QMPool can handle, or, in other words, the maximum number
* of blocks that the native QF event pool can manage.
* @sa ::QMPool
*
* @note Once you choose a certain value of #QF_MPOOL_CTR_SIZE, you must
* consistently use the same value in building all the QP component libraries
* and your own application code. The consistency is guaranteed if you define
* this macro only once in the qf_port.h header file and henceforth include
* this header file in all builds.
*/
#define QF_MPOOL_CTR_SIZE 2U
/*! The size (in bytes) of the time event-counter representation
* in the ::QTimeEvt struct. Valid values: 1U, 2U, or 4U; default 2U.
*
* @description
* This macro can be defined in the QF ports to configure the internal tick
* counters of Time Events. If the macro is not defined, the default of 2
* bytes will be chosen in qf.h. The valid #QF_TIMEEVT_CTR_SIZE values of 1,
* 2, or 4, correspond to tick counters of uint8_t, uint16_t, and uint32_t,
* respectively. The tick counter representation determines the dynamic range
* of time delays that a Time Event can handle.
* @sa ::QTimeEvt
*
* @note Once you choose a certain value of #QF_TIMEEVT_CTR_SIZE, you must
* consistently use the same value in building all the QP component libraries
* and your own application code. The consistency is guaranteed if you define
* this macro only once in the qf_port.h header file and henceforth include
* this header file in all builds.
*/
#define QF_TIMEEVT_CTR_SIZE 2U
/*! Define the interrupt disabling policy.
*
* @description
* This macro encapsulates platform-specific way of disabling interrupts
* from "C" for a given CPU and compiler.
*
* @note
* the #QF_INT_DISABLE macro should always be used in pair with the
* macro #QF_INT_ENABLE.
*/
#define QF_INT_DISABLE() intDisable()
/*! Define the interrupt enabling policy.
*
* @description
* This macro encapsulates platform-specific way of enabling interrupts
* from "C" for a given CPU and compiler.
*
* @note the #QF_INT_DISABLE macro should always be used in pair with the
* macro #QF_INT_ENABLE.
*/
#define QF_INT_ENABLE() intEnable()
void intDisable(void);
void intEnable(void);
/*! Define the type of the critical section status.
*
* @description
* Defining this macro configures the "saving and restoring critical section
* status" policy. Coversely, if this macro is not defined, the simple
* "unconditional critical section exit" is used.
*/
#define QF_CRIT_STAT_TYPE crit_stat_t
/*! Define the critical section entry policy.
*
* @description
* This macro enters a critical section (often by means of disabling
* interrupts). When the "saving and restoring critical section status"
* policy is used, the macro sets the @a status_ argument to the critical
* section status just before the entry. When the policy of "unconditional
* critical section exit" is used, the macro does not use the @a status_
* argument.
*
* @note the #QF_CRIT_ENTRY macro should always be used in pair with the
* macro #QF_CRIT_EXIT.
*/
#define QF_CRIT_ENTRY(stat_) ((stat_) = critEntry())
/*! Define the critical section exit policy.
/*
* @description
* This macro enters a critical section (often by means of disabling
* interrupts). When the "saving and restoring critical section status"
* policy is used, the macro restores the critical section status from the
* @a status_ argument. When the policy of "unconditional critical section
* exit" is used, the macro does not use the @a status argument and
* exits the critical section unconditionally (often by means of enabling
* interrupts).
*
* @note the #QF_CRIT_ENTRY macro should always be used in pair with the
* macro #QF_CRIT_EXIT.
*/
#define QF_CRIT_EXIT(stat_) critExit(stat_)
typedef unsigned int crit_stat_t;
crit_stat_t critEntry(void);
void critExit(crit_stat_t stat);
/*! Enable the QActive_stop() API in the QF port.
*
* @description
* Defining this macro enables the QActive_stop() API in a given port.
* This feature should be used with caution, as stopping and re-starting
* active objects **cleanly** can be tricky.
*/
#define QF_ACTIVE_STOP
/*! The preprocessor switch to disable checking assertions
*
* @description
* When defined, Q_NASSERT disables the following macros #Q_ASSERT,
* #Q_REQUIRE, #Q_ENSURE, #Q_INVARIANT, #Q_ERROR as well as
* #Q_ASSERT_ID, #Q_REQUIRE_ID, #Q_ENSURE_ID, #Q_INVARIANT_ID, and
* #Q_ERROR_ID do _not_ evaluate the test condition passed as the
* argument to these macros.
*
* @note The notable exceptions are the macros #Q_ALLEGE and
* #Q_ALLEGE_ID, that still evaluate the test condition, but do not
* report assertion failures when the switch #Q_NASSERT is defined.
*/
#define Q_NASSERT
/*! The preprocessor switch to activate the QS software tracing
* instrumentation in the code
*
* @description
* When defined, Q_SPY activates the QS software tracing instrumentation.
* When Q_SPY is not defined, the QS instrumentation in the code does
* not generate any code.
*/
#define Q_SPY
/*! The preprocessor switch to activate the QUTest unit testing
* instrumentation in the code
*
* @note
* This macro requires that #Q_SPY be defined as well.
*/
#define Q_UTEST
/*! The preprocessor switch to enable constructor in the ::QEvt class
* instrumentation in the code
*
* @tr{RQP005}
*/
#define Q_EVT_CTOR
/*! This macro defines the type of the thread handle used for AOs */
#define QF_THREAD_TYPE void*
/*! This macro defines the type of the event-queue used for AOs */
#define QF_EQUEUE_TYPE QEQueue
/*! This macro defines the type of the OS-Object used for blocking
* the native ::QEQueue when the queue is empty
*
* @description
* This macro is used when ::QEQueue is used as the event-queue for AOs
* but also the AO queue must *block* when the queue is empty.
* In that case, #QF_OS_OBJECT_TYPE specifies the blocking mechanism.
* For example, in the POSIX port, the blocking mechanism is a condition
* variable.
*/
#define QF_OS_OBJECT_TYPE pthread_cond_t
/*! Platform-dependent macro defining how QF should block the
* calling task when the QF native queue is empty
*
* @note
* This is just an example of QACTIVE_EQUEUE_WAIT_() for the QK-port
* of QF. QK never activates a task that has no events to process, so in
* this case the macro asserts that the queue is not empty. In other QF
* ports you need to define the macro appropriately for the underlying
* kernel/OS you're using.
*/
#define QACTIVE_EQUEUE_WAIT_(me_) \
(Q_ASSERT((me_)->eQueue.frontEvt != (QEvt *)0))
#if (QF_MAX_ACTIVE <= 8U)
#define QACTIVE_EQUEUE_SIGNAL_(me_) do { \
QPSet8_insert(&QF_readySet_, (me_)->prio); \
if (QF_intNest_ == 0U) { \
uint_fast8_t p = QK_schedPrio_(); \
if (p != 0U) { \
QK_sched_(p); \
} \
} \
} while (0)
#else
/*! Platform-dependent macro defining how QF should signal the
* active object task that an event has just arrived.
*
* @description
* The macro is necessary only when the native QF event queue is used.
* The signaling of task involves unblocking the task if it is blocked.
*
* @note QACTIVE_EQUEUE_SIGNAL_() is called from a critical section.
* It might leave the critical section internally, but must restore
* the critical section before exiting to the caller.
*
* @note This is just an example of QACTIVE_EQUEUE_SIGNAL_() for the
* QK-port of QF. In other QF ports you need to define the macro
* appropriately for the underlying kernel/OS you're using.
*/
#define QACTIVE_EQUEUE_SIGNAL_(me_) do { \
QPSet64_insert(&QF_readySet_, (me_)->prio); \
if (QF_intNest_ == 0U) { \
uint_fast8_t p = QK_schedPrio_(); \
if (p != 0U) { \
QK_sched_(p); \
} \
} \
} while (0)
#endif
/*! This macro defines the type of the event pool used in the QK kernel.
*
* @note This is a specific implementation for the QK-port of QF.
* In other QF ports you need to define the macro appropriately for
* the underlying kernel/OS you're using.
*/
#define QF_EPOOL_TYPE_ QMPool
/*! This macro enables calling the QK context-switch callback
* QK_onContextSw()
*/
#define QK_ON_CONTEXT_SW
/*! This macro enables calling the QXK context-switch callback
* QXK_onContextSw()
*/
#define QXK_ON_CONTEXT_SW
/*! Platform-dependent macro defining the event pool initialization
*
* @note
* This is an example implementation based on the native ::QMPool class.
* In other QF ports, the port might be using a memory pool from the
* underlying kernel/OS.
*/
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
(QMPool_init(&(p_), (poolSto_), (poolSize_), (QMPoolSize)(evtSize_)))
/*! Platform-dependent macro defining how QF should obtain the
* event pool block-size
*
* @note
* This is a specific implementation for the built-in kernels.
* In other QF ports you need to define the macro appropriately for
* the underlying kernel/OS you're using.
*/
#define QF_EPOOL_EVENT_SIZE_(p_) ((uint32_t)(p_).blockSize)
/*! Platform-dependent macro defining how QF should obtain an event
* @a e_ from the event pool @a p_ with the free margin @a m_.
*
* @note
* This is an example implementation based on the native ::QMPool class.
* In other QF ports, the port might be using a memory pool from the
* underlying kernel/OS.
*/
#define QF_EPOOL_GET_(p_, e_, m_, qs_id_) \
((e_) = (QEvt *)QMPool_get(&(p_), (m_), (qs_id_)))
/*! Platform-dependent macro defining how QF should return an event
* @a e_ to the event pool @a p_
*
* @note
* This is an example implementation based on the native ::QMPool class.
* In other QF ports, the port might be using a memory pool from the
* underlying kernel/OS.
*/
#define QF_EPOOL_PUT_(p_, e_, qs_id_) \
(QMPool_put(&(p_), (e_), (qs_id_)))
/*! Macro defined only for the internal QP implementation. It should
* be not defined for the application-level code
*/
#define QP_IMPL

View File

@ -1,15 +1,13 @@
/*##########################################################################*/
/*! @dir ../include
Platform-independent QP&trade;/C API
/*! @dir include
@brief Platform-independent QP&trade;/C API
@attention
The QP&trade;/C <span class="img folder">include</span> directory needs to be added to the compiler's include path in the applications using QP&trade;/C.
*/
/*##########################################################################*/
/*! @dir ../src
Platform-independent QP&trade;/C source code
/*! @dir src
@brief Platform-independent QP&trade;/C source code
Files from this directory need to be added to the project, to build the QP&trade;/C framework from source code.
@ -17,44 +15,34 @@ Files from this directory need to be added to the project, to build the QP&trade
The QP&trade;/C <span class="img folder">src</span> directory needs to be added to the compiler's include path in the applications that build QP&trade;/C framework from sources (as opposed to using QP as a pre-built library).
*/
/*##########################################################################*/
/*! @dir ../src/qf
Platform-independent implementation of the @ref qep and @ref qf components.
/*! @dir src/qf
@brief Platform-independent implementation of the @ref qep and @ref qf components.
@note
Typically, files in this directory need to be added to the application build, but some QP ports might not need all the files in this directory. For example, a QP port to a 3rd-party RTOS kernel might be using a message queue of the RTOS instead of the native QP event queue, in which case the file qf_actq.c would not be needed and should be excluded from the build.
*/
/*##########################################################################*/
/*! @dir ../src/qv
Platform-independent implementation of the @ref qv built-in kernel.
/*! @dir src/qv
@brief Platform-independent implementation of the @ref srs_qv built-in kernel.
@attention
Files in this directory need to be included in the QP application build only if the application uses the @ref qv kernel.
Files in this directory need to be included in the QP application build only if the application uses the @ref srs_qv kernel.
*/
/*##########################################################################*/
/*! @dir ../src/qk
Platform-independent implementation of the @ref qk built-in kernel.
/*! @dir src/qk
@brief Platform-independent implementation of the @ref srs_qk built-in kernel.
@attention
Files in this directory need to be included in the QP application build only if the application uses the @ref qk kernel.
Files in this directory need to be included in the QP application build only if the application uses the @ref srs_qk kernel.
*/
/*##########################################################################*/
/*! @dir ../src/qxk
Platform-independent implementation of the @ref qxk built-in kernel.
/*! @dir src/qxk
@brief Platform-independent implementation of the @ref srs_qxk built-in kernel.
@attention
Files in this directory need to be included in the QP application build only if the application uses the @ref qxk kernel.
Files in this directory need to be included in the QP application build only if the application uses the @ref srs_qxk kernel.
*/
/*##########################################################################*/
/*! @dir ../src/qs
Platform-independent implementation of the @ref qs component (software tracing).
*/
/*##########################################################################*/
/*! @dir ../3rd_party
3rd-Party code used in the QP&trade;/C @ref ports "ports" and @ref exa "examples"
/*! @dir src/qs
@brief Platform-independent implementation of the @ref qs component (software tracing).
*/

View File

@ -1,7 +1,5 @@
/*! @page exa Examples
@tableofcontents
@section exa_gen General Comments
The QP/C distribution contains many @subpage exa_ref "example projects" to demonstrate various QP/C features. Each example project is described on its own dedicated page that you can find using several criteria (see @ref exa_ref). The example projects have the following main goals:
@ -15,7 +13,6 @@ The QP/C distribution contains many @subpage exa_ref "example projects" to demon
It is highly recommended that you create your own projects by **copying and modifying** existing example projects rather than starting your QP/C projects from scratch.
@subsection exa_code Example Code Structure
QP/C examples are located in sub-directories of the <span class="img folder">examples</span> <a href="files.html">top-level folder</a>, with the hierarchical organization outlined below:
@ -193,7 +190,7 @@ QP/C examples are located in sub-directories of the <span class="img folder">exa
<li><span class="tag">A</span> @subpage exa_native "Native examples" are located in sub-directories named after the CPU architecture, such as <span class="img folder">arm-cm</span> for ARM Cortex-M. Under that directory, the sub-directories <span class="img folder">blinky_ek-tm4c123gxl</span> contain the specific example on the specified board, such as "Blinky" on the EK-TM4C123GXL board here. In the specific example folder, you find sub-folders for the @ref comp_qv "QV", @ref comp_qk "QK" and @ref comp_qxk "QXK" kernels, respectively.
</li>
<li><span class="tag">B</span> @subpage exa_rtos "Examples for 3rd-party RTOS"/@ref exa_os "OS" are located in sub-directories named after the RTOS/OS, such as <span class="img folder">ucos-ii</span> for uCOS-II RTOS. Under that directory, the sub-directories, such as <span class="img folder">arm-cm</span>, contain examples for the specified CPU architecture, such as ARM Cortex-M here.
<li><span class="tag">B</span> @subpage exa_rtos "Examples for 3rd-party RTOS"/@ref exa_os "OS" are located in sub-directories named after the RTOS/OS, such as <span class="img folder">uc-os2</span> for uc-os2 RTOS. Under that directory, the sub-directories, such as <span class="img folder">arm-cm</span>, contain examples for the specified CPU architecture, such as ARM Cortex-M here.
</li>
<li><span class="tag">C</span> @subpage exa_mware "Examples for 3rd-party Middleware" are located in sub-directories named after the middleware, such as <span class="img folder">lwIP</span> for the lwIP TCP/IP stack. Under that directory, the sub-directories, such as <span class="img folder">arm-cm</span>, contain examples for the specified CPU architecture, such as ARM Cortex-M here.
@ -210,7 +207,6 @@ QP/C examples are located in sub-directories of the <span class="img folder">exa
Because the QP distribution contains *all* examples, the number of sub-directories and files in the <span class="img folder">examples</span> folder may seem daunting. However, knowing the structure of the <span class="img folder">examples</span> folder, you can simply ignore or even delete the sub-directories that are not interesting to you.
@subsection exa_sec_apps Example Applications
To demonstrate QP/C features on an embedded board, you need to create an application that does "something interesting". Instead of inventing this "something interesting" for each and every example, the example projects implement one of the three "example applications", which are described on the @ref gs_tut "QP&trade;/C Tutorial":
@ -228,12 +224,10 @@ Beyond these basic applications for demonstrating and testing the various @ref p
While some provided examples can run on your @ref exa_os "desktop computer", most embedded example projects require special hardware in form of @ref exa_sec_boards, which you need to acquire to be able to run the examples. The boards chosen for the examples are generally inexpensive and self-contained with no need for external hardware (such as external JTAG debuggers or power supplies).
@subsection exa_sec_tools Development Tools
Most provided examples require special embedded cross-development tools, such as embedded compilers, linkers, debuggers and IDEs, which you need to acquire independently from the QP/C distribution. Generally, the examples work with the free (size limited) evaluation versions of the commercial tools. The examples list the versions of tools they were developed and tested with. Please refer to the @ref exa_ref "cross-reference section" @ref exa_sec_tools to see which embedded toolchains are used.
@subsection exa_sec_conf Build Configurations
QP examples @ref ports "QP ports" are provided in the following three **build configurations**:
@ -249,7 +243,6 @@ QP examples @ref ports "QP ports" are provided in the following three **build co
The different phases of embedded software life cycle pose different challenges. During the development and maintenance phase, for example, the emphasis is on the ease of debugging and verifying the correctness of the code, which require lower levels of optimization and special scaffolding code. In contrast, for releasing the code in the final product, the emphasis is on small memory footprint and CPU time efficiency, which require high-level of optimization and removal of any scaffolding code. To address these conflicting needs, the same source code is compiled into multiple **build configurations** that differ in the use of compiler options and activation of the scaffolding code.
@subsection exa_sec_qm QM Models
Many example projects contain code auto-generated by the <a class="extern" target="_blank" href="https://www.state-machine.com/qm"><strong>QM modeling tool</strong></a>. Such projects always contain the corresponding **QM model** file, which you can open in QM, modify, and re-generate the code.
@ -257,7 +250,6 @@ Many example projects contain code auto-generated by the <a class="extern" targe
The auto-generated files are saved as **read-only**. This protects them from inadvertent modifications, which will get lost when the files are re-generated by QM (or QMC). All modifications to the auto-generated code should be done in the QM model, not in the code.
@subsection exa_sec_3rd Third-Party Code
The QP/C example projects often need to use various additional code, such as MCU register definition files, startup code, device drivers, etc., which are provided by Third-Party vendors. All such code is located in the <span class="img folder">3rd_party</span> <a href="files.html">top-level folder</a>.
@ -272,9 +264,7 @@ The Third-Party software components included in the <span class="img folder">3rd
sub-folders.
@subsection exa_own Creating your Own QP/C Projects
Perhaps the most important fact of life to remember is that in embedded systems nothing works until everything works. This means that you should always start with a <strong>working system</strong> and gradually evolve it, changing one thing at a time and making sure that it keeps working every step of the way.
Keeping this in mind, the provided QP/C application examples, such as the super-simple Blinky, or a bit more advanced @ref dpp or @ref game, allow you to get started with a working project rather than starting from scratch. You should also always try one of the provided example projects on the same evaluation board that it was designed for, before making any changes.
@ -294,7 +284,6 @@ After copying the project folder, you still need to change the name of the proje
By copying and re-naming an existing, working project, as opposed to creating a new one from scratch, you inherit the correct compiler and linker options an other project settings, which will help you get started much faster.
@subsection exa_doc Next Steps and Further Reading About QP and QM
To work with QP/C effectively, you need to learn a bit more about active objects and state machines. Below is a list of links to enable you to further your knowledge:
@ -311,9 +300,6 @@ To work with QP/C effectively, you need to learn a bit more about active objects
/*##########################################################################*/
/*! @page exa_ref Cross-Reference
@tableofcontents
@section exa_ref_kernel Native Examples (by Built-in Kernel)
- @ref exa_qv
- @ref exa_qk
@ -321,11 +307,6 @@ To work with QP/C effectively, you need to learn a bit more about active objects
@section exa_ref_tool Native Examples (by Development Toolchain)
@n
@subsection exa_ref_arm-keil ARM-Keil Toolchain (ARM Compiler 5)
- @ref arm-cm_blinky_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a> &nbsp; (Cortex-M4)
@subsection exa_ref_arm-clang ARM-Clang Toolchain (ARM Compiler 6)
@ -337,10 +318,8 @@ To work with QP/C effectively, you need to learn a bit more about active objects
- @ref arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_NUCLEO-L152RE.jpg" title="NUCLEO-L152RE"></a> &nbsp; (Cortex-M3)
- @ref arm-cm_game_efm32-slstk3401a <a class="preview board" href="bd_EFM32-SLSTK3401A.jpg" title="EFM32-SLSTK3401A"></a> &nbsp; (Cortex-M4)
- @ref arm-cm_dpp_stm32f4-discovery <a class="preview board" href="bd_STM32F4-Discovery.jpg" title="STM32F4-Discovery"></a>
- @ref arm-cm_dpp_stm32f746g-disco <a class="preview board" href="bd_STM32F746G-Disco.jpg" title="STM32F746G-Discovery"></a> &nbsp; (Cortex-M7)
- @ref arm-cm_dpp_nucleo-l053r8 <a class="preview board" href="bd_NUCLEO-L053R8.jpg" title="NUCLEO-L053R8"></a> &nbsp; (Cortex-M0+)
- @ref arm-cm_dpp_efm32-slstk3401a <a class="preview board" href="bd_EFM32-SLSTK3401A.jpg" title="EFM32-SLSTK3401A"></a> &nbsp; (Cortex-M4)
- @ref arm-cm_dpp_stm32f746g-disco <a class="preview board" href="bd_STM32F746G-Disco.jpg" title="STM32F746G-Discovery"></a> &nbsp; (Cortex-M7)
- @ref arm-cm_dpp_nucleo-h743zi <a class="preview board" href="bd_NUCLEO-H743ZI.jpg" title="NUCLEO-H743ZI"></a> &nbsp; (Cortex-M7)
@ -354,16 +333,13 @@ To work with QP/C effectively, you need to learn a bit more about active objects
- @ref arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_NUCLEO-L152RE.jpg" title="NUCLEO-L152RE"></a> &nbsp; (Cortex-M3)
- @ref arm-cm_game_efm32-slstk3401a <a class="preview board" href="bd_EFM32-SLSTK3401A.jpg" title="EFM32-SLSTK3401A"></a> &nbsp; (Cortex-M4)
- @ref arm-cm_dpp_stm32f4-discovery <a class="preview board" href="bd_STM32F4-Disco.jpg" title="STM32F4-Discovery"></a>
- @ref arm-cm_dpp_stm32f746g-disco <a class="preview board" href="bd_STM32F746G-Disco.jpg" title="STM32F746G-Discovery"></a> &nbsp; (Cortex-M7)
- @ref lwip_ek-lm3s6965 <a class="preview board" href="bd_EK-LM3S6965.jpg" title="EK-LM3S6965"></a> &nbsp; (Cortex-M3)
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a> &nbsp; (ARM7TDMI)
@subsection exa_ref_gnu-ccs GNU-ARM with TI CCS IDE
- @ref arm-cm_dpp_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a> &nbsp; (Cortex-M4)
@subsection exa_ref_iar-arm IAR EWARM
- @ref arm-cm_blinky_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a> &nbsp; (Cortex-M4)
- @ref arm-cm_blinky_efm32-slstk3401a <a class="preview board" href="bd_EFM32-SLSTK3401A.jpg" title="EFM32-SLSTK3401A"></a> &nbsp; (Cortex-M4)
@ -373,11 +349,9 @@ To work with QP/C effectively, you need to learn a bit more about active objects
- @ref arm-cm_dpp_nucleo-l053r8 <a class="preview board" href="bd_NUCLEO-L053R8.jpg" title="NUCLEO-L053R8"></a> &nbsp; (Cortex-M0+)
- @ref arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_NUCLEO-L152RE.jpg" title="NUCLEO-L152RE"></a> &nbsp; (Cortex-M3)
- @ref arm-cm_game_efm32-slstk3401a <a class="preview board" href="bd_EFM32-SLSTK3401A.jpg" title="EFM32-SLSTK3401A"></a> &nbsp; (Cortex-M4)
- @ref arm-cm_dpp_stm32f746g-disco <a class="preview board" href="bd_STM32F746G-Disco.jpg" title="STM32F746G-Discovery"></a> &nbsp; (Cortex-M7)
- @ref arm-cr_blinky_launchxl2-tms57012 <a class="preview board" href="bd_LAUNCHXL2-TMS57012.jpg" title="LAUNCHXL2-TMS57012"></a> &nbsp; (Cortex-R4)
- @ref arm-cr_dpp_launchxl2-tms57012 <a class="preview board" href="bd_LAUNCHXL2-TMS57012.jpg" title="LAUNCHXL2-TMS57012"></a> &nbsp; (Cortex-R4)
- @ref lwip_ek-lm3s6965 <a class="preview board" href="bd_EK-LM3S6965.jpg" title="EK-LM3S6965"></a> &nbsp; (Cortex-M3)
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a> &nbsp; (ARM7TDMI)
@subsection exa_ref_ccs-430 CCS for MSP430
@ -393,7 +367,6 @@ To work with QP/C effectively, you need to learn a bit more about active objects
@section exa_ref_native Native Examples (by Processor)
- @ref exa_arm-cm
- @ref exa_arm-cr
- @ref exa_arm7-9 ("classic ARM")
- @ref exa_msp430 ("classic" MSP430 and "extended" MSP430x)
@ -401,7 +374,7 @@ To work with QP/C effectively, you need to learn a bit more about active objects
- @ref exa_embos (SEGGER)
- @ref exa_freertos (Amazon Web Services)
- @ref exa_threadx (Express Logic)
- @ref exa_ucos-ii (Micrium/SiLabs)
- @ref exa_uc-os2 (Micrium/SiLabs)
@section exa_ref_os Examples for Workstations (Windows, Linux, MacOS)
@ -419,7 +392,6 @@ The examples in the "workstation" directory are designed for workstations (runni
- @ref exa_emwin (SEGGER, a.k.a. uC/GUI by Micrium)
@section exa_ref_boards Examples by Development Board
The boards chosen for the examples are generally inexpensive and self-contained with minimal need for external hardware (such as external JTAG debuggers or power supplies). Also, all the selected boards provide a virtual COM port (ideally) or can be easily connected to a TTL-to-USB serial converter cable for @ref comp_qs "QS software tracing" output.
@ -437,7 +409,7 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
- @ref freertos_dpp_ek-tm4c123gxl (FreeRTOS kernel; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains)
- @ref freertos_dpp_nucleo-h743zi (FreeRTOS kernel; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains)
- @ref threadx_dpp_ek-tm4c123gxl (ThreadX kernel; IAR-EWARM toolchain)
- @ref ucos-ii_dpp_ek-tm4c123gxl (uC/OS-II kernel; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains)
- @ref uc-os2_dpp_ek-tm4c123gxl (uC/OS-II kernel; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains)
@anchor EFM32-SLSTK3401A
@ -447,13 +419,11 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
- @ref arm-cm_game_efm32-slstk3401a (QV, QK kernels; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains; <a href="https://www.state-machine.com/qtools/qwin.html"><b>QWin-GUI emulation</b></a>)
@anchor mbed-LPC1768
![mbed-LPC1768](bd_mbed-LPC1768.jpg)
- @ref arm-cm_dpp_mbed-lpc1768 (QV, QK kernels; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains)
@anchor NUCLEO-L053R8
![NUCLEO-L053R8](bd_NUCLEO-L053R8.jpg)
- @ref arm-cm_dpp_nucleo-l053r8 (QV, QK, QXK kernels; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains)
@ -462,7 +432,7 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
@anchor NUCLEO-L152RE
![NUCLEO-L152RE](bd_NUCLEO-L152RE.jpg)
- @ref arm-cm_dpp_nucleo-l152re (QV, QK kernels; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains)
- @ref ucos-ii_dpp_nucleo-l053r8 (uC/OS-II kernel; ARM-KEIL, IAR-EWARM toolchains)
- @ref uc-os2_dpp_nucleo-l053r8 (uC/OS-II kernel; ARM-KEIL, IAR-EWARM toolchains)
@anchor exa_EK-LM3S6965
@ -483,14 +453,12 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
- @ref threadx_dpp_stm32f429-discovery (ThreadX kernel; IAR-EWARM toolchain)
@anchor STM32F746G-Discovery
![STM32F746G-Discovery](bd_STM32F746G-Disco.jpg)
- @ref arm-cm_dpp_stm32f746g-disco (QV, QK, QXK kernels; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains)
- @ref freertos_dpp_stm32f746g-disco (FreeRTOS kernel; ARM-KEIL, GNU-ARM, IAR-EWARM toolchains)
@subsection exa_ref_arm-cr ARM Cortex-R Boards:
@anchor LAUNCHXL2-TMS57012
![LAUNCHXL2-TMS57012](bd_LAUNCHXL2-TMS57012.jpg)
@ -498,12 +466,6 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
- @ref arm-cr_dpp_launchxl2-tms57012 (QV, QK kernels; CCS-TI-ARM, IAR-EWARM toolchains)
@subsection exa_ref_arm7-9 ARM7 Boards:
@anchor AT91SAM7S-EK
![AT91SAM7S-EK](bd_AT91SAM7S-EK.jpg)
- @ref arm7-9_dpp_at91sam7s-ek (QV, QK kernels; IAR-EWARM toolchains)
@subsection exa_ref_msp430 MSP430 Boards:
@anchor MSP-EXP430F5529LP
![MSP-EXP430F5529LP](bd_MSP-EXP430F5529LP.jpg)
@ -532,16 +494,12 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
- ARM Cortex-R
- @ref arm-cr_blinky_launchxl2-tms57012 <a class="preview board" href="bd_LAUNCHXL2-TMS57012.jpg" title="LAUNCHXL2-TMS57012"></a>
- @ref arm-cr_dpp_launchxl2-tms57012 <a class="preview board" href="bd_LAUNCHXL2-TMS57012.jpg" title="LAUNCHXL2-TMS57012"></a>
- ARM7 / ARM9
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a>
- MSP430
- @ref msp430_blinky_msp-exp430f5529lp <a class="preview board" href="bd_MSP-EXP430F5529LP.jpg" title="MSP-EXP430F5529LP"></a>
- @ref msp430_dpp_msp-exp430f5529lp <a class="preview board" href="bd_MSP-EXP430F5529LP.jpg" title="MSP-EXP430F5529LP"></a>
@section exa_ref_vendor Examples by MCU Vendor
- Atmel
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a>
- NXP
- @ref arm-cm_dpp_mbed-lpc1768 <a class="preview board" href="bd_mbed-LPC1768.jpg" title="mbed-LPC1768"></a>
- Silicon Labs

View File

@ -34,7 +34,7 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
- @ref arm-cm_dpp_nucleo-h743zi <a class="preview board" href="bd_NUCLEO-H743ZI.jpg" title="STM32 NUCLEO-H743ZI"></a>
- @ref arm-cm_dpp_nucleo-l552ze <a class="preview board" href="bd_NUCLEO-L552ZE.jpg" title="STM32 NUCLEO-L552ZE Q"></a>
- @ref arm-cm_game_efm32-slstk3401a <a class="preview board" href="bd_EFM32-SLSTK3401A.jpg" title="EFM32-SLSTK3401A"></a>
- @ref arm-cm_low-power <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
- @ref tut_low <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
- @ref arm-cr_blinky_launchxl2-tms57012 <a class="preview board" href="bd_LAUNCHXL2-TMS57012.jpg" title="LAUNCHXL2-TMS57012"></a>
- @ref arm-cr_dpp_launchxl2-tms57012 <a class="preview board" href="bd_LAUNCHXL2-TMS57012.jpg" title="LAUNCHXL2-TMS57012"></a>
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a>
@ -58,7 +58,7 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
- @ref arm-cm_dpp_stm32f4-discovery <a class="preview board" href="bd_STM32F4-Disco.jpg" title="STM32F4-Discovery"></a>
- @ref arm-cm_dpp_nucleo-h743zi <a class="preview board" href="bd_NUCLEO-H743ZI.jpg" title="STM32 NUCLEO-H743ZI"></a>
- @ref arm-cm_dpp_nucleo-l552ze <a class="preview board" href="bd_NUCLEO-L552ZE.jpg" title="STM32 STM32 NUCLEO-L552ZE Q"></a>
- @ref arm-cm_low-power <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
- @ref tut_low <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
- @ref arm-cr_blinky_launchxl2-tms57012 <a class="preview board" href="bd_LAUNCHXL2-TMS57012.jpg" title="LAUNCHXL2-TMS57012"></a>
- @ref arm-cr_dpp_launchxl2-tms57012 <a class="preview board" href="bd_LAUNCHXL2-TMS57012.jpg" title="LAUNCHXL2-TMS57012"></a>
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a>
@ -77,7 +77,7 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
- @ref arm-cm_dpp_stm32f4-discovery <a class="preview board" href="bd_STM32F4-Disco.jpg" title="STM32F4-Discovery"></a>
- @ref arm-cm_dpp_nucleo-l552ze <a class="preview board" href="bd_NUCLEO-L552ZE.jpg" title="STM32 NUCLEO-L552ZE Q"></a>
- @ref arm-cm_dpp_nucleo-h743zi <a class="preview board" href="bd_NUCLEO-H743ZI.jpg" title="STM32 NUCLEO-H743ZI"></a>
- @ref arm-cm_low-power <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
- @ref tut_low <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
*/
/*##########################################################################*/
@ -97,7 +97,7 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
- @subpage arm-cm_dpp_nucleo-h743zi <a class="preview board" href="bd_NUCLEO-H743ZI.jpg" title="STM32 NUCLEO-H743ZI"></a>
- @subpage arm-cm_dpp_nucleo-l552ze <a class="preview board" href="bd_NUCLEO-L552ZE.jpg" title="STM32 NUCLEO-L552ZE"></a>
- @subpage arm-cm_game_efm32-slstk3401a <a class="preview board" href="bd_EFM32-SLSTK3401A.jpg" title="EFM32-SLSTK3401A"></a>
- @subpage arm-cm_low-power <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
- @ref tut_low <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
*/
/*##########################################################################*/
/*! @page exa_arm-cr ARM Cortex-R
@ -130,8 +130,6 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
/*##########################################################################*/
/*! @page arm-cm_blinky_ek-tm4c123gxl Blinky on EK-TM4C123GXL
@tableofcontents
<p>This example implements the @ref blinky "Blinky sample application" on the EK-TM4C123GLX board (ARM Cortex-M4F).
</p>
@ -193,8 +191,6 @@ The Windows emulation is a simple console application that produces the followin
/*##########################################################################*/
/*! @page arm-cm_blinky_efm32-slstk3401a Blinky on EFM32-SLSTK3401A
@tableofcontents
<p>This example implements the @ref blinky "Blinky sample application" on the EFM32-SLSTK3401A board (ARM Cortex-M4F).
</p>
@ -260,8 +256,6 @@ The Windows emulation is a simple console application that produces the followin
/*##########################################################################*/
/*! @page arm-cm_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
@tableofcontents
<p>This example implements the @ref dpp "Dining Philosophers Problem" sample application on the EK-TM4C123GLX board (ARM Cortex-M4F).
</p>
@ -357,14 +351,12 @@ The application also demonstrates <a href="https://www.state-machine.com/qtools/
/*##########################################################################*/
/*! @page arm-cm_dpp_efm32-slstk3401a DPP on EFM32-SLSTK3401A
@tableofcontents
<p>This example implements the @ref dpp "Dining Philosophers Problem" sample application on the EFM32-SLSTK3401A board (ARM Cortex-M4F).
</p>
@image html bd_EFM32-SLSTK3401A.jpg EFM32-SLSTK3401A board
The DPP example is located in the directory <span class="img folder">qpc/examples/arm-cm/dpp_efm32-slstk3401a</span> and includes versions for @ref qv "cooperative QV kernel", the @ref qk "preemptive QK kernel", and the @ref qxk "preemptive dual mode QXK RTOS kernel" each provided for the ARM-KEIL, GNU-ARM, and IAR-ARM. The following annotated directory listing describes the contents of the example folder:
The DPP example is located in the directory <span class="img folder">qpc/examples/arm-cm/dpp_efm32-slstk3401a</span> and includes versions for @ref srs_qv "cooperative QV kernel", the @ref srs_qk "preemptive QK kernel", and the @ref srs_qxk "preemptive dual mode QXK RTOS kernel" each provided for the ARM-KEIL, GNU-ARM, and IAR-ARM. The following annotated directory listing describes the contents of the example folder:
@code{c}
qpc/ // QP/C installation directory
@ -458,9 +450,9 @@ Dining Philosophers Problem (DPP) example for NXP LPC1768 MCU (Cortex-M3) with
@ref dpp "Dining Philosophers Problem (DPP)" example for STM32 NUCLEO-L053R8 MCU (Cortex-M0+).
Demonstrated built-in kernels:
- cooperative @ref qv with ARM-Clang, ARM-Keil, GNU-ARM (Makefile and Atollic TRUEstudio), and IAR-ARM toolchains
- preemptive, run-to-completion @ref qk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- dual-mode (run-to-completion/blocking) @ref qxk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- cooperative @ref srs_qv with ARM-Clang, ARM-Keil, GNU-ARM (Makefile and Atollic TRUEstudio), and IAR-ARM toolchains
- preemptive, run-to-completion @ref srs_qk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- dual-mode (run-to-completion/blocking) @ref srs_qxk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
Features:
@ -477,8 +469,8 @@ Features:
@ref dpp "Dining Philosophers Problem (DPP)" example for STM32 NUCLEO-L152RE MCU (Cortex-M3).
Demonstrated built-in kernels:
- cooperative @ref qv with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- preemptive, run-to-completion @ref qk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- cooperative @ref srs_qv with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- preemptive, run-to-completion @ref srs_qk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
Features:
@ -495,9 +487,9 @@ The @ref dpp "DPP example" for STM32F4-Discovery board is located directory <spa
![STM32F4-Discovery board](bd_STM32F4-Disco.jpg)
Demonstrated built-in kernels:
- cooperative @ref qv with ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- preemptive, run-to-completion @ref qk with ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- dual-mode (run-to-completion/blocking) @ref qxk with ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- cooperative @ref srs_qv with ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- preemptive, run-to-completion @ref srs_qk with ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- dual-mode (run-to-completion/blocking) @ref srs_qxk with ARM-Keil, GNU-ARM, and IAR-ARM toolchains
Features:
@ -545,9 +537,9 @@ The actual COM port number might be different on your Windows machine. Please ch
@ref dpp "Dining Philosophers Problem (DPP)" example for STM32 NUCLEO-H743ZI MCU (Cortex-M7).
Demonstrated built-in kernels:
- cooperative @ref qv with ARM-Clang, ARM-Keil, GNU-ARM (Makefile and Atollic TRUEstudio), and IAR-ARM toolchains
- preemptive, run-to-completion @ref qk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- dual-mode (run-to-completion/blocking) @ref qxk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- cooperative @ref srs_qv with ARM-Clang, ARM-Keil, GNU-ARM (Makefile and Atollic TRUEstudio), and IAR-ARM toolchains
- preemptive, run-to-completion @ref srs_qk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- dual-mode (run-to-completion/blocking) @ref srs_qxk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
Features:
- multiple active objects, including 5 instances of the same AO class (Philo)
@ -558,16 +550,16 @@ Features:
*/
/*##########################################################################*/
/*! @page arm-cm_dpp_nucleo-l552ze DPP on STM32 STM32 NUCLEO-L552ZE Q
/*! @page arm-cm_dpp_nucleo-l552ze DPP on STM32 NUCLEO-L552ZE Q
![STM32 NUCLEO-L552ZE Q](bd_NUCLEO-L552ZE.jpg)
@ref dpp "Dining Philosophers Problem (DPP)" example for STM32 NUCLEO-L552ZE Q (Cortex-M33).
Demonstrated built-in kernels:
- cooperative @ref qv with ARM-Clang, ARM-Keil, GNU-ARM (Makefile and Atollic TRUEstudio), and IAR-ARM toolchains
- preemptive, run-to-completion @ref qk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- dual-mode (run-to-completion/blocking) @ref qxk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- cooperative @ref srs_qv with ARM-Clang, ARM-Keil, GNU-ARM (Makefile and Atollic TRUEstudio), and IAR-ARM toolchains
- preemptive, run-to-completion @ref srs_qk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
- dual-mode (run-to-completion/blocking) @ref srs_qxk with ARM-Clang, ARM-Keil, GNU-ARM, and IAR-ARM toolchains
Features:
- multiple active objects, including 5 instances of the same AO class (Philo)

View File

@ -1,7 +1,5 @@
/*! @page exa_os Examples for Workstations (Windows/POSIX)
@tableofcontents
<p>The examples in the <span class="img folder">qpc/examples/workstation</span> directory are designed for workstations (running Windows, Linux, or MacOS). Currently, the following examples are provided:
</p>

View File

@ -1,7 +1,5 @@
/*! @page exa_qutest Examples for QUTest Unit Testing Harness
@tableofcontents
<p>The examples in the <span class="img folder">qpc/examples/qutest</span> directory demonstrate how to test embedded code with the [<b>QUTest</b>](https://www.state-machine.com/qtools/qutest.html) unit testing harness. Currently, the following examples are provided:
</p>

View File

@ -6,10 +6,11 @@ The main purpose of integrating QP/C with conventional RTOSes is to enable you t
- @subpage exa_embos (directory <span class="img folder">examples/embos/</span>)
- @subpage exa_freertos (directory <span class="img folder">examples/freertos/</span>)
- @subpage exa_threadx (directory <span class="img folder">examples/threadx/</span>)
- @subpage exa_ucos-ii (directory <span class="img folder">examples/ucos-ii/</span>)
- @subpage exa_uc-os2 (directory <span class="img folder">examples/uc-os2/</span>)
- @subpage exa_zephyr (directory <span class="img folder">examples/zephyr/</span>)
@note
You do **not** need to use a third-party RTOS just to achieve preemptive multitasking with QP/C. The framework contains a selection of built-in real-time kernels, such as the cooperative @ref qv "QV kernel", the preemptive non-blocking @ref qk "QK kernel", and the preemptive, dual-mode, blocking @ref qxk "QXK kernel". Specifically, the QXK kernel has been designed specifically for mixing event-driven active objects with traditional **blocking code**, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software.
You do **not** need to use a third-party RTOS just to achieve preemptive multitasking with QP/C. The framework contains a selection of built-in real-time kernels, such as the cooperative @ref srs_qv "QV kernel", the preemptive non-blocking @ref srs_qk "QK kernel", and the preemptive, dual-mode, blocking @ref srs_qxk "QXK kernel". Specifically, the QXK kernel has been designed specifically for mixing event-driven active objects with traditional **blocking code**, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software.
@next{exa_embos examples}
*/
@ -232,7 +233,7 @@ The QP/C examples for ThreadX (Express Logic) are as follows:
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@next{exa_ucos-ii examples}
@next{exa_uc-os2 examples}
*/
/*##########################################################################*/
/*! @page threadx_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
@ -262,7 +263,6 @@ The sub-directory <span class="img folder">iar</span> contains the workspace and
After you load the DPP example into the STM32F4-Discovery board, the application should start blinking the 4 on-board LEDs. You can press the User button (blue) to PAUSE the philosophers for as long as the button is depressed. The philosophers resume dining when you release the User button. (In the PAUSED state the Table active object stops granting permissions to eat, so eventually all philosophers end in the "hungry" state.)
@section threadx_dpp_stm32f429-discovery_qs QS Software Tracing
The DPP example for ThreadX on STM32F4-Discovery board provides the "Spy" build configuration, which outputs the QS (Quantum Spy) software tracing data through USART2. To get the data out of the board, you need to connect the TTL/RS232 converter as follows:
@ -288,17 +288,17 @@ qspy -cCOM1
The actual COM port number might be different on your Windows machine. Please check the Device Manager to find the COM port number.
@next{exa_ucos-ii examples}
@next{exa_uc-os2 examples}
*/
/*##########################################################################*/
/*! @page exa_ucos-ii uC/OS-II
/*! @page exa_uc-os2 uC-OS2
The QP/C examples for uC/OS-II are as follows:
The QP/C examples for uC-OS2 are as follows:
- ARM Cortex-M
- @subpage ucos-ii_dpp_ek-tm4c123gxl (Cortex-M4F) <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a><br>(ARM-CLANG, GNU-ARM and IAR EWARM toolsets)
- @subpage ucos-ii_dpp_nucleo-l053r8 (Cortex-M0+) <a class="preview board" href="bd_NUCLEO-L053R8.jpg" title="NUCLEO-L053R8"></a><br>(ARM-CLANG, GNU-ARM, and IAR EWARM toolsets)
- @subpage uc-os2_dpp_ek-tm4c123gxl (Cortex-M4F) <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a><br>(ARM-CLANG, GNU-ARM and IAR EWARM toolsets)
- @subpage uc-os2_dpp_nucleo-l053r8 (Cortex-M0+) <a class="preview board" href="bd_NUCLEO-L053R8.jpg" title="NUCLEO-L053R8"></a><br>(ARM-CLANG, GNU-ARM, and IAR EWARM toolsets)
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@ -306,7 +306,7 @@ You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp;
@next{exa_os examples}
*/
/*##########################################################################*/
/*! @page ucos-ii_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
/*! @page uc-os2_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
@image html bd_EK-TM4C123GXL.jpg "EK-TM4C123GXL board"
@ -314,10 +314,10 @@ DPP example for Texas Instruments TivaC123GXL MCU (Cortex-M4F) and ARM-CLANG, GN
@image html under_construction.jpg
@next{ucos-ii_dpp_nucleo-l053r8 examples}
@next{uc-os2_dpp_nucleo-l053r8 examples}
*/
/*##########################################################################*/
/*! @page ucos-ii_dpp_nucleo-l053r8 DPP on STM32-NUCLEO-L053R8
/*! @page uc-os2_dpp_nucleo-l053r8 DPP on STM32-NUCLEO-L053R8
@image html bd_NUCLEO-L053R8.jpg "STM32-NUCLEO-L053R8 board"
@ -325,6 +325,129 @@ DPP example for STM32 L053R8 MCU (Cortex-M0+) and ARM-CLANG, GNU-ARM and IAR EWA
@image html under_construction.jpg
@next{exa_os examples}
@next{exa_zephyr examples}
*/
/*##########################################################################*/
/*! @page exa_zephyr Zephyr
The QP/C examples for Zephyr are as follows:
- @subpage zephyr_blinky
- @subpage zephyr_dpp
@next{zephyr_blinky}
*/
/*##########################################################################*/
/*! @page zephyr_blinky Blinky
Blinks an on-board LED once per second.
The blinking is done by an Active Object (Blinky) with a state machine.
@section zephyr_blinky-build Building and Running
- Linux:
Open a terminal in the blinky directory.
@verbatim
source ~/zephyrproject/zephyr/zephyr-env.sh
west build -b <board>
west flush
@endverbatim
@section zephyr_blinky-output Sample Output
Once flashed to the board, the application also produces ASCII output to the serial terminal (if supported by the board):
@verbatim
*** Booting Zephyr OS build v2.6.0-rc2-88-g3d39f72a88b3 ***
BSP_ledOff
QF_onStartup
BSP_ledOn
BSP_ledOff
BSP_ledOn
BSP_ledOff
@endverbatim
@note
The example has been tested with the following boards:
![STM32-NUCLEO-L053R8 board](bd_NUCLEO-L053R8.jpg)
<br>
![STM32-NUCLEO-H743ZI board](bd_NUCLEO-H743ZI.jpg)
@note
The example should also work with most boards supported by Zephyr.
@section zephyr_blinky-limits Limitations
The simple Blinky example does not support the QS software tracing.
@next{zephyr_dpp}
*/
/*##########################################################################*/
/*! @page zephyr_dpp DPP
DPP example with multiple active objects.
@section zephyr_dpp-build Building and Running
- Linux:
Open a terminal in the dpp directory.
@verbatim
source ~/zephyrproject/zephyr/zephyr-env.sh
west build -b <board>
west flush
@endverbatim
@section zephyr_dpp-output Sample Output
Once flashed to the board, the application also produces ASCII output to the serial terminal (if supported by the board):
@verbatim
*** Booting Zephyr OS build v2.6.0-rc2-88-g3d39f72a88b3 ***
Philo[4]->thinking
Philo[3]->eating
Philo[1]->thinking
Philo[0]->eating
Philo[4]->hungry
Philo[3]->thinking
Philo[2]->eating
Philo[1]->hungry
Philo[0]->thinking
Philo[4]->eating
Philo[3]->hungry
Philo[0]->hungry
Philo[4]->thinking
Philo[0]->eating
Philo[2]->thinking
Philo[3]->eating
Philo[4]->hungry
Philo[2]->hungry
Philo[3]->thinking
Philo[2]->eating
Philo[0]->thinking
@endverbatim
@note
The example has been tested with the following boards:
![STM32-NUCLEO-L053R8 board](bd_NUCLEO-L053R8.jpg)
<br>
![STM32-NUCLEO-H743ZI board](bd_NUCLEO-H743ZI.jpg)
@note
The example should also work with most boards supported by Zephyr.
@section zephyr_dpp-limits Limitations
The DPP example currently does not support the QS software tracing,
because implementation of the QS output over UART is board dependent. However, for a specific board, re-implementing the QS callbacks should be straightforward.
@next{exa_os}
*/

View File

@ -1,21 +1,26 @@
/*! @page gs Getting Started
@nav{index,gs_get}
The following sections describe how to get started with QP&trade;/C quickly:
- @subpage gs_get
- @subpage gs_over
- @subpage gs_tut
The YouTube Video <a class="extern" target="_blank" href="https://youtu.be/O7ER6_VqIH0"><strong>Getting Started with QP&trade; Frameworks</strong></a> provides instructions on how to download, install and get started with QP quickly.
[![Video: Getting Started with QP&trade; Real-Time Embedded Framework](gs-video.jpg)](https://youtu.be/O7ER6_VqIH0)
@note
<a href="modules.html" title="QP Cert-Pack"><img src="cert-pack.png" style="float:right; margin:0 20px 20px 0;"></img></a>
Information about the QP/C functionality, architecture, design, and other aspects is provided in the [Certification Package](modules.html):
- @ref srs &mdash; QP/C functionality
- @ref sas &mdash; QP/C architecture
- @ref sds &mdash; QP/C design
- @ref misra &mdash; QP/C compliance with MISRA-C
@nav{index,gs_get}
*/
/*##########################################################################*/
/*! @page gs_get Downloading &amp; Installing QP&trade;/C
@tableofcontents
@nav{gs,gs_over}
@nav{gs,gs_tut}
@section gs_bundle Downloading QP&trade;/C in QP&trade;-Bundle
The most recommended way of obtaining QP&trade;/C&trade; is by downloading the @webref{#Downloads, <b>QP-bundle&trade;</b>}, which includes QP&trade;/C as well as other QP&trade; frameworks and also the @webref{products/qm, QM&trade; modeling tool} and the @webref{products/qtools, QTools&trade; collection}. The main advantage of obtaining QP&trade;/C bundled together like that is that you get all components, tools and examples ready to go.
@ -23,20 +28,17 @@ The most recommended way of obtaining QP&trade;/C&trade; is by downloading the @
[![QP-bundle Downloads](qp-bundle.png)](https://www.state-machine.com/#Downloads)
@note
<a target="_blank" href="https://github.com/QuantumLeaps/qpc" title="QP&trade;/C on GitHub"><img style="float:right; clear:right;" src="img/github-corner.png"></a>
<a target="_blank" href="https://github.com/QuantumLeaps/qpc" title="QP&trade;/C on GitHub"><img style="float:right; clear:right;" src="img/logo_github.png"></a>
If you are allergic to installers and GUIs or don't have administrator privileges you can also **download and install QP&trade;/C separately** from the <a class="extern" target="_blank" href="https://github.com/QuantumLeaps/qpc"><b>QP&trade;/C GitHub repository</b></a>, as described in the next section.
@section gs_gh Downloading QP&trade;/C from GitHub
Go to the <a class="extern" href="https://github.com/QuantumLeaps/qpc/releases" target="_blank">QP&trade;/C <strong>release</strong> page on GitHub</a>, and choose the QP&trade;/C version number you wish to download. You should select the latest QP&trade;/C version, unless you have a very specific reason to go with an older release.
Inside the release directory (e.g., `6.9.3`), you need to choose the QP&trade;/C archive for your platform. QM&trade; is available for Windows (`qpc_<ver>-win32.zip`), Linux (`qpc_<ver>-linux64.zip`), and MacOS (`qm_<ver>-macx64.dmg`).
![QP&trade;/C downloads from GitHub](qpc_gh.jpg)
@section gs_dir QP&trade;/C Installation Folder
The following annotated directory tree lists the top-level directories provided in the standard QP&trade;/C distribution.
<ul class="tag">
@ -56,96 +58,18 @@ The following annotated directory tree lists the top-level directories provided
</ul>
</ul>
@attention
The QP/C GitHub repository does not contain the `3rd_party` folder, which is needed to build the @ref exa "QP&trade;/C Examples". Therefore, it is highly **recommended** to download the latest [QP/C Release](https://github.com/QuantumLeaps/qpc/releases) as opposed to cloning the repo directly.
@remark
The standard QP&trade;/C distribution contains many @ref exa "Example Projects", which are specifically designed to help you learn to use QP&trade;/C and to serve you as starting points for your own projects.
The standard QP&trade;/C distribution contains the `examples` folder with many @ref exa "Example Projects", which are specifically designed to help you learn to use QP&trade;/C and to serve you as starting points for your own projects.
<br>
@nav{gs,gs_over}
*/
/*##########################################################################*/
/*! @page gs_over QP&trade;/C Overview
@nav{gs_get,gs_tut}
@tableofcontents
This section gives a quick, high-level overview of the QP&trade; framework and its context of use. The main purpose is to provide the links to the more detailed information available in this QP&trade;/C Manual.
@section gs_struct General System Structure
The block diagram below illustrates the general system architecture based on the QP&trade;/C framework:
![General system architecture based on QP&trade;/C](qp_comp.jpg)
@note
The following sections describe the system structure from top to bottom because this is the order most relevant for the development of **QP&trade; Applications**.
@section gs_app QP&trade; Application
The **QP&trade; Application** consists of event-driven @webref{active-object, Active Objects}. The application is not a part of QP&trade;, but rather is *derived* from the QP&trade; framework that supplies the @ref api "API" for building the application as well as runtime environment to execute it on an embedded target.
@sa
- @ref srs_app "Application Requirements"
- @ref exa "Application Examples"
@section gs_qep QEP State Machine Processor
The QEP component provides services related to event-driven **State Machines**. This is the most relevant QP&trade; layer for the application developers, because they spend most of their time elaborating the state machines of their Active Objects.
@sa
- @ref srs_evt "Event Requirements"
- @ref srs_sm "State Machine Overview &amp; Requirements"
- @ref sas_sm "State Machine Architecture"
- @ref sds_sm "State Machine Design &amp; Implementation"
@section gs_qf QF Active Object Framework
The QF component provides services related to **Active Objects** like: asynchronous event passing, queuing of events, publish-subscribe, time events, deterministic event pools for mutable events, etc. These services form the core of the QP&trade; framework, which provides the Run-To-Completion (RTC) execution context for the Active Objects and their internal state machines. The application developers often use the Active Object services in the *actions* executed by the state machines.
@sa
- @ref srs_ao "Active Object Overview &amp; Requirements"
- @ref sas_ao "Active Object Architecture"
- @ref sds_ao "Active Object Design &amp; Implementation"
@section gs_kernel Real-Time Kernels/RTOS/GPOS
The QP&trade; framework can run standalone with one of the provided built-in kernels or it can run on top of a traditional, 3rd-party RTOS, or on top of a general-purpose OS.
@subsubsection gs_kernel-builtin Built-in Real-Time Kernels
The QP&trade; framework contains a selection of built-in real-time kernels, such as:
- the cooperative QV kernel (see @ref srs_qv_intro "QV Kernel Theory of Operation"),
- the preemptive non-blocking QK kernel (see @ref srs_qk_intro "QK Kernel Theory of Operation"), and
- the preemptive, dual-mode, blocking QXK kernel (see @ref srs_qxk_intro "QXK Kernel Theory of Operation").
@subsection gs_kernel-rtos 3rd-Party RTOS Kernels
QP&trade; can also work with many 3rd-party RTOSes, such as:
- @ref embos "embOS (SEGGER)"
- @ref freertos "FreeRTOS (AWS)"
- @ref threadx "ThreadX (Microsoft)"
- @ref ucos-ii "uC/OS-II (Silicon Labs)"
@subsection gs_kernel-gpos General-Purpose Operating Systems
Finally, QP&trade; can also work with general-purpose operating systems, such as:
- @ref posix "POSIX (Linux, QNX, VxWorks, Integrity, etc.)"
- @ref win32 "Windows".
@section gs_qs QS Software Tracing
The QS component provides special instrumentation inside QP that can produce detailed information from the execution of the QP Application. This information, produced in live system can be valuable for debugging, fine-tuning and testing of the QP Applications.
@sa
- @ref srs_qs "Software Tracing Overview &amp; Requirements"
- @ref sas_qs "Software Tracing Architecture"
- @ref sds_qs "Software Tracing Design &amp; Implementation"
<br>
@nav{gs_get,gs_tut}
<div style="clear:both;"></div>
@nav{gs,gs_tut}
*/
/*##########################################################################*/
/*! @page gs_tut QP&trade;/C Tutorial
@tableofcontents
@nav{gs_over,tut_blinky}
@nav{gs_get,tut_blinky}
This Tutorial describes how to use the QP/C&trade; real-time embedded framework in a series of progressively advancing examples. The first example ("Blinky") uses only one Active Object with a simple non-hierarchical state machine. The following example ("DPP") demonstrates multiple, communicating Active Objects. Finally, the last example ("Fly'n'Shoot" game) demonstrates all features the QP&trade; framework. It is highly recommended to study the simpler examples before the more advanced ones, as the basic information won't be repeated in the later examples.
@ -170,11 +94,10 @@ By copying and re-naming an existing, working project, as opposed to creating a
from scratch, you inherit the correct compiler and linker options an other project settings, which will help you get started much faster.
<br>
@nav{gs_over,tut_blinky}
@nav{gs_get,tut_blinky}
*/
/*##########################################################################*/
/*! @page tut_blinky Simple Blinky Application
@tableofcontents
@nav{gs_tut,tut_dpp}
The ultra-simple Blinky example is the embedded systems' equivalent of the venerable <i>"Hello World!"</i> program, that is, the simplest possible working QP&trade; application that does "something". In the case of Blinky, this "something" is blinking an LED at the rate of 1Hz, where an LED turns on and remains on for 0.5 seconds on then turns off and remains off for 0.5 seconds.
@ -198,11 +121,11 @@ The details of the Blinky application are describe in the Quantum Leaps Applicat
[![Application Note: Getting Started with QP&trade;](AN-getting_started.jpg)](https://www.state-machine.com/doc/AN_Getting_Started_with_QP.pdf)
<div style="clear:both;"></div>
@nav{gs_tut,tut_dpp}
*/
/*##########################################################################*/
/*! @page tut_dpp Dining Philosophers Problem (DPP)
@tableofcontents
@nav{tut_blinky,tut_game}
The Dining Philosophers Problem (DPP) example is an intermediate-level application with *multiple* active objects. It illustrates the following QP&trade; features, such as:
@ -224,11 +147,10 @@ The Dining Philosophers Problem (DPP) example is described in the @webref{doc/AN
[![Application Note: Dining Philosophers Problem (DPP) Example](AN_DPP.jpg)](https://www.state-machine.com/doc/AN_Fly-n-Shoot.pdf)
@note
There is also a DPP variant that implements the "Philosophers" as passive "Orthogonal Components" of the "Table" active object. That DPP version is located in <span class="img folder">qpc/examples/examples/workstation/dpp-comp/</span>
<br>
<div style="clear:both;"></div>
@nav{tut_blinky,tut_game}
*/
/*##########################################################################*/
@ -259,15 +181,14 @@ The "Fly 'n' Shoot" game example is described in the @webref{doc/AN_Fly-n-Shoot.
[!["Fly'n'Shoot" game tutorial video](game-video.jpg)](https://youtu.be/h_u92uLssDo)
<br>
<div style="clear:both;"></div>
@nav{tut_dpp,tut_low}
*/
/*##########################################################################*/
/*! @page tut_low Low-Power Example
@tableofcontents
@nav{tut_game,srs}
@nav{tut_game,exa}
The main principle of low-power design for software is to keep the hardware in the most appropriate low-power sleep mode for as long as possible. Most commonly, the software enters a low-power sleep mode from the **idle callback** (a.k.a. "idle hook"), which is called when the software has nothing left to do and is waiting for an interrupt to deliver more work. The QP/C and QP/C++ Real-Time Embedded Frameworks (RTEFs) support the *idle callback* in all of the built-in real-time kernels, such as the cooperative @ref qv "QV kernel", the preemptive non-blocking @ref qk "QK kernel" and the preemptive blocking @ref qxk "QXK kernel". Also, such an *idle callback* is provided in all 3rd-party traditional RTOS kernels that QP/C/C++ have been @ref ports_rtos "ported to".
The main principle of low-power design for software is to keep the hardware in the most appropriate low-power sleep mode for as long as possible. Most commonly, the software enters a low-power sleep mode from the **idle callback** (a.k.a. "idle hook"), which is called when the software has nothing left to do and is waiting for an interrupt to deliver more work. The QP/C and QP/C++ Real-Time Embedded Frameworks (RTEFs) support the *idle callback* in all of the built-in real-time kernels, such as the cooperative @ref srs_qv "QV kernel", the preemptive non-blocking @ref srs_qk "QK kernel" and the preemptive blocking @ref srs_qxk "QXK kernel". Also, such an *idle callback* is provided in all 3rd-party traditional RTOS kernels that QP/C/C++ have been @ref ports_rtos "ported to".
@remark
Design for low-power is a broad subject that requires a holistic system approach to achieve a really long battery-powered operation. This example covers only certain *software-related* aspects of the problem.
@ -299,7 +220,6 @@ The support for multiple static clock tick rates is much *simpler* than the "dyn
Yet the *multiple clock rates* can deliver similar low-power operation for the system, while keeping the QP framework much simpler and easier to certify than "tickless" kernels. The rest of this example explains how to use the multiple static clock rates in QP/C/C++ and shows how to leverage this feature to achieve low-power software design.
@section arm-cm_low_power_app The Low-Power Example Application
The low-power example is located in QP/C and QP/C++ distributions, in the directory with the following structure:
@ -398,7 +318,6 @@ The **Idle** callback turns the **slow tick rate-0** off. The system enters the
The **Idle** line (Red-LED) goes down twice as fast as the changes in the state of the **Green-LED** or the **Blue-LED**. This is because the application uses timeouts of **2 clock ticks** for toggling these lines instead of just one clock tick, which then could be slower. This is not quite optimal for the energy dissipation (as the CPU is woken up twice as often as it needs to be), but it illustrates more accurately how the fixed clock rates work as well as the one-tick delay to enter the low-power sleep mode from the idle callback.
@subsection arm-cm_low_power_sm State Machines
The versions of this low-power example for the **QK** and **QV** kernels use two active objects **Blinky0** and **Blinky1**, which toggle the **Green-LED** at the slow tick rate 0, and the **Blue-LED** at the fast tick rate 1, respectively. The state machines of the Blinky0 and Blinky1 active objects are shown below:
@ -415,11 +334,10 @@ Similarly, the **Blinky1** state machine, in the entry action to the "active" st
<div style="clear:both;"></div>
@subsection arm-cm_low_power_xt Extended Thread (QXK)
The version of this low-power example for the **QXK** kernel uses one active object **Blinky0** (with the state machine shown above), but instead of the Blinky1 active object, the QXK version uses an eXtended thread (::QXThread) called **XBlinky1**, with the code shown below:
@code{c}
@code{.c}
#include "qpc.h"
#include "low_power.h"
#include "bsp.h"
@ -475,7 +393,7 @@ The version of this low-power example for the **QXK** kernel uses one active obj
@subsection arm-cm_low_power_idle The Idle Callback (QK/QXK)
The most important functionality in this low-power example is implemented in the **idle callback** located in the BSP (Board Support Package). The idle callback QK_onIdle() for the preemptive QK kernel and the idle callback QXK_onIdle() for the QXK kernel are almost identical and are explained in this section.
@code{c}
@code{.c}
[0] void QXK_onIdle(void) {
[1] QF_INT_DISABLE();
@ -541,7 +459,7 @@ The most important functionality in this low-power example is implemented in the
@subsection arm-cm_low_power_idle-qv The Idle Callback (QV)
The idle callback QV_onIdle() for the cooperative QV kernel is slightly different, because it is called with interrupts **disabled**. The following listing shows the complete QV_onIdle() callback, with the most important points explained in the section below:
@code{c}
@code{.c}
[0] void QV_onIdle(void) { /* NOTE: called with interrupts DISABLED */
[1] if (((l_activeSet & (1U << SYSTICK_ACTIVE)) != 0U) /* rate-0 enabled? */
@ -579,7 +497,7 @@ The idle callback QV_onIdle() for the cooperative QV kernel is slightly differen
<dt>3</dt><dd> The QV_CPU_SLEEP() macro enters **low-power sleep mode** with interrupts still disabled. This port-specific macro is designed to re-anable interrupts **atomically** with entering the sleep mode.
</dd>
</dl>
<div style="clear:both;"></div>
@nav{tut_game,srs}
<div style="clear:both;"></div>
@nav{tut_game,exa}
*/

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 102 KiB

BIN
doxygen/img/cert-pack.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 920 B

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 965 B

After

Width:  |  Height:  |  Size: 705 B

View File

@ -7,6 +7,7 @@
<img src="logo_ql.png">
<img src="logo_github.png">
<img src="cert-pack.png">
<img src="splitbar.png">
<img src="AN.jpg">
<img src="AN_Coding_Standard.jpg">
@ -18,8 +19,6 @@
<img src="help_dark.png">
<img src="tree-view_linked.png">
<img src="tree-view_unlinked.png">
<img src="github-corner.png">
<img src="github-qp.png">
<img src="logo_qwin.jpg">
<img src="board.png">
<img src="checkboxoff.png">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1,75 +1,84 @@
/*! @mainpage About QP&trade;/C
/*! @mainpage Overview
@image html qp_banner.jpg
<a target="_blank" href="https://github.com/QuantumLeaps/qpc" title="QP&trade;/C on GitHub"><img style="float:right; clear:right;" src="img/github-corner.png"></a>
@section ab_new What's new?
@remark
<a target="_blank" href="https://github.com/QuantumLeaps/qpc" title="QP/C on GitHub"><img style="float:right; clear:right;" src="img/logo_github.png"></a>
To check what's new in QP&trade;/C, please see @ref history "QP/C Revision History". You can also get the latest **QP&trade;/C code**, with the recent enhancements and bug fixes, from the <a class="extern" target="_blank" href="https://github.com/QuantumLeaps/qpc"><strong>GitHub QP&trade;/C repository</strong></a>.
<div style="clear:both"></div>
@section ab_about What is it?
@webref{products/qp, <strong>QP&trade;/C (Quantum Platform in C)</strong>} is a lightweight @webref{rtef, Real-Time Embedded Framework (RTEF)} for building modern, responsive and modular real-time embedded applications as systems of asynchronous event-driven @webref{active-object, active objects} (<a href="https://en.wikipedia.org/wiki/Actor_model">actors</a>). The QP&trade;/C RTEF is a member of a @webref{products/qp, larger family of real-time embedded frameworks (RTEFs)} consisting of QP&trade;/C and QP&trade;/C++ frameworks, which are strictly quality controlled, thoroughly documented, and available under @ref licensing "dual licensing model".
@section over_about What is it?
<b>QP&trade;/C Real-Time Embedded Framework (RTEF)</b> is a lightweight implementation of the @webref{active-object, Active Object model of computation} specifically tailored for real-time embedded (RTE) systems. QP is both a software infrastructure for building applications consisting of Active Objects (actors) and a runtime environment for executing the Active Objects in a deterministic fashion. Additionally, QP Framework supports @webref{fsm#HSM, Hierarchical State Machines} with which to specify the behavior of Active Objects @ref srs_ref "[ROOM:94], [UML 2.5],[Sutter:10]".
The behavior of active objects is specified in QP&trade;/C by means of @webref{fsm/#HSM, <strong>hierarchical state machines</strong>} (UML statecharts). The framework supports @ref sm "manual coding of UML state machines in C" as well as automatic code generation by means of the free @webref{products/qm, <strong>QM&trade; model-based design tool</strong>}.
@attention
To use QP&trade;/C effectively, you need to understand the @webref{category/concepts, <strong>key concepts</strong>} that underline the architecture of the framework and your applications based on the framework.
@note
<a href="https://www.state-machine.com/products/qp#CERT" title="QP Cert-Pack"><img src="cert-pack.png" style="float:right; margin:0 20px 0 20px;"></img></a>
The @webref{products/qp#CERT,QP Certification Pack} provides:
- @ref srs "Software Requirements Specification" with a good @ref srs_over "overview" of the QP/C Framework
- @ref sas "Software Architecture Specification" with concise description of QP/C @ref sas_core "architecture"
- @ref sds "Software Design Specification" with detailed description of the QP/C @ref sds "design".
@section ab_goals What does it do?
The main goals of the QP&trade;/C framework are:
- to provide a reusable event-driven **architecture** based on @webref{active-object, active objects (actors)}, which is inherently **safer**, more extensible, and easier to understand than the usual *shared-state concurrency* based on a traditional Real-Time Operating System (RTOS).
- to provide a simple-to-use coding techniques for @webref{fsm/#HSM, hierarchical state machines}, with which to implement the behavior of active objects.
- to provide efficient and thread-safe asynchronous mechanisms for active objects to communicate, such as direct event passing and publish-subscribe.
- to provide event-driven timing services (time events).
- to provide a selection of built-in real-time kernels to run the QP applications, such as the cooperative @ref qv "QV kernel", the preemptive non-blocking @ref qk "QK kernel", and the preemptive blocking @ref qxk "QXK kernel".
- to provide testing support for applications based on software tracing (@ref qs "Q-Spy").
- to provide **unit testing** support for applications based on software tracing (@webref{qtools/qutest.html, <strong>QUTest&trade;</strong>}).
- to provide portability layer and ready-to-use ports to @ref ports_rtos "3rd-party RTOSes" and general purpose operating systems such as @ref posix "Linux" and @ref win32 "Windows".
- to provide a target for modeling and automatic code generation from the @webref{products/qm, <strong>QM&trade; modeling tool</strong>}.
@section over_goals What does it do?
The main objectives of the QP/C RTEF are:
- to provide a modern, event-driven model of concurrency based on the best practices of concurrent programming @ref srs_ref "[ROOM:94], [Cummings:10], [Sutter:10]", collectively known as the @webref{active-object, Active Object (Actor) model of computation}, which is inherently *safer* than the traditional "shared-state concurrency, mutual-exclusion, and blocking" approach based on a conventional Real-Time Operating System (RTOS);
- to provide a *higher-level of abstraction* closer to the problem domain than the "naked" RTOS threads;
- to provide the *right* abstractions for applying modern techniques like visual modeling, hierarchical state machines, and automatic code generation;
- to bridge the semantic gap between the higher level modeling concepts (such as UML) and the traditional programming languages like C or C++.
@section ab_special What's special about it?
@section over_special What's special about it?
The QP&trade;/C Real-Time Embedded Framework (RTEF) is a unique offering on the embedded software market. It provides a modern, reusable **architecture** of embedded applications, which combines object-orientation with the particular model of concurrency, known as @webref{active-object, <strong>active objects</strong>} (actors). This architecture is generally **safer**, more responsive and easier to understand than "free threading" with a traditional Real-Time Operating System (RTOS). It also provides sufficiently high level of abstraction and the right abstractions to effectively apply modeling and code generation to deeply embedded systems.
@subsection oop Object Orientation
Even though it is written in @ref misra "MISRA-compliant" ISO-C99, QP&trade;/C is fundamentally an **object-oriented** framework, which means that the framework itself and your applications derived from the framework are fundamentally composed of <a href="https://en.wikipedia.org/wiki/Class_(computer_programming)" target="_blank" class="extern">classes</a> and only classes can have @ref sm "state machines" associated with them.
@subsection over_oop Object Orientation
Even though it is written in @ref misra "MISRA-compliant" ISO-C99, QP&trade;/C is fundamentally an **object-oriented** framework, which means that the framework itself and your applications derived from the framework are fundamentally composed of @ref sas_core "classes" and only classes can have @ref srs_sm "state machines" associated with them.
@anchor oop
@note
If you program in C and object-oriented programming is new to you, please refer to the article and set of videos @webref{oop, "Object-Oriented Programming"}, which among others describes how you can implement the concepts of *classes*, *inheritance*, and *polymorphism* to portable ISO-C.
@webref{oop, ![Object-Oriented Programming in C](an-oop_in_c.jpg)}
@subsection hsms Hierarchical State Machines
The behavior of active objects is specified in QP&trade;/C by means of @webref{fsm/#HSM, hierarchical state machines (UML statecharts)}. The framework supports @ref sm "manual coding of UML state machines in C" (or C++ in case of QP&trade;/C++) as well as fully **automatic code generation** by means of the free graphical @webref{products/qm, QM&trade; model-based design (MBD) tool}.
@remarks
State machines can be an incredibly powerful technique, but they require an event-driven **infrastructure** (framework) that provides, at a minimum: a run-to-completion (RTC) execution context for each state machine, queuing of events, and event-based timing services. This is really the pivotal point. Without an event-driven framework (like QP&trade;/C), state machines are like @webref{rtef, cars without an infrastructure of roads}.
@subsection over_hsms Hierarchical State Machines
The behavior of active objects is specified in QP&trade;/C by means of @webref{fsm/#HSM, hierarchical state machines (UML statecharts)}. The framework supports manual coding of UML state machines in C as well as fully **automatic code generation** by means of the free graphical @webref{products/qm, QM&trade; model-based design (MBD) tool}.
@subsection kernels Built-in Kernels
The QP&trade;/C framework can run on @ref exa_native "bare-metal single-chip microcontrollers", completely replacing a traditional RTOS. The framework contains a selection of built-in real-time kernels, such as the cooperative @ref qv "QV kernel", the preemptive non-blocking @ref qk "QK kernel", and the preemptive, dual-mode, blocking @ref qxk "QXK kernel". The QXK kernel <span class="highlight">provides all the features you might expect from a traditional <strong>RTOS kernel</strong></span> and has been specifically designed for mixing event-driven active objects with traditional blocking code, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software. @ref ports_native "Native QP ports" and ready-to-use @ref exa_native "examples" are provided for major @ref exa_ref_mcu "CPU families".
@subsection over_kernels Built-in Kernels
The QP&trade;/C framework can run on @ref exa_native "bare-metal single-chip microcontrollers", completely replacing a traditional RTOS. The framework contains a selection of built-in real-time kernels, such as the cooperative @ref srs_qv "QV kernel", the preemptive non-blocking @ref srs_qk "QK kernel", and the preemptive, dual-mode, blocking @ref srs_qxk "QXK kernel". The QXK kernel <span class="highlight">provides all the features you might expect from a traditional <strong>RTOS kernel</strong></span> and has been specifically designed for mixing event-driven active objects with traditional blocking code, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software. @ref ports_native "Native QP ports" and ready-to-use @ref exa_native "examples" are provided for major @ref exa_ref_mcu "CPU families".
@subsection light_fast Lightweight and Fast
@subsection over_eff Efficiency
Even though QP&trade;/C offers much higher level of abstraction than a traditional RTOS, it typically outperforms equivalent traditional RTOS offerings both in RAM/ROM footprint and in CPU efficiency. The specific measurements and results are reported in the following @webref{doc/AN_QP_Performance.pdf, Application Note: "QP Performance Tests and Results"}:
[![Application Note: "QP Performance Tests and Results"](an-qp_performance.png)](https://www.state-machine.com/doc/AN_QP_Performance.pdf)
@subsection inter Interoperability
@subsection over_simple Simplicity
The QP Framework is simple to get started, simple to use and simple to build. The numerous provided @ref exa "examples" come with projects for typical embedded toolchains (e.g., GNU, ARM, IAR, etc.). The framework does not impose any proprietary build or configuring procedures or tooling, just simple makefiles and native projects for the demonstrated toolchains. While these are possibly inadequate for really complex projects, experience shows that bigger teams have their own DevOps (e.g., CI/CD) and imposing a particular process is typically counterproductive.
@subsection over_inter Interoperability
QP/C can also work with many traditional @ref exa_rtos "RTOSes" and @ref exa_os "general-purpose OSes" (such as Linux and Windows).
@subsection popular Popularity &amp; Maturity
@subsection over_trace Traceability
QP&trade;/C offers unprecedented, bidirectional @ref tr "traceability" among all work artifacts, which gives teams full visibility from requirements through architecture, design, source code, tests, and back again.
@subsection over_popular Popularity &amp; Maturity
With 20 years of continuous development, over @webref{customers#Customers, 350 commercial licensees}, and many times more open source users worldwide, the QP&trade; frameworks are the most popular such offering on the market. They power countless electronic products ranging from implantable medical devices to complex weapon systems.
@subsection use Widespread Use
@subsection over_use Widespread Use
The QP&trade; real-time embedded frameworks address high-reliability applications across a @webref{customers#Markets, wide variety of markets}, such as medical, consumer, IoT, defense, robotics, industrial, communication, transportation, semiconductor IP, and many others. In each of these application areas, the elegant software architecture and modern design philosophy of QP&trade; have distinct advantages.
@subsection psicc2 Books
The two editions of the book, @webref{psicc2, <strong>Practical Statecharts in C/C++</strong>} provide a detailed design study of the QP frameworks and explain the related concepts.
@subsection over_psicc2 Books
The two editions of the book, @webref{psicc2, <strong>Practical Statecharts in C/C++</strong>} provide a detailed design study of the QP&trade; frameworks and explain the related concepts.
[![Practical UML Statecharts in C/C++, 2nd Edition](psicc2.jpg)](https://www.state-machine.com/psicc2)
@ -77,22 +86,22 @@ The two editions of the book, @webref{psicc2, <strong>Practical Statecharts in C
[![Practical Statecharts in C/C++, 1nd Edition](psicc1.jpg)](https://www.state-machine.com/psicc)
@section licensing How is it licensed?
@section over_licensing How is it licensed?
QP&trade;/C is licensed under the sustainable @webref{licensing, dual licensing model}, in which both the open source software distribution mechanism and traditional closed source software distribution models are combined.
@note
If your company has a policy forbidding open source in your product, all QP frameworks can be @webref{licensing#Commercial, licensed commercially}, in which case you don't use any open source license and you do not violate your policy.
@subsection open-source Open Source Projects
@subsection over_open-source Open Source Projects
If you are developing and distributing **open source** applications under the GNU General Public License (GPL), as published by the Free Software Foundation, then you are free to use the Quantum Leaps software under the <a class="extern" target="_blank" href="https://www.gnu.org/copyleft/gpl.html">GPL version 3</a> of the License, or (at your option) any later version. Please note that GPL requires that all modifications to the original code as well as your application code (Derivative Works as defined in the Copyright Law) must also be released under the terms of the GPL open source license.
@subsection closed-source Closed Source Projects
@subsection over_closed-source Closed Source Projects
If you are developing and distributing traditional **closed source** applications, you can purchase one of @webref{licensing/#Commercial, Quantum Leaps commercial licenses}, which are specifically designed for users interested in retaining the proprietary status of their code. All Quantum Leaps commercial licenses expressly supersede the GPL open source license. This means that when you license Quantum Leaps software under a commercial license, you specifically do not use the software under the open source license and therefore you are not subject to any of its terms.
@section support How to get help?
@section over_support How to get help?
Please post any **technical questions** to the <a class="extern" target="_blank" href="https://sourceforge.net/p/qpc/discussion/668726"><strong>Free Support Forum</strong></a> hosted on SourceForge.net. Posts to this forum benefit the whole community and are typically answered the same day.
Direct **Commercial Support** is available to the commercial licensees. Every commercial license includes one year of Technical Support for the licensed software. The support term can be extended annually.
@ -103,15 +112,12 @@ Training and consulting services are also available from Quantum Leaps. Please r
The features of this online help and tips for using it are described in Section @ref help.
@section contact Contact Information
@section over_contact Contact Information
- Quantum Leaps Web site: @webref{,state-machine.com}
- Quantum Leaps licensing: @webref{licensing, state-machine.com/licensing}
- QP/QM on GitHub: <a class="extern" target="_blank" href="https://github.com/QuantumLeaps">github.com/QuantumLeaps</a>
- Quantum Leaps on GitHub: <a class="extern" target="_blank" href="https://github.com/QuantumLeaps">github.com/QuantumLeaps</a>
- e-mail: <a class="extern" target="_blank" href="mailto:info@state-machine.com">info@state-machine.com</a>
<br>
@next{gs}
*/

View File

@ -49,15 +49,15 @@
@set METRICS_INP=%QPC%\include %QPC%\src -x %QPC%\src\qs\*
@set METRICS_OUT=metrics.dox
@echo /** @page metrics Code Metrics > %METRICS_OUT%
@echo /** @defgroup metrics Code Metrics> %METRICS_OUT%
@echo.>> %METRICS_OUT%
@echo @code{cpp} >> %METRICS_OUT%
@echo Code Metrics >> %METRICS_OUT%
@echo @code{.cpp}>> %METRICS_OUT%
@echo QP/C Code Metrics >> %METRICS_OUT%
%LIZARD% -m -L500 -a10 -C20 -V %METRICS_INP% >> %METRICS_OUT%
@echo @endcode >> %METRICS_OUT%
@echo */ >> %METRICS_OUT%
@echo @endcode>> %METRICS_OUT%
@echo */>> %METRICS_OUT%
:: Generate Doxygen Documentation...
if "%1"=="-CHM" (

View File

@ -1,190 +1,175 @@
/** @page metrics Code Metrics
/** @defgroup metrics Code Metrics
@code{cpp}
Code Metrics
@code{.cpp}
QP/C Code Metrics
================================================
NLOC CCN token PARAM length location
------------------------------------------------
3 1 19 1 3 QHsm_state@379-381@..\include\qep.h
3 1 16 1 3 QMsm_stateObj@470-472@..\include\qep.h
3 1 14 1 3 QEQueue_getNFree@186-188@..\include\qequeue.h
3 1 14 1 3 QEQueue_getNMin@201-203@..\include\qequeue.h
3 1 20 1 3 QEQueue_isEmpty@218-220@..\include\qequeue.h
3 1 15 1 3 QPSet_setEmpty@71-73@..\include\qpset.h
3 1 16 1 3 QPSet_isEmpty@76-78@..\include\qpset.h
3 1 16 1 3 QPSet_notEmpty@81-83@..\include\qpset.h
3 1 36 2 3 QPSet_hasElement@86-88@..\include\qpset.h
3 1 31 2 3 QPSet_insert@91-93@..\include\qpset.h
3 1 36 2 3 QPSet_remove@96-98@..\include\qpset.h
3 1 17 1 3 QPSet_findMax@103-105@..\include\qpset.h
4 1 27 1 4 QPSet_setEmpty@120-123@..\include\qpset.h
5 2 34 1 6 QPSet_isEmpty@126-131@..\include\qpset.h
5 2 34 1 6 QPSet_notEmpty@134-139@..\include\qpset.h
5 2 74 2 5 QPSet_hasElement@142-146@..\include\qpset.h
8 2 66 2 8 QPSet_insert@149-156@..\include\qpset.h
8 2 76 2 8 QPSet_remove@159-166@..\include\qpset.h
5 2 45 1 5 QPSet_findMax@171-175@..\include\qpset.h
6 1 23 1 15 Q_DEFINE_THIS_MODULE@45-59@..\src\qf\qep_hsm.c
5 1 31 3 5 QHsm_trig_@77-81@..\src\qf\qep_hsm.c
10 2 56 2 12 QHsm_ctor@142-153@..\src\qf\qep_hsm.c
48 8 357 2 73 QHsm_init_@173-245@..\src\qf\qep_hsm.c
5 1 32 2 5 QHsm_top@265-269@..\src\qf\qep_hsm.c
104 15 670 2 157 QHsm_dispatch_@292-448@..\src\qf\qep_hsm.c
95 15 500 2 133 QHsm_tran_@472-604@..\src\qf\qep_hsm.c
3 1 16 1 3 QHsm_getStateHandler_@608-610@..\src\qf\qep_hsm.c
16 3 107 2 23 QHsm_isIn@630-652@..\src\qf\qep_hsm.c
22 4 131 2 30 QHsm_childState@678-707@..\src\qf\qep_hsm.c
10 2 59 2 13 QMsm_ctor@115-127@..\src\qf\qep_msm.c
24 5 211 2 44 QMsm_init_@146-189@..\src\qf\qep_msm.c
122 23 847 2 185 QMsm_dispatch_@210-394@..\src\qf\qep_msm.c
3 1 18 1 3 QMsm_getStateHandler_@398-400@..\src\qf\qep_msm.c
52 9 328 2 65 QMsm_execTatbl_@425-489@..\src\qf\qep_msm.c
20 4 120 3 28 QMsm_exitToTranSource_@509-536@..\src\qf\qep_msm.c
41 6 236 2 50 QMsm_enterHistory_@557-606@..\src\qf\qep_msm.c
13 3 69 2 14 QMsm_isInState@624-637@..\src\qf\qep_msm.c
21 4 97 2 27 QMsm_childStateObj@658-684@..\src\qf\qep_msm.c
10 3 65 1 16 QF_add_@66-81@..\src\qf\qf_act.c
10 3 79 1 15 QF_remove_@99-113@..\src\qf\qf_act.c
7 2 46 2 7 QF_bzero@130-136@..\src\qf\qf_act.c
24 6 143 1 29 QF_LOG2@143-171@..\src\qf\qf_act.c
79 13 422 3 115 QActive_post_@88-202@..\src\qf\qf_actq.c
42 7 268 2 65 QActive_postLIFO_@223-287@..\src\qf\qf_actq.c
34 3 235 1 45 QActive_get_@312-356@..\src\qf\qf_actq.c
9 2 60 1 12 QF_getQueueMin@378-389@..\src\qf\qf_actq.c
14 2 78 2 18 QTicker_ctor@421-438@..\src\qf\qf_actq.c
7 2 39 2 10 QTicker_init_@445-454@..\src\qf\qf_actq.c
14 3 87 2 20 QTicker_dispatch_@461-480@..\src\qf\qf_actq.c
27 2 150 4 35 QTicker_post_@487-521@..\src\qf\qf_actq.c
5 1 30 2 5 QTicker_postLIFO_@524-528@..\src\qf\qf_actq.c
14 1 84 3 16 QActive_defer@72-87@..\src\qf\qf_defer.c
32 3 169 2 52 QActive_recall@112-163@..\src\qf\qf_defer.c
13 2 68 2 13 QActive_flushDeferred@182-194@..\src\qf\qf_defer.c
5 1 37 2 6 QEvt_ctor@63-68@..\src\qf\qf_dyn.c
15 3 117 3 24 QF_poolInit@108-131@..\src\qf\qf_dyn.c
37 7 234 3 55 QF_newX_@161-215@..\src\qf\qf_dyn.c
30 4 186 1 47 QF_gc@242-288@..\src\qf\qf_dyn.c
16 2 94 2 24 QF_newRef_@306-329@..\src\qf\qf_dyn.c
11 1 67 1 13 QF_deleteRef_@343-355@..\src\qf\qf_dyn.c
3 1 17 1 3 QF_poolGetMaxBlockSize@363-365@..\src\qf\qf_dyn.c
30 5 235 4 48 QMPool_init@83-130@..\src\qf\qf_mem.c
16 2 113 3 23 QMPool_put@155-177@..\src\qf\qf_mem.c
43 4 238 3 66 QMPool_get@213-278@..\src\qf\qf_mem.c
9 3 59 1 13 QF_getPoolMin@294-306@..\src\qf\qf_mem.c
5 1 35 2 10 QF_psInit@85-94@..\src\qf\qf_ps.c
37 5 211 3 64 QF_publish_@120-183@..\src\qf\qf_ps.c
16 5 113 2 22 QActive_subscribe@205-226@..\src\qf\qf_ps.c
16 5 113 2 25 QActive_unsubscribe@254-278@..\src\qf\qf_ps.c
19 5 134 1 24 QActive_unsubscribeAll@304-327@..\src\qf\qf_ps.c
14 2 71 2 21 QActive_ctor@60-80@..\src\qf\qf_qact.c
13 2 85 3 13 QEQueue_init@65-77@..\src\qf\qf_qeq.c
55 8 303 4 74 QEQueue_post@104-177@..\src\qf\qf_qeq.c
35 5 201 3 45 QEQueue_postLIFO@203-247@..\src\qf\qf_qeq.c
36 4 221 2 46 QEQueue_get@269-314@..\src\qf\qf_qeq.c
14 2 78 2 32 QMActive_ctor@68-99@..\src\qf\qf_qmact.c
66 7 368 1 98 QF_tickX_@89-186@..\src\qf\qf_time.c
14 3 75 1 17 QF_noTimeEvtsActiveX@203-219@..\src\qf\qf_time.c
13 2 99 4 30 QTimeEvt_ctorX@240-269@..\src\qf\qf_time.c
32 8 225 3 58 QTimeEvt_armX@302-359@..\src\qf\qf_time.c
31 3 173 1 41 QTimeEvt_disarm@381-421@..\src\qf\qf_time.c
34 8 230 2 62 QTimeEvt_rearm@445-506@..\src\qf\qf_time.c
5 1 36 1 5 QTimeEvt_wasDisarmed@531-535@..\src\qf\qf_time.c
7 1 30 1 8 QTimeEvt_currCtr@554-561@..\src\qf\qf_time.c
11 2 76 1 16 QF_init@65-80@..\src\qk\qk.c
3 1 10 1 4 QF_stop@99-102@..\src\qk\qk.c
6 2 26 1 8 initial_events@107-114@..\src\qk\qk.c
12 3 45 1 19 QF_run@125-143@..\src\qk\qk.c
21 5 144 7 31 QActive_start_@167-197@..\src\qk\qk.c
22 2 111 1 33 QK_schedLock@221-253@..\src\qk\qk.c
21 4 123 1 33 QK_schedUnlock@271-303@..\src\qk\qk.c
14 3 76 1 17 QK_sched_@320-336@..\src\qk\qk.c
61 16 353 1 105 QK_activate_@348-452@..\src\qk\qk.c
9 2 64 1 13 QF_init@66-78@..\src\qv\qv.c
3 1 10 1 4 QF_stop@97-100@..\src\qv\qv.c
39 9 197 1 76 QF_run@110-185@..\src\qv\qv.c
14 3 114 7 20 QActive_start_@209-228@..\src\qv\qv.c
14 2 108 1 22 QF_init@68-89@..\src\qxk\qxk.c
3 1 10 1 4 QF_stop@108-111@..\src\qxk\qxk.c
6 2 26 1 8 initial_events@116-123@..\src\qxk\qxk.c
12 3 45 1 20 QF_run@133-152@..\src\qxk\qxk.c
23 6 164 7 33 QActive_start_@177-209@..\src\qxk\qxk.c
23 3 130 1 34 QXK_schedLock@241-274@..\src\qxk\qxk.c
20 4 123 1 33 QXK_schedUnlock@297-329@..\src\qxk\qxk.c
47 7 268 1 65 QXK_sched_@345-409@..\src\qxk\qxk.c
73 16 474 1 128 QXK_activate_@421-548@..\src\qxk\qxk.c
12 2 72 1 18 QXK_current@551-568@..\src\qxk\qxk.c
16 4 113 2 25 QXMutex_init@80-104@..\src\qxk\qxk_mutex.c
69 12 542 2 110 QXMutex_lock@127-236@..\src\qxk\qxk_mutex.c
43 10 315 1 67 QXMutex_tryLock@259-325@..\src\qxk\qxk_mutex.c
64 16 502 1 111 QXMutex_unlock@347-457@..\src\qxk\qxk_mutex.c
8 1 49 3 10 QXSemaphore_init@72-81@..\src\qxk\qxk_sema.c
43 7 321 2 69 QXSemaphore_wait@107-175@..\src\qxk\qxk_sema.c
15 2 61 1 20 QXSemaphore_tryWait@192-211@..\src\qxk\qxk_sema.c
28 6 195 1 46 QXSemaphore_signal@233-278@..\src\qxk\qxk_sema.c
20 2 112 3 25 QXThread_ctor@105-129@..\src\qxk\qxk_xthr.c
8 2 38 3 11 QXThread_init_@136-146@..\src\qxk\qxk_xthr.c
8 2 38 3 11 QXThread_dispatch_@152-162@..\src\qxk\qxk_xthr.c
25 6 202 7 47 QXThread_start_@189-235@..\src\qxk\qxk_xthr.c
97 13 519 3 131 QXThread_post_@280-410@..\src\qxk\qxk_xthr.c
5 1 30 2 5 QXThread_postLIFO_@423-427@..\src\qxk\qxk_xthr.c
58 7 497 1 84 QXThread_queueGet@449-532@..\src\qxk\qxk_xthr.c
5 1 51 1 7 QXThread_block_@542-548@..\src\qxk\qxk_xthr.c
8 3 58 1 8 QXThread_unblock_@558-565@..\src\qxk\qxk_xthr.c
19 3 153 3 37 QXThread_teArm_@576-612@..\src\qxk\qxk_xthr.c
11 2 46 1 13 QXThread_teDisarm_@622-634@..\src\qxk\qxk_xthr.c
21 4 195 1 38 QXThread_delay@650-687@..\src\qxk\qxk_xthr.c
14 2 68 1 16 QXThread_delayCancel@699-714@..\src\qxk\qxk_xthr.c
13 2 106 1 23 QXK_threadRet_@727-749@..\src\qxk\qxk_xthr.c
37 file analyzed.
3 1 15 1 3 QEQueue_getNFree@310-312@..\include\qequeue.h
3 1 15 1 3 QEQueue_getNMin@327-329@..\include\qequeue.h
3 1 21 1 3 QEQueue_isEmpty@346-348@..\include\qequeue.h
5 2 33 1 8 QPSet_setEmpty@194-201@..\include\qf.h
4 3 44 1 7 QPSet_isEmpty@204-210@..\include\qf.h
4 3 44 1 7 QPSet_notEmpty@213-219@..\include\qf.h
8 3 95 2 11 QPSet_hasElement@222-232@..\include\qf.h
11 3 105 2 14 QPSet_insert@235-248@..\include\qf.h
12 3 117 2 15 QPSet_remove@251-265@..\include\qf.h
6 3 56 1 9 QPSet_findMax@268-276@..\include\qf.h
3 1 18 1 3 QActive_getPrio@735-737@..\include\qf.h
5 1 22 2 5 QActive_setPrio@742-746@..\include\qf.h
6 1 20 2 6 QF_psInit@1368-1373@..\include\qf.h
14 3 67 1 14 QS_rxPut@810-823@..\include\qs.h
5 1 20 1 20 Q_DEFINE_THIS_MODULE@58-77@..\src\qf\qep_hsm.c
18 3 99 2 24 QHsm_isIn@132-155@..\src\qf\qep_hsm.c
3 1 19 1 3 QHsm_state@158-160@..\src\qf\qep_hsm.c
22 4 123 2 31 QHsm_childState@163-193@..\src\qf\qep_hsm.c
12 2 56 2 14 QHsm_ctor@196-209@..\src\qf\qep_hsm.c
7 1 29 2 7 QHsm_top@212-218@..\src\qf\qep_hsm.c
51 8 352 3 77 QHsm_init_@221-297@..\src\qf\qep_hsm.c
105 15 636 3 156 QHsm_dispatch_@300-455@..\src\qf\qep_hsm.c
3 1 16 1 3 QHsm_getStateHandler_@459-461@..\src\qf\qep_hsm.c
97 15 471 3 135 QHsm_tran_@465-599@..\src\qf\qep_hsm.c
15 3 69 2 16 QMsm_isInState@85-100@..\src\qf\qep_msm.c
3 1 17 1 3 QMsm_stateObj@103-105@..\src\qf\qep_msm.c
22 4 97 2 29 QMsm_childStateObj@108-136@..\src\qf\qep_msm.c
12 2 59 2 15 QMsm_ctor@139-153@..\src\qf\qep_msm.c
27 4 202 3 45 QMsm_init_@156-200@..\src\qf\qep_msm.c
117 19 728 3 168 QMsm_dispatch_@203-370@..\src\qf\qep_msm.c
3 1 18 1 3 QMsm_getStateHandler_@374-376@..\src\qf\qep_msm.c
55 9 316 3 68 QMsm_execTatbl_@380-447@..\src\qf\qep_msm.c
24 4 130 4 32 QMsm_exitToTranSource_@450-481@..\src\qf\qep_msm.c
45 6 243 3 54 QMsm_enterHistory_@484-537@..\src\qf\qep_msm.c
82 13 431 4 118 QActive_post_@74-191@..\src\qf\qf_actq.c
44 7 266 2 66 QActive_postLIFO_@196-261@..\src\qf\qf_actq.c
34 3 233 1 44 QActive_get_@266-309@..\src\qf\qf_actq.c
10 2 60 1 11 QF_getQueueMin@315-325@..\src\qf\qf_actq.c
16 2 79 2 20 QTicker_ctor@344-363@..\src\qf\qf_actq.c
10 1 45 3 11 QTicker_init_@366-376@..\src\qf\qf_actq.c
17 2 92 3 20 QTicker_dispatch_@379-398@..\src\qf\qf_actq.c
30 2 156 4 37 QTicker_post_@401-437@..\src\qf\qf_actq.c
8 1 30 2 9 QTicker_postLIFO_@440-448@..\src\qf\qf_actq.c
15 1 84 3 17 QActive_defer@69-85@..\src\qf\qf_defer.c
34 3 169 2 54 QActive_recall@90-143@..\src\qf\qf_defer.c
13 2 68 2 13 QActive_flushDeferred@148-160@..\src\qf\qf_defer.c
17 3 116 3 26 QF_poolInit@76-101@..\src\qf\qf_dyn.c
3 1 17 1 3 QF_poolGetMaxBlockSize@104-106@..\src\qf\qf_dyn.c
9 3 59 1 12 QF_getPoolMin@109-120@..\src\qf\qf_dyn.c
39 7 234 3 57 QF_newX_@123-179@..\src\qf\qf_dyn.c
30 4 186 1 46 QF_gc@182-227@..\src\qf\qf_dyn.c
19 2 94 2 26 QF_newRef_@230-255@..\src\qf\qf_dyn.c
11 1 67 1 13 QF_deleteRef_@258-270@..\src\qf\qf_dyn.c
32 5 233 4 50 QMPool_init@71-120@..\src\qf\qf_mem.c
44 4 238 3 67 QMPool_get@123-189@..\src\qf\qf_mem.c
19 2 114 3 26 QMPool_put@192-217@..\src\qf\qf_mem.c
8 1 35 2 13 QActive_psInit@77-89@..\src\qf\qf_ps.c
41 5 220 3 68 QActive_publish_@94-161@..\src\qf\qf_ps.c
18 5 111 2 24 QActive_subscribe@166-189@..\src\qf\qf_ps.c
18 5 111 2 27 QActive_unsubscribe@194-220@..\src\qf\qf_ps.c
19 5 130 1 24 QActive_unsubscribeAll@225-248@..\src\qf\qf_ps.c
10 2 46 2 10 QF_bzero@88-97@..\src\qf\qf_qact.c
16 2 72 2 23 QActive_ctor@104-126@..\src\qf\qf_qact.c
10 3 66 1 16 QActive_register_@131-146@..\src\qf\qf_qact.c
10 3 79 1 15 QActive_unregister_@151-165@..\src\qf\qf_qact.c
24 6 143 1 29 QF_LOG2@173-201@..\src\qf\qf_qact.c
14 2 85 3 14 QEQueue_init@71-84@..\src\qf\qf_qeq.c
57 8 301 4 76 QEQueue_post@87-162@..\src\qf\qf_qeq.c
36 5 199 3 46 QEQueue_postLIFO@165-210@..\src\qf\qf_qeq.c
38 4 219 2 48 QEQueue_get@213-260@..\src\qf\qf_qeq.c
16 2 79 2 34 QMActive_ctor@78-111@..\src\qf\qf_qmact.c
15 2 99 4 32 QTimeEvt_ctorX@82-113@..\src\qf\qf_time.c
33 8 225 3 59 QTimeEvt_armX@116-174@..\src\qf\qf_time.c
31 3 173 1 41 QTimeEvt_disarm@177-217@..\src\qf\qf_time.c
36 8 230 2 64 QTimeEvt_rearm@220-283@..\src\qf\qf_time.c
5 1 36 1 5 QTimeEvt_wasDisarmed@286-290@..\src\qf\qf_time.c
7 1 30 1 8 QTimeEvt_currCtr@293-300@..\src\qf\qf_time.c
69 7 380 2 110 QTimeEvt_tick_@303-412@..\src\qf\qf_time.c
14 3 75 1 16 QTimeEvt_noActive@415-430@..\src\qf\qf_time.c
61 16 348 1 106 QK_activate_@78-183@..\src\qk\qk.c
14 3 74 1 17 QK_sched_@186-202@..\src\qk\qk.c
22 2 112 1 33 QK_schedLock@205-237@..\src\qk\qk.c
21 4 124 1 33 QK_schedUnlock@240-272@..\src\qk\qk.c
11 2 77 1 16 QF_init@277-292@..\src\qk\qk.c
3 1 10 1 4 QF_stop@295-298@..\src\qk\qk.c
15 4 61 1 25 QF_run@301-325@..\src\qk\qk.c
24 5 145 7 34 QActive_start_@332-365@..\src\qk\qk.c
9 2 64 1 13 QF_init@77-89@..\src\qv\qv.c
3 1 10 1 4 QF_stop@92-95@..\src\qv\qv.c
39 9 197 1 76 QF_run@98-173@..\src\qv\qv.c
17 3 115 7 23 QActive_start_@180-202@..\src\qv\qv.c
74 16 467 1 129 QXK_activate_@78-206@..\src\qxk\qxk.c
47 7 264 1 65 QXK_sched_@209-273@..\src\qxk\qxk.c
23 3 131 1 34 QXK_schedLock@276-309@..\src\qxk\qxk.c
20 4 124 1 33 QXK_schedUnlock@312-344@..\src\qxk\qxk.c
12 2 72 1 18 QXK_current@347-364@..\src\qxk\qxk.c
13 2 106 1 21 QF_init@369-389@..\src\qxk\qxk.c
3 1 10 1 4 QF_stop@392-395@..\src\qxk\qxk.c
15 4 61 1 25 QF_run@398-422@..\src\qxk\qxk.c
26 6 165 7 36 QActive_start_@429-464@..\src\qxk\qxk.c
13 2 104 1 23 QXK_threadExit_@470-492@..\src\qxk\qxk.c
18 4 114 2 27 QXMutex_init@78-104@..\src\qxk\qxk_mutex.c
67 12 536 2 108 QXMutex_lock@107-214@..\src\qxk\qxk_mutex.c
43 10 311 1 67 QXMutex_tryLock@217-283@..\src\qxk\qxk_mutex.c
63 16 496 1 110 QXMutex_unlock@286-395@..\src\qxk\qxk_mutex.c
9 1 51 3 11 QXSemaphore_init@77-87@..\src\qxk\qxk_sema.c
45 7 319 2 71 QXSemaphore_wait@90-160@..\src\qxk\qxk_sema.c
15 2 61 1 20 QXSemaphore_tryWait@163-182@..\src\qxk\qxk_sema.c
29 6 193 1 47 QXSemaphore_signal@185-231@..\src\qxk\qxk_sema.c
21 2 113 3 26 QXThread_ctor@78-103@..\src\qxk\qxk_xthr.c
21 4 195 1 38 QXThread_delay@106-143@..\src\qxk\qxk_xthr.c
14 2 68 1 16 QXThread_delayCancel@146-161@..\src\qxk\qxk_xthr.c
58 7 493 1 85 QXThread_queueGet@164-248@..\src\qxk\qxk_xthr.c
10 1 39 3 11 QXThread_init_@251-261@..\src\qxk\qxk_xthr.c
10 1 39 3 11 QXThread_dispatch_@264-274@..\src\qxk\qxk_xthr.c
29 6 201 7 50 QXThread_start_@277-326@..\src\qxk\qxk_xthr.c
101 13 527 4 136 QXThread_post_@329-464@..\src\qxk\qxk_xthr.c
8 1 30 2 9 QXThread_postLIFO_@467-475@..\src\qxk\qxk_xthr.c
5 1 49 1 7 QXThread_block_@478-484@..\src\qxk\qxk_xthr.c
8 3 56 1 8 QXThread_unblock_@487-494@..\src\qxk\qxk_xthr.c
20 3 157 3 39 QXThread_teArm_@497-535@..\src\qxk\qxk_xthr.c
11 2 46 1 13 QXThread_teDisarm_@538-550@..\src\qxk\qxk_xthr.c
33 file analyzed.
==============================================================
NLOC Avg.NLOC AvgCCN Avg.token function_cnt file
--------------------------------------------------------------
4 0.0 0.0 0.0 0 ..\include\qassert.h
108 3.0 1.0 17.5 2 ..\include\qep.h
28 3.0 1.0 16.0 3 ..\include\qequeue.h
93 0.0 0.0 0.0 0 ..\include\qf.h
20 0.0 0.0 0.0 0 ..\include\qk.h
21 0.0 0.0 0.0 0 ..\include\qmpool.h
7 0.0 0.0 0.0 0 ..\include\qassert.h
124 0.0 0.0 0.0 0 ..\include\qep.h
33 3.0 1.0 17.0 3 ..\include\qequeue.h
229 6.4 2.3 55.4 10 ..\include\qf.h
9 0.0 0.0 0.0 0 ..\include\qf_pkg.h
18 0.0 0.0 0.0 0 ..\include\qk.h
25 0.0 0.0 0.0 0 ..\include\qmpool.h
8 0.0 0.0 0.0 0 ..\include\qpc.h
71 4.4 1.4 37.4 14 ..\include\qpset.h
238 0.0 0.0 0.0 0 ..\include\qs.h
344 14.0 3.0 67.0 1 ..\include\qs.h
3 0.0 0.0 0.0 0 ..\include\qstamp.c
2 0.0 0.0 0.0 0 ..\include\qstamp.h
0 0.0 0.0 0.0 0 ..\include\qs_dummy.h
9 0.0 0.0 0.0 0 ..\include\quit.h
5 0.0 0.0 0.0 0 ..\include\qv.h
23 0.0 0.0 0.0 0 ..\include\qxk.h
32 0.0 0.0 0.0 0 ..\include\qxthread.h
337 31.4 5.1 192.3 10 ..\src\qf\qep_hsm.c
346 34.0 6.3 220.6 9 ..\src\qf\qep_msm.c
59 12.8 3.5 83.2 4 ..\src\qf\qf_act.c
257 25.7 3.9 152.1 9 ..\src\qf\qf_actq.c
66 19.7 2.0 107.0 3 ..\src\qf\qf_defer.c
126 16.7 2.7 107.4 7 ..\src\qf\qf_dyn.c
105 24.5 3.5 161.2 4 ..\src\qf\qf_mem.c
103 18.6 4.2 121.2 5 ..\src\qf\qf_ps.c
16 14.0 2.0 71.0 1 ..\src\qf\qf_qact.c
146 34.8 4.8 202.5 4 ..\src\qf\qf_qeq.c
16 14.0 2.0 78.0 1 ..\src\qf\qf_qmact.c
211 25.2 4.1 154.5 8 ..\src\qf\qf_time.c
180 19.0 4.2 107.1 9 ..\src\qk\qk.c
73 16.2 3.8 96.2 4 ..\src\qv\qv.c
243 23.3 4.6 142.0 10 ..\src\qxk\qxk.c
199 48.0 10.5 368.0 4 ..\src\qxk\qxk_mutex.c
101 23.5 4.0 156.5 4 ..\src\qxk\qxk_sema.c
339 22.3 3.6 150.9 14 ..\src\qxk\qxk_xthr.c
19 0.0 0.0 0.0 0 ..\src\qf_pkg.h
30 0.0 0.0 0.0 0 ..\src\qs_pkg.h
16 0.0 0.0 0.0 0 ..\src\qxk_pkg.h
19 0.0 0.0 0.0 0 ..\include\qs_pkg.h
7 0.0 0.0 0.0 0 ..\include\qv.h
97 0.0 0.0 0.0 0 ..\include\qxk.h
334 32.3 5.1 182.1 10 ..\src\qf\qep_hsm.c
336 32.3 5.3 187.9 10 ..\src\qf\qep_msm.c
2 0.0 0.0 0.0 0 ..\src\qf\qf_act.c
258 27.9 3.7 154.7 9 ..\src\qf\qf_actq.c
69 20.7 2.0 107.0 3 ..\src\qf\qf_defer.c
135 18.3 3.0 110.4 7 ..\src\qf\qf_dyn.c
102 31.7 3.7 195.0 3 ..\src\qf\qf_mem.c
113 20.8 4.2 121.4 5 ..\src\qf\qf_ps.c
79 14.0 3.2 81.2 5 ..\src\qf\qf_qact.c
152 36.2 4.8 201.0 4 ..\src\qf\qf_qeq.c
18 16.0 2.0 79.0 1 ..\src\qf\qf_qmact.c
218 26.2 4.1 156.0 8 ..\src\qf\qf_time.c
179 21.4 4.6 118.9 8 ..\src\qk\qk.c
75 17.0 3.8 96.5 4 ..\src\qv\qv.c
254 24.6 4.7 150.4 10 ..\src\qxk\qxk.c
198 47.8 10.5 364.2 4 ..\src\qxk\qxk_mutex.c
105 24.5 4.0 156.0 4 ..\src\qxk\qxk_sema.c
324 24.3 3.5 154.8 13 ..\src\qxk\qxk_xthr.c
=========================================================================================================
!!!! Warnings (cyclomatic_complexity > 20 or length > 500 or nloc > 1000000 or parameter_count > 10) !!!!
================================================
NLOC CCN token PARAM length location
------------------------------------------------
122 23 847 2 185 QMsm_dispatch_@210-394@..\src\qf\qep_msm.c
=============================================================================================================
No thresholds exceeded (cyclomatic_complexity > 20 or length > 500 or nloc > 1000000 or parameter_count > 10)
==========================================================================================
Total nloc Avg.NLOC AvgCCN Avg.token Fun Cnt Warning cnt Fun Rt nloc Rt
------------------------------------------------------------------------------------------
3653 21.6 3.9 137.3 129 1 0.01 0.04
3876 23.8 4.1 143.6 122 0 0.00 0.00
@endcode
*/

271
doxygen/modules-unused.dox Normal file
View File

@ -0,0 +1,271 @@
/*! @defgroup qp QP
@brief
QP Framework
*/
/*##########################################################################*/
/*! @defgroup qep QEP
@brief
Hierarchical Event Processor
QEP is a universal, UML-compliant event processor that enables developers to code UML state machines in highly readable ANSI-C, in which every state machine element is mapped to code precisely, unambiguously, and exactly once (traceability). QEP fully supports hierarchical state nesting, which is the fundamental mechanism for reusing behavior across many states instead of repeating the same actions and transitions over and over again.
*/
/*##########################################################################*/
/*! @defgroup qf QF
@brief
Active Object (Actor) Framework
QF is a portable, event-driven, real-time framework for execution of active objects (concurrent state machines) specifically designed for real-time embedded (RTE) systems.
*/
/*##########################################################################*/
/*! @defgroup qs QS
@brief
Software Tracing Instrumentation
QS is software tracing system that enables developers to monitor live QP applications with minimal target system resources and without stopping or significantly slowing down the code. QS is an ideal tool for testing, troubleshooting, and optimizing QP applications. QS can even be used to support acceptance testing in product manufacturing. Please see <a href="https://www.state-machine.com/qtools/qs.html"><b>QS Manual</b></a> inside the <a href="https://www.state-machine.com/qtools" target="_blank" class="extern">QTools collection</a> for more information.
*/
/*##########################################################################*/
/*! @defgroup qv QV
@brief
Cooperative Kernel
@description
QV is a simple **cooperative** kernel (previously called "Vanilla" kernel). This kernel executes active objects one at a time, with priority-based scheduling performed before processing of each event. Due to naturally short duration of event processing in state machines, the simple QV kernel is often adequate for many real-time systems.
@note
The QV scheduler is described in Section 6.3.7 of the book ["Practical UML Statecharts in C/C++, 2nd Ed" (PSiCC2)](https://www.state-machine.com/psicc2/).
@section qv_overview QV Overview
The QV scheduler is engaged after every RTC step of any active object to choose the next active object to execute. The QV scheduler always chooses the highest-priority active object that has any events in its event queue. The QV scheduler then extracts the next event from this queue and dispatches it to the state machine associated with the active object. The state machine runs to completion, after which the QV scheduler runs and the cycle repeats.
![QV scheduler operation](qv.gif)
Please note that because the state machines always return to the QV scheduler after each RTC step, a single stack can be used to process all state machines (memory-friendly architecture).
The QV scheduler can also very easily detect when all event queues are empty, at which point it can call the idle callback to let the application put the CPU and peripherals to a **low-power sleep mode** (power-friendly architecture).
Given the simplicity, portability, and low-resource consumption, the QV scheduler is very attractive. It allows you to partition the problem into active objects and execute these active objects orderly. The thread-level response of this scheduler is the longest RTC step in the whole system, but because event-driven active objects dont block, the RTC steps tend to be very short (typically just a few microseconds). Also, often you can break up longer RTC steps into shorter pieces, by posting an event to self and returning (“Reminder” state pattern). The self-posted event then triggers the continuation of longer processing.
@remarks
Sometimes it is not practical to break up long RTC steps, and consequently the thread-level response of the simple @ref srs_qv "QV kernel" might be too slow. In this cases you need to use a *preemptive* kernel. The big advantage of preemptive kernel is that it effectively decouples high-priority thread from low-priority threads in the time domain. The timeliness of execution of high-priority thread is almost independent on the low-priority threads. But of course there is no such thing as a free lunch. Preemptive kernels open the whole new class of problems related to race conditions. So you need to be very careful about sharing any resources.
@next{qk}
*/
/*##########################################################################*/
/*! @defgroup qk QK
@brief
Preemptive Run-To-Completion (Non-Blocking) Kernel
<p>The preemptive, non-blocking QK kernel is specifically designed to execute non-blocking active objects (see also [[PSiCC2](https://www.state-machine.com/psicc2/), Chapter 10]). QK runs active objects in the same way as prioritized interrupt controller (such as NVIC in ARM Cortex-M) runs interrupts using **single stack**. Active objects process their events in run-to-completion (RTC) fashion and remove themselves from the call stack, the same way as nested interrupts remove themselves from the stack upon completion. At the same time high-priority active objects can **preempt** lower-priority active objects, just like interrupts can preempt each other under a prioritized interrupt controller. <span class="highlight">QK meets all the requirement of the Rate Monotonic Scheduling (a.k.a. Rate Monotonic Analysis RMA) and can be used in hard real-time systems</span>.
</p>
@note
The non-blocking, run-to-completion, preemptive threads are known in the literature as "basic threads" (OSEK/AUTOSAR terminology), sometimes also called "fibers" (e.g., Q-Kernel) or "software interrupts" (e.g., TI-RTOS).
@section qk_overview QK Overview
The preemptive, run-to-completion (RTC) QK kernel breaks entirely with the endless-loop structure of the thread routines and instead uses threads structured as one-shot, discrete, run-to-completion functions, very much like ISRs [[PSiCC2](https://www.state-machine.com/psicc2/), Chapter 10]. In fact, the QK kernel views interrupts very much like threads of a “super-high” priority, except that interrupts are prioritized in hardware by the interrupt controller, whereas threads are prioritized in software by the RTC kernel.
As a fully preemptive multithreading kernel, QK must ensure that at all times the CPU executes the highest-priority thread (active object) that is ready to run. Fortunately, only two scenarios can lead to readying a higher-priority thread:
<ul class="tag">
<li><span class="tag">1</span>
When a lower-priority thread posts an event to a higher-priority thread, the kernel must immediately suspend the execution of the lower-priority thread and start the higher-priority thread. This type of preemption is called <b>synchronous preemption</b> because it happens synchronously with posting an event to the thread's event queue.
> NOTE: The stack usage shown in the bottom panel displays stack growing down (towards lower addresses), as it is the case in ARM Cortex-M.
</li>
</ul>
@anchor qk-synch-fig
@image html qk_synch.gif "Synchronous Preemption in QK"
<ul class="tag">
<li><span class="tag">2</span>
When an interrupt posts an event to a higher-priority thread than the interrupted thread, upon completion of the ISR the kernel must start execution of the higher-priority thread instead of resuming the lower-priority thread. This type of preemption is called <b>asynchronous preemption</b> because it can happen asynchronously, any time interrupts are not explicitly disabled.
> NOTE: The stack usage during asynchronous preemption on ARM Cortex-M is slightly simplified in the diagram below. A more detailed stack usage diagram is discussed later in the section explaining the @ref arm-cm_qk_port-asm_pendsv "Detailed stack allocation in QK for ARM Cortex-M".
</li>
</ul>
@anchor qk-asynch-fig
@image html qk_asynch.gif "Asynchronous Preemption in QK"
@note
A traditional RTOS kernel does not distinguish between the synchronous and asynchronous preemptions and makes all preemptions look like the more stack-intensive asynchronous preemptions. In contrast, a RTC kernel can implement synchronous preemption as a simple function call (to QK_activate_()), which is much more efficient than a full context-switch.
@next{qxk}
*/
/*##########################################################################*/
/*! @defgroup qxk QXK
@brief
Preemptive Dual-Mode (Run-to-Completion/Blocking) RTOS Kernel
QXK is a small, preemptive, priority-based, dual-mode **blocking** kernel that executes active objects like the @ref srs_qk "QK kernel" (@ref srs_qxk_basic "basic threads"), but can also execute traditional __blocking__ threads (@ref srs_qxk_extended "extended threads"). In this respect, QXK behaves exactly like a __conventional RTOS__ (Real-Time Operating System).
QXK has been designed specifically for mixing event-driven active objects with traditional blocking code, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software. To this end, QXK is not only more efficient than running QP on top of a @ref ports_rtos "traditional 3rd-party RTOS" (because non-blocking @ref srs_qxk_basic "basic threads" take far less stack space and CPU cycles for context switch than the much heavier @ref srs_qxk_extended "extended threads"). But the biggest advantage of QXK is that it __protects__ the application-level code from inadvertent mixing of blocking calls inside the event-driven active objects. Specifically, QXK "knows" the type of the thread context (extended/basic) and asserts internally if a blocking call (e.g., semaphore-wait or a time-delay) is attempted in a basic thread (active object). This is something that a QP port to a @ref ports_rtos "conventional 3rd-party RTOS" cannot do, because such an RTOS runs all code (including active objects) in the context of havyweight extended threads.
Currently, the QXK kernel has been ported to the following CPUs:
- @ref arm-cm_qxk "Cortex-M (M0/M0+/M1/M3/M4/M4F/M7)"@n
Supported toolchains include: ARM-KEIL MDK, IAR-ARM, GNU-ARM, TI-ARM.
Currently, the QXK kernel is illustrated by the following examples:
- @ref arm-cm_dpp_efm32-slstk3401a (ARM Cortex-M4F)@n
Example illustrates: 6 active objects plus two extended threads, QXK blocking delay, QXK semaphore, QXK mutex, QXK blocking message queue.
- @ref arm-cm_dpp_ek-tm4c123gxl (ARM Cortex-M4F)@n
Example illustrates: 6 active objects plus two extended threads, QXK blocking delay, QXK semaphore, QXK mutex, QXK blocking message queue.
- @ref arm-cm_dpp_nucleo-l053r8 (ARM Cortex-M0+)@n
Example illustrates: 6 active objects plus two extended threads, QXK blocking delay, QXK semaphore, QXK mutex, QXK blocking message queue.
@section qxk_basic Basic Threads
QXK supports **basic**-threads (non-blocking, run-to-completion activations). The basic-threads all nest on the same stack (Main Stack Pointer in ARM Cortex-M), so the stack usage is reduced. The additional advantage of basic-threads is that switching from basic-thread to another basic-thread requires only @ref srs_qxk_activate_() "activation" of the basic-thread, which is much simpler and faster than full context-switch required for @ref srs_qxk_extended "extended"-threads that QXK also supports (see below).
@remarks
QXK adopts the "basic/exteded thread" terms from the <a class="extern" target="_blank" href="https://www.autosar.org">OSEK/AUTOSAR Operating System</a> specification. Other real-time kernels might use different terminology for similar concepts. For example, the <a class="extern" target="_blank" href="http://www.quasarsoft.com/">Q-Kernel</a> uses the term "fibers", while <a class="extern" target="_blank" href="http://www.ti.com/tool/TI-RTOS">TI-RTOS</a> uses the term "software interrupts" for concepts closely related to "basic threads".
@section qxk_extended Extended Threads
QXK supports **extended**-threads (blocking, typically structrued as endless loops). The extended-threads use private per-thread stacks, as in conventional RTOS kernels. Any switching from basic-to-extended thread or extended-to-extended thread requires full context switch.
@remarks
QXK is a unique dual-mode kernel on the market that supports interleaving the priorities of basic threads and extended threads. Other dual-mode kernels typically limit the priorities of basic threads to be always higher (more urgent) than any of the extended threads.
@sa ::QXThread
@section qxk_classes Classes in QXK
The figure below shows the main classes introduced in the QXK kernel and their relation to the classes of the QP framework.
@image html qxk_classes.gif "Classes of the QXK dual-mode kernel"
<ul class="tag">
<li><span class="tag">0</span> The abstract ::QActive class represents active objects in QP. This class contains the @c thread object of the underlying kernel (QXK thread-control-block in this case) as well as the event queue and the unique priority of the active object.
</li>
<li><span class="tag">1</span> The ::QXThread class represents the extended (blocking) threads of the QXK kernel. It inherits ::QActive, so that extended-threads can be treated as active objects internally in the framework. However, the extended-threads **do not implement state machines**. Instead, the data fields used for storing the current state in active objects are re-used to store the private stack of the extended-thread. The ::QXThread class also contains the @c timeEvt object (see ::QTimeEvt) for generating timeouts when the extended-thread is blocked.
</li>
<li><span class="tag">2</span> The ::QXMutex class represents the **priority-ceiling mutex** of the QXK kernel. The mutex can block and can be used only in the extended-threads (in case they share resources that need to be protected). The mutex is recursive, meaning that it can be locked multiple times from the same extended thread (but it needs to be unlocked equal number of times).
</li>
<li><span class="tag">3</span> The ::QXSemaphore class represents the **counting semaphore** of the QXK kernel. The semaphore can be waited on only in the extended-threads and the QXK kernel would assert if an active object thread would attempt to wait on a semaphore. On the other hand, a semaphore can be signaled from anywhere in the code, including active objects and ISRs.
</li>
</ul>
@note
The main takeaway from the QXK class diagram is QXK's **optimal, tight integration** with the QP framework. The QXK kernel reuses all mechanisms already provided in QP, thus avoiding any code duplication, inefficient layers of indirection, and additional licensing costs, which are inevitable when using @ref ports_rtos "3rd-party RTOS kernels" to run QP applications.
@section qxk_features QXK Feature Summary
As you can see in the list below, <span class="highlight">QXK provides most features you might expect of a traditional blocking **RTOS** kernel and is <strong>recommended</strong> as the preferred RTOS kernel for QP applications</span> that need to mix active objects with traditional blocking code.
<ul class="tag">
<li><span class="bullet">&gt;</span>Preemptive, priority-based scheduling of up to 64 threads. Each thread must be assigned its own unique priority (1 .. #QF_MAX_ACTIVE);
</li>
> NOTE: QXK always executes the highest-priority thread that is ready to run (is not blocked). The scheduling algorithm used in QXK meets all the requirement of the Rate Monotonic Scheduling (a.k.a. Rate Monotonic Analysis — RMA) and can be used in hard real-time systems.
<li><span class="bullet">&gt;</span>QXK distinguishes between two types of threads:
</li>
- **basic threads** of active objects that are made ready-to-run by events posted to the active objects. Such basic threads are non-blocking, run-to-completion activations that cannot block in the middle of the RTC step. QXK asserts when a basic thread attempts to use a blocking mechanism, such as a time-delay or a semaphore-wait. All basic threads share the common stack.
- **extended threads** that can block anywhere in their thread-handler function, whereas QXK provides a typical assortments of blocking primitives for extended-threads, such as time-delay, blocking message queue, counting semaphore, or a mutex. Each extended thread must be provided with its own private stack.
<li><span class="bullet">&gt;</span>Tightly integrated mechanisms for communication between event-driven active objects and extended blocking threads:
</li>
- Basic threads (Active Objects) can signal semaphores and send messages to extended threads.
- Extended threads can post or publish events to active objects or other extended threads;
- Extended threads can subscribe to events and thus can receive events published in the system.
<li><span class="bullet">&gt;</span>Priority-Ceiling, recursive Mutexes with optional timeout;
</li>
> **NOTE:** Priority-ceiling protocol implemented in QXK is immune to priority-inversions, but requires a unique QP thread priority level (the ceiling priority) to be assigned to the mutex. This ceiling priority is unavailable to QP threads.@n
> **NOTE:** A QXK mutex can be configured not to use the priority-ceiling protocol (when initialized with a zero priority-ceiling). In that case, the mutex does not require a separate priority level.
<li><span class="bullet">&gt;</span>Counting Semaphores with optional timeout that can block multiple extended-threads;
</li>
<li><span class="bullet">&gt;</span>Blocking "zero-copy" message queue with optional timeout bound to each extended-thread;
</li>
<li><span class="bullet">&gt;</span>Deterministic fixed-size memory pools for dynamic memory management available both to extended-threads and active objects;
</li>
<li><span class="bullet">&gt;</span>Interrupt management, including "zero-latency", kernel-unaware interrupts that are never disabled;
</li>
> NOTE: This feature is only supported on CPUs that allow selective interrupt disabling, such as ARM Cortex-M3/M4 (but not ARM Cortex-M0/M0+);
<li><span class="bullet">&gt;</span> @ref srs_qxk_tls "Thread-Local Storage" for all threads (basic threads and extended threads).
</li>
</ul>
@subsection qxk_tls Thread Local Storage
<b>Thread-local storage (TLS)</b> is a programming method that uses static or global memory local to a thread. TLS is specifically useful for writing library-type code, which is used in a multithreaded environment and needs to access per-thread data in an independent way.
TLS is used in some places where ordinary, single-threaded programs would use static or global variables, but where this would be inappropriate in multithreaded cases. An example of such situations is where library-type functions use a global variable to set an error condition (for example the global variable errno used by many functions of the C library). If errno were simply a global variable, a call of a system function on one thread may overwrite the value previously set by a call of a system function on a different thread, possibly before following code on that different thread could check for the error condition. The solution is to have errno be a variable that looks like it is global, but in fact exists once per thread—i.e., it lives in *thread-local storage*. A second use case would be multiple threads accumulating information into a global variable. To avoid a race condition, every access to this global variable would have to be protected by a mutual-exclusion mechanism. Alternatively, each thread might accumulate into a thread-local variable (that, by definition, cannot be read from or written to from other threads, implying that there can be no race conditions). Threads then only have to synchronize a final accumulation from their own thread-local variable into a single, truly global variable.
The TLS implementations vary, but many systems, including QXK, implement TLS by providing a pointer-sized variable thread-local. This pointer can be set to arbitrarily sized memory blocks in a thread-local manner, by allocating such a memory block (statically or dynamically) and storing the memory address of that block in the thread-local variable.
Typical usage of TLS in QXK is illustrated in the example <span class="img folder">qpc/examples/arm-cm/dpp_efm32-slstk3401a/qxk/</span>, <span class="img file_c">test.c</span>, and consists:
- define the TLS structure
@code{c}
typedef struct {
uint32_t foo;
uint8_t bar[10];
} TLS_test;
@endcode
- allocate the TLS storage for all participating threads (extended or basic threads)
@code{c}
static TLS_test l_tls1;
static TLS_test l_tls2;
@endcode
- initialize the TLS per-thread pointer in each thread routine (for extended threads) or the top-most initial transition (for basic threads of active objects):
@code{c}
static void Thread1_run(QXThread * const me) {
me->super.thread = &l_tls1; /* initialize the TLS for Thread1 */
. . .
}
. . .
static void Thread2_run(QXThread * const me) {
me->super.thread = &l_tls2; /* initialize the TLS for Thread2 */
. . .
}
@endcode
- access the TLS from your code:
@code{c}
void lib_fun(uint32_t x) {
QXK_TLS(TLS_test *)->foo = x;
}
@endcode
@sa
- QXK_current()
- QXK_TLS()
*/

View File

@ -5,14 +5,15 @@ The QP/C framework can be easily adapted to various operating systems, processor
The QP/C distribution contains many QP/C ports, which are organized into the three categories:
- @subpage ports_native "Native Ports" adapt QP/C to run on bare-metal processors "natively", using one of the built-in kernels (@ref qv "QV", @ref qk "QK", or @ref qxk "QXK")
- @subpage ports_lint (generic C compiler) QP/C "port" to the PC-Lint Plus static analysis tool (a "compiler")
- @subpage ports_native "Native Ports" adapt QP/C to run on bare-metal processors "natively", using one of the built-in kernels (@ref srs_qv "QV", @ref srs_qk "QK", or @ref srs_qxk "QXK")
- @subpage ports_rtos "3rd-Party RTOS Ports" adapt QP/C to run on top of a 3rd-Party Real-Time Operating System (RTOS)
- @subpage ports_os "3rd-Party OS Ports" adapt QP/C to run on top of a 3rd-Party Operating System (OS), such as @ref win32 "Windows" or @ref posix "Linux".
@section ports_code Port Code Structure
Starting with QP/C release 5.4.0, **all** available ports are bundled into the QP/C download, as opposed to being distributed as separate QP Development Kits (QDKs). The main benefit is of this approach is that it greatly reduces chances of mistakes in combining the mainline QP/C code with various QDKs. The downside is that the QP/C distribution becomes quite large and that ports cannot be added or updated independently from the QP/C baseline code.
@ -25,7 +26,7 @@ All ports are located in sub-directories of the <span class="img folder">ports</
<li><span class="img folder">arm-cm/</span> &mdash; Native ports for ARM-Cortex-M (bare-metal) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="tag">A</span>
</li>
<ul class="tag">
<li><span class="img folder">qk/</span> &mdash; Port to the @ref qk "preemptive QK kernel"
<li><span class="img folder">qk/</span> &mdash; Port to the @ref srs_qk "preemptive QK kernel"
</li>
<ul class="tag">
<li><span class="img folder">arm</span> &mdash; Port to ARM-KEIL toolset
@ -37,7 +38,7 @@ All ports are located in sub-directories of the <span class="img folder">ports</
<li><span class="img folder">ti</span> &mdash; Port to TI/CCS toolset
</li>
</ul>
<li><span class="img folder">qv/</span> &mdash; Port to the @ref qv "cooperative QV kernel"
<li><span class="img folder">qv/</span> &mdash; Port to the @ref srs_qv "cooperative QV kernel"
</li>
<ul class="tag">
<li><span class="img folder">arm</span> &mdash; Port to ARM-KEIL toolset
@ -49,7 +50,7 @@ All ports are located in sub-directories of the <span class="img folder">ports</
<li><span class="img folder">ti</span> &mdash; Port to TI/CCS toolset
</li>
</ul>
<li><span class="img folder">qxk/</span> &mdash; Port to the @ref qxk "blocing QXK kernel"
<li><span class="img folder">qxk/</span> &mdash; Port to the @ref srs_qxk "blocing QXK kernel"
</li>
<ul class="tag">
<li><span class="img folder">arm</span> &mdash; Port to ARM-KEIL toolset
@ -58,12 +59,10 @@ All ports are located in sub-directories of the <span class="img folder">ports</
</li>
<li><span class="img folder">iar</span> &mdash; Port to IAR toolset
</li>
<li><span class="img folder">ti</span> &mdash; Port to TI/CCS toolset
</li>
</ul>
</ul>
<li><span class="img folder">ucos-ii/</span> &mdash; Port to uCOS-II (3rd-party RTOS) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="tag">B</span>
<li><span class="img folder">uc-os2/</span> &mdash; Port to uc-os2 (3rd-party RTOS) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="tag">B</span>
</li>
<ul class="tag">
<li><span class="img folder">arm-cm</span> &mdash; Port to ARM-Cortex-M
@ -110,7 +109,7 @@ All ports are located in sub-directories of the <span class="img folder">ports</
<li><span class="tag">A</span> **Native Ports** are located in sub-directories named after the CPU architecture, such as <span class="img folder">arm-cm</span> for ARM Cortex-M. Under that directory, the sub-directories <span class="img folder">qk</span> and <span class="img folder">qv</span> contain ports for the @ref comp_qk "QK" and @ref comp_qv "QV" kernels, respectively.
</li>
<li><span class="tag">B</span> **Ports for 3rd-party RTOS** are located in sub-directories named after the RTOS, such as <span class="img folder">ucos-ii</span> for uCOS-II RTOS. Under that directory, the sub-directories, such as <span class="img folder">arm-cm</span>, contain examples for the specified CPU architecture, such as ARM Cortex-M here.
<li><span class="tag">B</span> **Ports for 3rd-party RTOS** are located in sub-directories named after the RTOS, such as <span class="img folder">uc-os2</span> for uc-os2 RTOS. Under that directory, the sub-directories, such as <span class="img folder">arm-cm</span>, contain examples for the specified CPU architecture, such as ARM Cortex-M here.
</li>
<li><span class="tag">C</span> **Ports for 3rd-party OS** are located in sub-directories named after the OS, such as <span class="img folder">win32</span> for the Win32 API (Windows OS). (NOTE: The builds for desktop operating systems, such as Windows or Linux contain the pre-build QP libraries for the Debug, Release, and Spy build configurations).
@ -120,6 +119,108 @@ All ports are located in sub-directories of the <span class="img folder">ports</
@note
Because the QP distribution contains *all* ports, the number of sub-directories and files in the <span class="img folder">ports</span> folder may seem daunting. However, knowing the structure of the <span class="img folder">ports</span> folder, you can simply **delete** the sub-directories that are not interesting to you.
@next{ports_native}
@nav_next{ports_lint}
*/
/*##########################################################################*/
/*! @page ports_lint PC-Lint-Plus
![PC-Lint Plus](logo_pclintplus.jpg)
The QP/C distribution contains a "port" to <a href="https://www.gimpel.com" target="_blank" class="extern"><b>PC-Lint-Plus</b></a> static analysis tool from <a href="https://www.gimpel.com" target="_blank" class="extern">Gimpel Software (now Vector)</a>, which is a static analysis tool for C and C++ with one of the longest track records and best value of the money in the industry. The "PC-Lint-Plus port" allows you to statically analyze the QP/C source code and facilitates static analysis of your **application code** based on QP/C.
The QP/C "port" to PC-Lint-Plus is located in the directory <span class="img folder">qpc/ports/lint-plus</span> and includes also lint configuration files, as well as an example of "linting" application code in the directory <span class="img folder">qpc/examples/arm-cm/dpp_ek-tm4c123gxl/lint-plus</span>. The following listing describes the most important files in these three directories.
@code{.x}
qpc\ - QP/C installation directory
+-ports/ - QP/C ports directory
| +-lint-plus/ - QP/C "port" to PC-Lint-Plus
| | +-16bit/ - QP/C++ "port" to 16-bit CPUs
| | | +-cpu.lnt - Lint options for a 16-bit CPU
| | | +-stdint.h - Standard exact-width integers for a 16-bit CPU
| | +-32bit/ - QP/C++ "port" to 32-bit CPUs
| | | +-cpu.lnt - Lint options for a 32-bit CPU
| | | +-stdint.h - Standard exact-width integers for a 32-bit CPU
| | +-qk/ - QP/C port with the QK kernel
| | +-qv/ - QP/C port with the QV kernel
| | +-qxk/ - QP/C port with the QXK kernel
| | +-au-ds.lnt - Dan Saks recommendations
| | +-au-misra3.lnt - MISRA-C:2012 compliance checks
| | +-au-misra3-amd1.lnt - MISRA-C:2012-Amendment-1 additional checks
| | +-qpc.lnt - PC-Lint-Plus options for QP/C applications
| | +-std.lnt - Standard PC-Lint-Plus settings recommended by Quantum Leaps
| | +-lin.bat - Batch file to invoke PC-Lint-Plus to run analysis of QP/C code
| | +-options.lnt - PC/Lint-Plus options for "linting" QP/C source code
| | +-lint_qf.log - PC/Lint-Plus output for the QEP/QF components of QP/C
| | +-lint_qs.log - PC/Lint-Plus output for the QS component of QP/C
| | +-lint_qv.log - PC/Lint-Plus output for the QV component of QP/C
| | +-lint_qk.log - PC/Lint-Plus output for the QK component of QP/C
| | +-lint_qxk.log - PC/Lint-Plus output for the QXK component of QP/C
| | +-qep_port.h - QEP component "port" to a "generic C compiler"
| | +-stdbool.h - Standard Boolean type and constants for a "generic C compiler"
|
+-examples\ - QP/C examples directory (application)
| +-arm-cm\ - QP/C examples for ARM Cortex-M
| | +-dpp_ek-tm4c123gxl\ - DPP example on the EK-TM4C123GLX board
| | | +-lint-plus\ - directory for linting the application
| | | | +-lin.bat - Batch to run PC-Lint-Plus analysis of application code
| | | | +-options.lnt - PC-Lint-Plus options for "linting" of application code
@endcode
@section lint_qpc Linting the QP/C Source Code
The directory <span class="img folder">qpc/ports/lint-plus</span> (see listing above) contains also the **lin.bat** batch file for "linting" the QP/C source code. The `lin.bat` batch file invokes PC-Lint-Plus and generates the lint output files. As shown in the listing above, the lint output is collected into four text files `lint_qf.log`, `lint_qs.log`, `lint_qk.log`, `lint_qv.log`, and `lint_qs.log`, for QEP/QF, QK, QV, QXK and QS components of the QP/C framework, respectively.
@note
In order to execute the `lin.bat` file on your system, you might need to adjust the symbol `PCLP_DIR` at the top of the batch file, to the PC-Lint-Plus installation directory on your computer.
@remarks
The `lin.bat` batch file invoked without any command-line options checks the QP/C code in the ::Q_SPY build configuration with software tracing enabled. However, by the nature of software tracing, the ::Q_SPY configuration transgresses many more MISRA-C rules than the standard configuration. However, the ::Q_SPY configuration is never used for production code, so the MISRA-C compliance of the QP/C framework should not be judged by the deviations that happen only in the ::Q_SPY configuration.
According to the PC-Lint-Plus guidelines, the `lin.bat` uses two option files: the `qpc.lnt` configuration file discussed before and the `options.lnt` configuration file that covers all deviations from the MISRA-C rules **within the QP/C source code**. These deviations are intentionally localized to QP/C code and are independent from your **application-level** code. In other words, a MISRA-C deviation present in the QP/C code does **not** mean that such deviation is somehow allowed or its detection is somehow suppressed in the **application-level** code. This is because the the `options.lnt` configuration file for internals of QP/C is **not** used to "lint" the application-level code.
@section lint_app Linting QP/C Application Code
The QP/C baseline code contains an example of MISRA-C compliance checking with PC-Lint-Plus: the DPP example for the EK-TM4C123GLX Cortex-M4F board, located in the directory <span class="img folder">qpc/examples/arm-cm/dpp_ek-tm4c123gxl/lint-plus</span>. The PC-Lint-Plus analysis is very simple and requires invoking the **lin.bat** file.
@note
In order to execute the **lin.bat** file on your system, you might need to adjust the symbol `PCLP_DIR` at the top of the batch file, to the PC-Lint-Plus installation directory on your computer. You
The `lint-plus` subdirectory contains also the local version of the `options.lnt` configuration file with the PC-Lint-Plus options specific to linting the application. Here, you might include linting options for your specific compiler, as described in the "PC-Lint-Plus Manual", Chapter 2 "Installation and Configuration".
@section lint_options Structure of PC-Lint-Plus Options for QP/C
PC-Lint-Plus has several places where it reads its currently valid options:
- From special PC-Lint-Plus option files (usually called `*.lnt`)
- From the command line
- From within the special lint-comments in the source code modules (not recommended)
The QP/C source code and example application code has been "linted" only by means of the first alternative (option files) with possibility of adding options via command line. The third alternative--lint comments--is not used and Quantum Leaps does not recommend this alternative.
@note
The QP/C source code is completely free of lint comments, which are viewed as a contamination of the source code.
The structure of the PC-Lint-Plus option files used for "linting" QP/C follows the <a href="http://www.gimpel.com" target="_blank" class="extern">Gimpel Software</a> guidelines for configuring PC-Lint-Plus (See Section 2 "Configuration" in the *PC-Lint-Plus Manual*). The design and grouping of the lint options also reflects the fact that static code analysis of a software framework, such as QP/C, has really two major aspects. First, the source code of the framework itself has to be analyzed. But even more important and helpful to the users of the framework is providing the infrastructure to effectively analyze the application-level code based on the framework. With this in mind, the PC-Lint-Plus options for static analysis of QP/C are divided into two groups, located in directories <span class="img folder">qpc/include</span> and <span class="img folder">qpc/ports/lint</span>. These two groups are for analyzing QP/C **applications** and QP/C **source code**, respectively.
As shown in the PC-Lint-Plus "port" files description, the directory <span class="img folder">qpc/include</span>, contains the PC-Lint-Plus options for "linting" the application code along with all platform-independent QP/C header files required by the applications. This collocation of lint options with header files simplifies "linting", because specifying just `-iqpc/include` include directory to PC-Lint-Plus accomplishes both inclusion of QP/C header files and PC-Lint-Plus options.
Note that the `qpc/include` directory contains all PC-Lint-Plus option files used in "linting" the code, including the standard MISRA-C:2012 `au-misr3.lnt` option file as well as Dan Saks' recommendations `au-ds.lnt`, which are copied from the PC-Lint-Plus distribution. This design freezes the lint options for which the compliance has been checked.
@subsection lint_std_lnt The std.lnt option file
According to the Gimpel Software *PC-Lint-Plus Configuration Guidelines*, the file `qpc/include/std.lnt` file, contains the top-level options, which Quantum Leaps recommends for all projects. These options include the formatting of the PC-Lint-Plus messages and making two passes to perform better cross-module analysis. However, the most important option is `-restore_at_end`, which has the effect of surrounding each source file with options `-save` and `-restore`. This precaution prevents options from "bleeding" from one file to another.
<b>Top-level option file std.lnt</b>
@include std.lnt
@subsection lint_qpc_lnt The qpc.lnt option file
The most important file for "linting" QP/C applications is the **qpc.lnt** option file. This file handles all deviations from the MISRA-C:2012 rules, which might arise at the application-level code from the use of the QP/C framework. In other words, the **qpc.lnt** option file allows completely clean "linting" of the application-level code, as long as the application code does not violate any of the MISRA-C:2012 rules.
At the same time, the **qpc.lnt** option file has been very carefully designed not to suppress any MISRA-C:2012 rule checking outside the very specific context of the QP/C API. In other words, the qpc.lnt option file still supports 100% of the MISRA-C:2012 rule checks that PC-Lint-Plus is capable of performing.
@remarks
For example, for reasons explained in Section 5.10 of the <a href="https://www.state-machine.com/doc/AN_QP-C_MISRA.pdf" target="_blank" class="extern">"QP/C MISRA Compliance Matrix"</a>, QP/C extensively uses function-like macros, which deviates from the MISRA-C:2012 advisory Rule 4.9 and which PC-Lint-Plus checks with the warning 9026. However, instead of suppressing this warning globally (with the -e9096 directive), the qpc.lnt option file suppresses warning 9096 only for the specific QP function-like macros that are visible to the application level. So specifically, the qpc.lnt file contains directives `-esym(9026, Q_TRAN, Q_SUPER, ...)`, which suppresses the warning only for the specified macros, but does not disable checking of any other macros in the application-level code.
@nav_next{ports_native}
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
/*##########################################################################*/
/*! @page ports_native Native (Bare-Metal) Ports
- @subpage lint (generic C compiler)
- @subpage arm-cm (Cortex-M0/M0+/M3/M4/M4/M7)
- @ref arm-cm_qv (ARM-CLANG, ARM-KEIL, GNU-ARM, IAR-ARM )
- @ref arm-cm_qk (ARM-CLANG, ARM-KEIL, GNU-ARM, IAR-ARM)
@ -16,148 +15,37 @@
- @ref msp430_qv (TI-CCS, IAR toolchains)
- @ref msp430_qk (TI-CCS, IAR toolchains)
*/
/*##########################################################################*/
/*! @page lint PC-Lint-Plus
@tableofcontents
<p>The QP/C distribution contains a "port" to <a href="https://www.gimpel.com" target="_blank" class="extern"><b>PC-Lint-Plus</b></a> static analysis tool from <a href="https://www.gimpel.com" target="_blank" class="extern">Gimpel Software</a>, which is a static analysis tool for C and C++ with one of the longest track records and best value of the money in the industry. The "PC-Lint-Plus port" allows you to statically analyze the QP/C source code and facilitates static analysis of your **application code** based on QP/C.
</p>
The QP/C "port" to PC-Lint-Plus is located in the directory <span class="img folder">qpc/ports/lint-plus</span> and includes also lint configuration files, as well as an example of "linting" application code in the directory <span class="img folder">qpc/examples/arm-cm/dpp_ek-tm4c123gxl/lint-plus</span>. The following listing describes the most important files in these three directories.
@code{.x}
qpc\ - QP/C installation directory
+-ports/ - QP/C ports directory
| +-lint-plus/ - QP/C "port" to PC-Lint-Plus
| | +-16bit/ - QP/C++ "port" to 16-bit CPUs
| | | +-cpu.lnt - Lint options for a 16-bit CPU
| | | +-stdint.h - Standard exact-width integers for a 16-bit CPU
| | +-32bit/ - QP/C++ "port" to 32-bit CPUs
| | | +-cpu.lnt - Lint options for a 32-bit CPU
| | | +-stdint.h - Standard exact-width integers for a 32-bit CPU
| | +-qk/ - QP/C port with the QK kernel
| | +-qv/ - QP/C port with the QV kernel
| | +-qxk/ - QP/C port with the QXK kernel
| | +-au-ds.lnt - Dan Saks recommendations
| | +-au-misra3.lnt - MISRA-C:2012 compliance checks
| | +-au-misra3-amd1.lnt - MISRA-C:2012-Amendment-1 additional checks
| | +-qpc.lnt - PC-Lint-Plus options for QP/C applications
| | +-std.lnt - Standard PC-Lint-Plus settings recommended by Quantum Leaps
| | +-lin.bat - Batch file to invoke PC-Lint-Plus to run analysis of QP/C code
| | +-options.lnt - PC/Lint-Plus options for "linting" QP/C source code
| | +-lint_qf.log - PC/Lint-Plus output for the QEP/QF components of QP/C
| | +-lint_qs.log - PC/Lint-Plus output for the QS component of QP/C
| | +-lint_qv.log - PC/Lint-Plus output for the QV component of QP/C
| | +-lint_qk.log - PC/Lint-Plus output for the QK component of QP/C
| | +-lint_qxk.log - PC/Lint-Plus output for the QXK component of QP/C
| | +-qep_port.h - QEP component "port" to a "generic C compiler"
| | +-stdbool.h - Standard Boolean type and constants for a "generic C compiler"
|
+-examples\ - QP/C examples directory (application)
| +-arm-cm\ - QP/C examples for ARM Cortex-M
| | +-dpp_ek-tm4c123gxl\ - DPP example on the EK-TM4C123GLX board
| | | +-lint-plus\ - directory for linting the application
| | | | +-lin.bat - Batch to run PC-Lint-Plus analysis of application code
| | | | +-options.lnt - PC-Lint-Plus options for "linting" of application code
@endcode
@section lint_qpc Linting the QP/C Source Code
The directory <span class="img folder">qpc/ports/lint-plus</span> (see listing above) contains also the **lin.bat** batch file for "linting" the QP/C source code. The `lin.bat` batch file invokes PC-Lint-Plus and generates the lint output files. As shown in the listing above, the lint output is collected into four text files `lint_qf.log`, `lint_qs.log`, `lint_qk.log`, `lint_qv.log`, and `lint_qs.log`, for QEP/QF, QK, QV, QXK and QS components of the QP/C framework, respectively.
@note
In order to execute the `lin.bat` file on your system, you might need to adjust the symbol `PCLP_DIR` at the top of the batch file, to the PC-Lint-Plus installation directory on your computer.
@remarks
The `lin.bat` batch file invoked without any command-line options checks the QP/C code in the ::Q_SPY build configuration with software tracing enabled. However, by the nature of software tracing, the ::Q_SPY configuration transgresses many more MISRA-C rules than the standard configuration. However, the ::Q_SPY configuration is never used for production code, so the MISRA-C compliance of the QP/C framework should not be judged by the deviations that happen only in the ::Q_SPY configuration.
According to the PC-Lint-Plus guidelines, the `lin.bat` uses two option files: the `qpc.lnt` configuration file discussed before and the `options.lnt` configuration file that covers all deviations from the MISRA-C rules **within the QP/C source code**. These deviations are intentionally localized to QP/C code and are independent from your **application-level** code. In other words, a MISRA-C deviation present in the QP/C code does **not** mean that such deviation is somehow allowed or its detection is somehow suppressed in the **application-level** code. This is because the the `options.lnt` configuration file for internals of QP/C is **not** used to "lint" the application-level code.
@section lint_app Linting QP/C Application Code
The QP/C baseline code contains an example of MISRA-C compliance checking with PC-Lint-Plus: the DPP example for the EK-TM4C123GLX Cortex-M4F board, located in the directory <span class="img folder">qpc/examples/arm-cm/dpp_ek-tm4c123gxl/lint-plus</span>. The PC-Lint-Plus analysis is very simple and requires invoking the **lin.bat** file.
@note
In order to execute the **lin.bat** file on your system, you might need to adjust the symbol `PCLP_DIR` at the top of the batch file, to the PC-Lint-Plus installation directory on your computer. You
The `lint-plus` subdirectory contains also the local version of the `options.lnt` configuration file with the PC-Lint-Plus options specific to linting the application. Here, you might include linting options for your specific compiler, as described in the "PC-Lint-Plus Manual", Chapter 2 "Installation and Configuration".
@section lint_options Structure of PC-Lint-Plus Options for QP/C
PC-Lint-Plus has several places where it reads its currently valid options:
- From special PC-Lint-Plus option files (usually called `*.lnt`)
- From the command line
- From within the special lint-comments in the source code modules (not recommended)
The QP/C source code and example application code has been "linted" only by means of the first alternative (option files) with possibility of adding options via command line. The third alternative--lint comments--is not used and Quantum Leaps does not recommend this alternative.
@note
The QP/C source code is completely free of lint comments, which are viewed as a contamination of the source code.
The structure of the PC-Lint-Plus option files used for "linting" QP/C follows the <a href="http://www.gimpel.com" target="_blank" class="extern">Gimpel Software</a> guidelines for configuring PC-Lint-Plus (See Section 2 "Configuration" in the *PC-Lint-Plus Manual*). The design and grouping of the lint options also reflects the fact that static code analysis of a software framework, such as QP/C, has really two major aspects. First, the source code of the framework itself has to be analyzed. But even more important and helpful to the users of the framework is providing the infrastructure to effectively analyze the application-level code based on the framework. With this in mind, the PC-Lint-Plus options for static analysis of QP/C are divided into two groups, located in directories <span class="img folder">qpc/include</span> and <span class="img folder">qpc/ports/lint</span>. These two groups are for analyzing QP/C **applications** and QP/C **source code**, respectively.
As shown in the PC-Lint-Plus "port" files description, the directory <span class="img folder">qpc/include</span>, contains the PC-Lint-Plus options for "linting" the application code along with all platform-independent QP/C header files required by the applications. This collocation of lint options with header files simplifies "linting", because specifying just `-iqpc/include` include directory to PC-Lint-Plus accomplishes both inclusion of QP/C header files and PC-Lint-Plus options.
Note that the `qpc/include` directory contains all PC-Lint-Plus option files used in "linting" the code, including the standard MISRA-C:2012 `au-misr3.lnt` option file as well as Dan Saks' recommendations `au-ds.lnt`, which are copied from the PC-Lint-Plus distribution. This design freezes the lint options for which the compliance has been checked.
@subsection lint_std_lnt The std.lnt option file
According to the Gimpel Software *PC-Lint-Plus Configuration Guidelines*, the file `qpc/include/std.lnt` file, contains the top-level options, which Quantum Leaps recommends for all projects. These options include the formatting of the PC-Lint-Plus messages and making two passes to perform better cross-module analysis. However, the most important option is `-restore_at_end`, which has the effect of surrounding each source file with options `-save` and `-restore`. This precaution prevents options from "bleeding" from one file to another.
<b>Top-level option file std.lnt</b>
@include std.lnt
@subsection lint_qpc_lnt The qpc.lnt option file
The most important file for "linting" QP/C applications is the **qpc.lnt** option file. This file handles all deviations from the MISRA-C:2012 rules, which might arise at the application-level code from the use of the QP/C framework. In other words, the **qpc.lnt** option file allows completely clean "linting" of the application-level code, as long as the application code does not violate any of the MISRA-C:2012 rules.
At the same time, the **qpc.lnt** option file has been very carefully designed not to suppress any MISRA-C:2012 rule checking outside the very specific context of the QP/C API. In other words, the qpc.lnt option file still supports 100% of the MISRA-C:2012 rule checks that PC-Lint-Plus is capable of performing.
@remarks
For example, for reasons explained in Section 5.10 of the <a href="https://www.state-machine.com/doc/AN_QP-C_MISRA.pdf" target="_blank" class="extern">"QP/C MISRA Compliance Matrix"</a>, QP/C extensively uses function-like macros, which deviates from the MISRA-C:2012 advisory Rule 4.9 and which PC-Lint-Plus checks with the warning 9026. However, instead of suppressing this warning globally (with the -e9096 directive), the qpc.lnt option file suppresses warning 9096 only for the specific QP function-like macros that are visible to the application level. So specifically, the qpc.lnt file contains directives `-esym(9026, Q_TRAN, Q_SUPER, ...)`, which suppresses the warning only for the specified macros, but does not disable checking of any other macros in the application-level code.
@next{arm-cm}
@nav_next{arm-cm}
*/
/*##########################################################################*/
/*! @page arm-cr ARM Cortex-R
@image html under_construction.jpg
The QP/C/C++ ports and examples for ARM Cortex-R are described in the Quantum Leaps Application Note @webref{doc/AN_QP_and_ARM-Cortex-R.pdf, QP and ARM Cortex-R}.
@section arm-cr_qk Preemptive QK Kernel
@includelineno ports/arm-cr/qk/gnu/qk_port.h
@section arm-cr_qv Cooperative QV Kernel
[![QP and ARM Cortex-R](img/AN.jpg)](https://www.state-machine.com/doc/AN_QP_and_ARM-Cortex-R.pdf)
@caption{[Application Note: "QP and ARM Cortex-R"](https://www.state-machine.com/doc/AN_QP_and_ARM-Cortex-R.pdf)}
@next{arm7-9}
*/
/*##########################################################################*/
/*! @page arm7-9 ARM7/ARM9
@image html under_construction.jpg
The QP/C/C++ ports and examples for ARM7/ARM9 are described in the Quantum Leaps Application Note @webref{doc/AN_QP_and_ARM-Cortex-R.pdf, QP and ARM7/ARM9}.
@section arm7-9_qk Preemptive QK Kernel
@includelineno ports/arm7-9/qk/gnu/qk_port.s
@section arm7-9_qv Cooperative QV Kernel
[![QP and ARM Cortex-R](img/AN.jpg)](https://www.state-machine.com/doc/AN_QP_and_ARM7_ARM9-GNU.pdf)
@caption{[Application Note: "QP and ARM7/ARM9"](https://www.state-machine.com/doc/AN_QP_and_ARM7_ARM9-GNU.pdf)}
@next{msp430}
*/
/*##########################################################################*/
/*! @page msp430 MSP430
@image html under_construction.jpg
The QP/C/C++ ports and examples for MSP430 are described in the Quantum Leaps Development Kit @webref{doc/QDK_MSP430-CCS.pdf, QP and MSP430 with CCS} and @webref{doc/QDK_MSP430-IAR.pdf, QP and MSP430 with IAR}.
@section msp430_qk Preemptive QK Kernel
[![QP and QP and MSP430 with CCS](img/AN.jpg)](https://www.state-machine.com/doc/QDK_MSP430-CCS.pdf)
@caption{[Application Note: "QP and MSP430-CCS"](https://www.state-machine.com/doc/QDK_MSP430-CCS.pdf)}
@section msp430_qv Cooperative QV Kernel
[![QP and QP and MSP430 with IAR](img/AN.jpg)](https://www.state-machine.com/doc/QDK_MSP430-IAR.pdf)
@caption{[Application Note: "QP and MSP430-IAR"](https://www.state-machine.com/doc/QDK_MSP430-IAR.pdf)}
*/

View File

@ -49,7 +49,7 @@ The standard QP/C distribution contains the POSIX port and @ref exa_os.
/*##########################################################################*/
/*! @page win32-qv Win32-QV (Windows with QV)
<p>The QP/C/C++ ports and examples for Windows with single-thread (like the @ref qv "QV cooperative kernel") are described in the Quantum Leaps Application Note <a class="extern" target="_blank" href="https://www.state-machine.com/doc/AN_QP_and_Win32.pdf"><strong>QP and Win32 (Windows)</strong></a>.
<p>The QP/C/C++ ports and examples for Windows with single-thread (like the @ref srs_qv "QV cooperative kernel") are described in the Quantum Leaps Application Note <a class="extern" target="_blank" href="https://www.state-machine.com/doc/AN_QP_and_Win32.pdf"><strong>QP and Win32 (Windows)</strong></a>.
</p>
@htmlonly

View File

@ -10,7 +10,7 @@ Another reason you might be interested in running QP/C on top of a conventional
You do **not** need to use a traditional RTOS just to achieve preemptive multitasking with QP. The @ref comp_qk "preemptive QK kernel", available as part of the QP package, supports preemptive priority-based multitasking and is fully compatible with Rate Monotonic Scheduling to achieve guaranteed, hard real-time performance. The preemptive, run-to-completion QK kernel perfectly matches the run-to-completion execution semantics of active objects, yet it is simpler, faster, and more efficient than any traditional blocking kernel.
@attention
QP/C 6.x includes a small, preemptive, priority-based, @ref qxk "dual-mode blocking QXK kernel" that executes active objects like the QK kernel (@ref qxk_basic "basic threads"), but can also execute traditional blocking threads (@ref qxk_extended "extended threads"). In this respect, QXK behaves exactly like a conventional RTOS. The QXK kernel is recommended as the preferred RTOS kernel for applications that need to mix active objects with traditional blocking code. Due to the tight and optimal integration between QXK and the rest of QP, QXK offers better performance and smaller memory footprint than any @ref ports_rtos "QP port to a 3rd-party RTOS". Additionally, QXK is already included in QP, so you avoid additional licensing costs of 3rd-party kernels.
QP/C 6.x includes a small, preemptive, priority-based, @ref srs_qxk "dual-mode blocking QXK kernel" that executes active objects like the QK kernel (@ref srs_qxk_basic "basic threads"), but can also execute traditional blocking threads (@ref srs_qxk_extended "extended threads"). In this respect, QXK behaves exactly like a conventional RTOS. The QXK kernel is recommended as the preferred RTOS kernel for applications that need to mix active objects with traditional blocking code. Due to the tight and optimal integration between QXK and the rest of QP, QXK offers better performance and smaller memory footprint than any @ref ports_rtos "QP port to a 3rd-party RTOS". Additionally, QXK is already included in QP, so you avoid additional licensing costs of 3rd-party kernels.
The QP/C framework can work with virtually any traditional real-time operating
@ -20,6 +20,7 @@ system (RTOS). The currently supported 3rd-party RTOS kernels are:
- @subpage freertos
- @subpage threadx
- @subpage uc-os2
- @subpage zephyr
- <a href="https://www.erika-enterprise.com" target="_blank" class="extern">OSEK/VDX RTOS ERIKA Enterprise</a>
Combined with a conventional RTOS, QP/C takes full advantage of the multitasking capabilities of the RTOS by executing each active object in a separate RTOS task. The QP/C Platform Abstraction Layer (PAL) includes an abstract RTOS interface to enable integration between QP/C and the underlying RTOS. Specifically, the PAL allows adapting most message queue variants as event queues of active objects as well as most memory partitions as QP/C event pools.
@ -30,17 +31,12 @@ Combined with a conventional RTOS, QP/C takes full advantage of the multitasking
/*##########################################################################*/
/*! @page embos embOS
<p>The QP/C/C++ ports and examples for embOS are described in the Quantum Leaps Application Note @webref{doc/AN_RTOS-embOS.pdf, QP and embOS}.
</p>
![SEGGER embOS](logo_embos.png)
@htmlonly
<div class="image">
<a target="_blank" href="https://www.state-machine.com/doc/AN_RTOS-embOS.pdf"><img border="0" src="img/AN.jpg" title="Download PDF"></a>
<div class="caption">
Application Note: QP and embOS
</div>
</div>
@endhtmlonly
The QP/C/C++ ports and examples for embOS are described in the Quantum Leaps Application Note @webref{doc/AN_RTOS-embOS.pdf, QP and embOS}.
[![Application Note: QP and embOS](img/AN.jpg)](https://www.state-machine.com/doc/AN_RTOS-embOS.pdf)
@caption{[Application Note: "QP and embOS"](https://www.state-machine.com/doc/AN_RTOS-embOS.pdf)}
@next{freertos}
*/
@ -48,7 +44,7 @@ Application Note: QP and embOS
/*##########################################################################*/
/*! @page freertos FreeRTOS
@tableofcontents
![FreeRTOS](logo_freertos.png)
@section freertos_about About the QP Port to FreeRTOS
The <span class="img folder">ports/freertos/</span> directory contains a generic platform-independent QP/C port to <a href="https://freertos.org" target="_blank" class="extern">FreeRTOS kernel</a> (version 10). The provided QP port to FreeRTOS has been designed *generically* to rely exclusively on the existing FreeRTOS API. This means that the port should run without changes on any CPU/compiler platform supported by FreeRTOS.
@ -57,7 +53,7 @@ The QP-FreeRTOS port works as follows:
- The QP port uses the [static memory allocation of FreeRTOS](https://freertos.org/Static_Vs_Dynamic_Memory_Allocation.html). This requires the FreeRTOS configuration to define the [configSUPPORT_STATIC_ALLOCATION](https://freertos.org/a00110.html#configSUPPORT_STATIC_ALLOCATION)
- Each QP active object executes in a separate FreeRTOS task and requires a private stack space.
- Each QP active object executes in a separate FreeRTOS task (`StaticTask_t`) and requires a private stack space.
- The task-level critical section used in QF and QS is based on the FreeRTOS APIs `taskENTER_CRITICAL()`/`taskEXIT_CRITICAL()`.
@ -69,9 +65,7 @@ The QP-FreeRTOS port works as follows:
The design of FreeRTOS requires the use of special "FromISR" API inside ISRs, which imposes the requirement to also provide the "FromISR" variants of the QP APIs, such as `QACTIVE_POST_FROM_ISR()`, `QF_PUBLISH_FROM_ISR()`, etc. These "FromISR" QP APIs must be used inside ISRs instead of the task-level APIs (`QACTIVE_POST()`, `QF_PUBLISH()`, etc.) and conversely, they cannot be used inside tasks and active objects. Unfortunately, FreeRTOS provides no generic way to enforce the proper API use via assertions.
- The QP port uses the native event queue (::QEQueue) for active object event queues and internally calls the FreeRTOS API `xTaskNotifyGive()` to notify an active object when an event is posted to its event queue.
- The QP port internally calls the FreeRTOS API `ulTaskNotifyTake(pdTRUE, portMAX_DELAY)` to block an active object task when it waits for posting an event.
- The QP port uses the FreeRTOS message queue (`StaticQueue_t`) for active object event queues.
- The QP port uses the native QF memory pool (::QMPool) to implement event pools.
@ -79,19 +73,18 @@ The design of FreeRTOS requires the use of special "FromISR" API inside ISRs, wh
@section freertos_examples Example Code
The QP port to FreeRTOS comes with examples located in the directory `qpc/examples/freertos/`. Currently, the examples are provided for the following boards and development toolchains:
The QP port to FreeRTOS comes with examples located in the directory `qpc/examples/freertos`. Currently, the examples are provided for the following boards and development toolchains:
- EK-TM4C123GXL (ARM Cortex-M4F), ARM-KEIL, GNU-ARM, IAR-ARM
- STM32F746G-Discovery (ARM Cortex-M7), ARM-KEIL, GNU-ARM, IAR-ARM
@subsection freertos_isr Writing ISRs for QP/FreeRTOS
The provided examples show how to write regular "kernel-aware" ISRs as well as "kernel-unaware" ISRs for QP/FreeRTOS. (See also the FreeRTOS documentation for [configMAX_SYSCALL_INTERRUPT_PRIORITY](https://www.freertos.org/a00110.html#kernel_priority).
Here is an example of a regular "kernel-aware" ISR (note the use of the "FromISR" QP APIs"):
Here is an example of a regular "kernel-aware" ISR (note the use of the `FromISR` suffix in the QP APIs):
@code{c}
@code{.c}
/* NOTE: only the "FromISR" API variants are allowed in the ISRs! */
void GPIOPortA_IRQHandler(void) {
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
@ -107,9 +100,9 @@ void GPIOPortA_IRQHandler(void) {
}
@endcode
Here is an example of a "kernel-unaware" ISR (See also the FreeRTOS documentation for [configMAX_SYSCALL_INTERRUPT_PRIORITY](https://www.freertos.org/a00110.html#kernel_priority):
Here is an example of a "kernel-unaware" ISR (See also the FreeRTOS documentation for [configMAX_SYSCALL_INTERRUPT_PRIORITY](https://www.freertos.org/a00110.html#kernel_priority) ):
@code{c}
@code{.c}
/*
* ISR for receiving bytes from the QSPY Back-End
* NOTE: This ISR is "kernel-unaware" meaning that it does not interact with
@ -132,7 +125,7 @@ void UART0_IRQHandler(void) {
@subsection freertos_hook Writing FreeRTOS Hooks Running in ISR Context
FreeRTOS provides "hooks" that are user functions that execute in the ISR context (e.g., `vApplicationTickHook()`). Such ISR-level functions are closely related to ISRs and should also use exclusively only the "FromISR" APIs. Here is an example of the `vApplicationTickHook()`:
@code{c}
@code{.c}
/* NOTE: only the "FromISR" API variants are allowed in vApplicationTickHook */
void vApplicationTickHook(void) {
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
@ -149,7 +142,7 @@ void vApplicationTickHook(void) {
@subsection freertos_ao Starting Active Objects in QP/FreeRTOS
As mentioned in the @ref freertos_about "FreeRTOS port summary", the QP port to FreeRTOS uses the [static memory allocation of FreeRTOS](https://freertos.org/Static_Vs_Dynamic_Memory_Allocation.html). This means that all memory for an active object, including the private queue buffer and the private **stack** for the the associated FreeRTOS task must be allocated by the user. Here is an example code that starts an active object:
@code{c}
@code{.c}
int main() {
. . .
static QEvt const *tableQueueSto[N_PHILO];
@ -172,36 +165,29 @@ int main() {
@next{threadx}
*/
/*##########################################################################*/
/*! @page threadx ThreadX
<p>The QP/C/C++ ports and examples for ThreadX are described in the Quantum Leaps Application Note @webref{doc/AN_RTOS-ThreadX.pdf, QP and ThreadX}.
</p>
![ThreadX](logo_threadx.jpg)
@htmlonly
<div class="image">
<a target="_blank" href="https://www.state-machine.com/doc/AN_RTOS-ThreadX.pdf"><img border="0" src="img/AN.jpg" title="Download PDF"></a>
<div class="caption">
Application Note: QP and ThreadX
</div>
</div>
@endhtmlonly
The QP/C/C++ ports and examples for ThreadX (now Azure RTOS) are described in the Quantum Leaps Application Note @webref{doc/AN_RTOS-ThreadX.pdf, QP and ThreadX}.
[![Application Note: QP and ThreadX](img/AN.jpg)](https://www.state-machine.com/doc/AN_RTOS-ThreadX.pdf)
@caption{[Application Note: "QP and ThreadX"](https://www.state-machine.com/doc/AN_RTOS-ThreadX.pdf)}
@next{uc-os2}
*/
/*##########################################################################*/
/*! @page uc-os2 uC-OS
/*! @page uc-os2 uC-OS2
![uC-OS2](logo_uc-os2.jpg)
@section uc-os2_about About the QP Port to uC-OS2
This directory contains a generic platform-independent QP/C port to uC-OS2 V2.92.
Typically, you should not need to change the files in this directory to adapt the QP-uC-OS2 port on any CPU/Compiler to which uC-OS2 has been ported, because all the CPU and compiler specifics are handled by the uC-OS2 RTOS.
@note
Currently, the port has been tested only on ARM Cortex-M3 and M4F.
@section uc-os2_source uC-OS2 Source and ARM Cortex-M3/M4 Ports
The uC-OS2 V2.92 source code and ports are located in `3rd_party/uc-os2`. Please make sure to read about uC-OS2 licensing in the README file found in this directory.
@ -254,14 +240,84 @@ Specifically, the QP source files qf_actq.c and qf_mem.c must **NOT** be include
The QP/C/C++ ports and examples for uC-OS2 are described in the Quantum Leaps Application Note @webref{doc/AN_RTOS-uCOS2.pdf, QP and uC-OS2}.
@htmlonly
<div class="image">
<a target="_blank" href="https://www.state-machine.com/doc/AN_RTOS-uCOS2.pdf"><img border="0" src="img/AN.jpg" title="Download PDF"></a>
<div class="caption">
Application Note: QP and uC-OS2
</div>
</div>
@endhtmlonly
[![QP and uC-OS2](img/AN.jpg)](https://www.state-machine.com/doc/AN_RTOS-uCOS2.pdf)
@caption{[Application Note: QP and uC-OS2](https://www.state-machine.com/doc/AN_RTOS-uCOS2.pdf)}
@next{zephyr}
*/
/*##########################################################################*/
/*! @page zephyr Zephyr
![Zephyr Project](logo_zephyr.jpg)
@section zephyr_about About the QP Port to Zephyr
This directory contains a generic platform-independent QP/C port to the [Zephyr RTOS](https://zephyrproject.org).
Typically, you should not need to change the files in this directory to adapt the QP-Zephyr port on any CPU/Compiler to which Zephyr has been ported, because all the CPU and compiler specifics are handled by the Zephyr RTOS.
The QP-Zephyr port works as follows:
- The critical section used in this port is based on `k_spin_lock()/k_spin_unlock()` Zephyr API. This is the modern Zephyr critical section API, which is ready for SMP (symmetric multiprocessing).
- Each QP active object executes in a separate Zephyr thread (`struct k_thread`) and requires a private stack space.
@note
As demonstrated in the @ref exa_zephyr "provided examples", the private stacks for active objects in this port must be allocated with the Zephyr `K_THREAD_STACK_DEFINE()` macro. Also, the stack size passed to QACTIVE_START() must be calculated with the Zephyr `K_THREAD_STACK_SIZEOF()` macro. Failure to use these macros can lead to memory corruption in the application.
- The active object event queue is implemented with the Zephyr message queue (`struct k_msgq`).
@note
The Zephyr message queue currently supports only the FIFO policy and does NOT support the LIFO policy. For that reason, the QActive_postLIFO_() implementation in this port uses the FIFO policy. A feature request has been filed in the Zephyr project for adding the LIFO policy, so perhaps this can be improved, if the feature is added.
- The QP port uses Zephyr scheduler locking (`k_sched_lock()/k_sched_unlock()`), which locks all threads indiscriminately. Currently Zephyr does not provide a selective scheduler locking.
- The QP port uses the native QF memory pool (::QMPool) to implement event pools.
- The QP port does not mandate any specific method to manage the QP time events, but the provided examples use the Zephyr timer (`struct k_timer`) to tick periodically and invoke QF_TICK_X().
@subsection zephyr_build QP Source Files Needed in this QP Port
It is important to note that **NOT** all QP source files should be included. Here is the list of QP source files needed:
@verbatim
qpc/
+-src/
| | +-qf/
| | | +-qep_hsm.c
| | | +-qep_msm.c
| | | +-qf_act.c
| | | +-qf_actq.c - NOT included (implemented in Zephyr)
| | | +-qf_defer.c
| | | +-qf_dyn.c
| | | +-qf_mem.c
| | | +-qf_ps.c
| | | +-qf_qeq.c
| | | +-qf_qmact.c
| | | +-qf_time.c
| |
| | +-qs/
| | | +-qs.c - included only in the Spy build configuration
| | | +-qs_fp.c - included only in the Spy build configuration
|
+-ports
| +-zephyr
| | +-qep_port.h
| | +-qf_port.h
| | +-qf_port.c - implementation of the Zephyr port
| | +-qs_port.h
|
@endverbatim
@note
Specifically, the QP source files qf_actq.c must **NOT** be included in the build, because this functionality is taken from Zephyr.
@section zephyr_exa Examples for the Zephyr port
The example projects for this port are located in @ref exa_zephyr "examples/zephyr".
@next{ports_os}
*/

View File

@ -10,7 +10,7 @@ static void __cdecl run(void *me) { /* the exact signature for _beginthread */
} while (((QActive *)me)->prio > (uint8_t)0);
QActive_unsubscribeAll((QActive *)me); /* unsubscribe from all signals */
QF_remove_((QActive *)me); /* remove this object from any subscriptions */
QActive_unregister_((QActive *)me); /* un-register this active object */
_endthread(); /* cleanup after the thead and close the thread handle */
}

View File

@ -8,14 +8,14 @@ static Bomb l_bomb; /* an instance of Bomb HSM */
int main() {
Bomb_ctor(&l_bomb); /* Bomb "constructor" invokes QFsm_ctor() */
QMSM_INIT(&l_bomb.super, (QEvt *)0); /* trigger initial transition */
QHSM_INIT(&l_bomb.super, (QEvt *)0); /* trigger initial transition */
for (;;) { /* event loop */
QEvt e;
. . .
/* wait for the next event and assign it to the event object e */
. . .
QMSM_DISPATCH(&l_bomb.super, &e); /* dispatch e */
QHSM_DISPATCH(&l_bomb.super, &e); /* dispatch e */
}
return 0; /* never reached, needed for some compilers */
}

View File

@ -8,14 +8,14 @@ static Calc Calc_inst; /* an instance of Calc SM */
int main() {
Calc_ctor(&Calc_inst); /* Calc "constructor" invokes QHsm_ctor() */
QMSM_INIT(&Calc_inst.super, (QEvt *)0); /* trigger initial transition */
QHSM_INIT(&Calc_inst.super, (QEvt *)0); /* trigger initial transition */
for (;;) { /* event loop */
QEvt e;
. . .
/* wait for the next event and assign it to the event object e */
. . .
QMSM_DISPATCH(&Calc_inst.super, &e); /* dispatch e */
QHSM_DISPATCH(&Calc_inst.super, &e); /* dispatch e */
}
return 0;
}

View File

@ -0,0 +1,18 @@
static QState Game_show_logo(Tunnel * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Tunnel::SM::active::show_logo} */
case Q_ENTRY_SIG: {
/* arm periodic time event */
QTimeEvt_armX(&me->blinkTimeEvt,
BSP_TICKS_PER_SEC/2U, /* one-time delay */
BSP_TICKS_PER_SEC/2U); /* interval */
/* arm a one-shot time event */
QTimeEvt_armX(&me->screenTimeEvt,
BSP_TICKS_PER_SEC*5U, /* one-time delay */
0U); /* interval (0 == no interval) */
. . .
status_ = Q_HANDLED();
break;
}
. . .

View File

@ -10,7 +10,7 @@
interrupt void ISR_timer() { /* entered with interrupts disabled in hardware */
QF_INT_ENABLE(); /* enable interrupts */
QF_TICK(&l_ISR_timer); /* <--- call the QF tick processing */
QTIMEEVT_TICK_X(0U, &l_ISR_timer); /* <--- call the QF tick processing */
QF_INT_DISABLE(); /* disable interrupts again */
/* send the EOI instruction to the Interrupt Controller */
@ -21,5 +21,5 @@ interrupt void ISR_timer() { /* entered with interrupts disabled in hardware */
* (nesting of critical sections allowed)
*/
interrupt void ISR_timer() {
QF_TICK(&l_ISR_timer); /* <--- call the QF tick processing */
QTIMEEVT_TICK_X(0U, &l_ISR_timer); /* <--- call the QF tick processing */
}

View File

@ -10,7 +10,7 @@
interrupt void ISR_timer() { /* entered with interrupts disabled in hardware */
QF_INT_ENABLE(); /* enable interrupts */
QF_TICK_X(0U, &l_ISR_timer); /* <--- call the QF tick processing */
QTIMEEVT_TICK_X(0U, &l_ISR_timer); /* <--- call the QF tick processing */
QF_INT_DISABLE(); /* disable interrupts again */
/* send the EOI instruction to the Interrupt Controller */
@ -21,5 +21,5 @@ interrupt void ISR_timer() { /* entered with interrupts disabled in hardware */
* (nesting of critical sections allowed)
*/
interrupt void ISR_timer() {
QF_TICK_X(1U, &l_ISR_timer); /* <--- call the QF tick processing */
QTIMEEVT_TICK_X(1U, &l_ISR_timer); /* <--- call the QF tick processing */
}

View File

@ -0,0 +1,6 @@
Philo Philo_inst[N_PHILO];
. . .
for (uint8_t n = 0U; n < N_PHILO; ++n) {
QS_OBJ_ARR_DICTIONARY(&Philo_inst[n], n);
QS_OBJ_ARR_DICTIONARY(&Philo_inst[n].timeEvt, n);
}

View File

@ -0,0 +1,5 @@
![STM32 EFM32-SLSTK3401A](../../../doxygen/images/bd_EFM32-SLSTK3401A.jpg)
Documentation for this example is available in the QP/C Manual at:
- https://www.state-machine.com/qpc/arm-cm_blinky_efm32-slstk3401a.html

View File

@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>3</nTsel>
<nTsel>4</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>

View File

@ -10,13 +10,13 @@
<TargetName>blinky-dbg</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>EFM32PG1B200F256GM48</Device>
<Vendor>Silicon Labs</Vendor>
<PackID>SiliconLabs.EFM32PG1B_DFP.5.5.0</PackID>
<PackID>SiliconLabs.GeckoPlatform_EFM32PG1B_DFP.4.0.0</PackID>
<PackURL>https://www.silabs.com/documents/public/cmsis-packs/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IROM(0x00000000,0x00020000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -339,7 +339,7 @@
<MiscControls></MiscControls>
<Define>EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -641,7 +641,7 @@
<TargetCommonOption>
<Device>EFM32PG1B200F256GM48</Device>
<Vendor>Silicon Labs</Vendor>
<PackID>SiliconLabs.EFM32PG1B_DFP.5.5.0</PackID>
<PackID>SiliconLabs.GeckoPlatform_EFM32PG1B_DFP.4.0.0</PackID>
<PackURL>https://www.silabs.com/documents/public/cmsis-packs/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IROM(0x00000000,0x00020000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -964,7 +964,7 @@
<MiscControls></MiscControls>
<Define>NDEBUG EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -1266,7 +1266,7 @@
<TargetCommonOption>
<Device>EFM32PG1B200F256GM48</Device>
<Vendor>Silicon Labs</Vendor>
<PackID>SiliconLabs.EFM32PG1B_DFP.5.5.0</PackID>
<PackID>SiliconLabs.GeckoPlatform_EFM32PG1B_DFP.4.0.0</PackID>
<PackURL>https://www.silabs.com/documents/public/cmsis-packs/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IROM(0x00000000,0x00020000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -1589,7 +1589,7 @@
<MiscControls></MiscControls>
<Define>Q_SPY EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>

View File

@ -62,7 +62,7 @@ void SysTick_Handler(void);
/* ISRs used in this project ===============================================*/
void SysTick_Handler(void) {
QK_ISR_ENTRY(); /* inform QK about entering an ISR */
QF_TICK_X(0U, (void *)0); /* process time events for rate 0 */
QTIMEEVT_TICK_X(0U, (void *)0); /* process time events for rate 0 */
QK_ISR_EXIT(); /* inform QK about exiting an ISR */
}

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C on EMF32-SLSTK3401A, QK kernel, GNU-ARM
# Last Updated for Version: 7.0.0
# Date of the Last Update: 2021-07-01
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
#
# Q u a n t u m L e a P s
# ------------------------
@ -80,7 +80,6 @@ VPATH = \
INCLUDES = \
-I../.. \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/efm32pg1b

View File

@ -339,7 +339,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -1361,7 +1360,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -2383,7 +2381,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>

View File

@ -338,7 +338,7 @@
<MiscControls></MiscControls>
<Define>EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -962,7 +962,7 @@
<MiscControls></MiscControls>
<Define>NDEBUG EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -1586,7 +1586,7 @@
<MiscControls></MiscControls>
<Define>Q_SPY EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>

View File

@ -61,7 +61,7 @@ void SysTick_Handler(void);
/* ISRs used in this project ===============================================*/
void SysTick_Handler(void) {
QF_TICK_X(0U, (void *)0); /* process time events for rate 0 */
QTIMEEVT_TICK_X(0U, (void *)0); /* process time events for rate 0 */
QV_ARM_ERRATUM_838869();
}

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C on EMF32-SLSTK3401A, QV kernel, GNU-ARM
# Last Updated for Version: 7.0.0
# Date of the Last Update: 2021-07-01
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
#
# Q u a n t u m L e a P s
# ------------------------
@ -80,7 +80,6 @@ VPATH = \
INCLUDES = \
-I../.. \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/efm32pg1b

View File

@ -352,7 +352,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qv\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -1419,7 +1418,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qv\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -2486,7 +2484,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qv\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>

View File

@ -0,0 +1,5 @@
![STM32 EFM32-SLSTK3401A](../../../doxygen/images/bd_EK-TM4C123GXL.jpg)
Documentation for this example is available in the QP/C Manual at:
- https://www.state-machine.com/qpc/arm-cm_blinky_ek-tm4c123gxl.html

View File

@ -338,7 +338,7 @@
<MiscControls></MiscControls>
<Define>__FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -957,7 +957,7 @@
<MiscControls></MiscControls>
<Define>NDEBUG __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -1576,7 +1576,7 @@
<MiscControls></MiscControls>
<Define>Q_SPY __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
</VariousControls>
</Cads>
<Aads>

View File

@ -62,7 +62,7 @@ void GPIOPortA_IRQHandler(void);
/* ISRs used in this project ===============================================*/
void SysTick_Handler(void) {
QK_ISR_ENTRY(); /* inform QK about entering an ISR */
QF_TICK_X(0U, (void *)0); /* process time events for rate 0 */
QTIMEEVT_TICK_X(0U, (void *)0); /* process time events for rate 0 */
QK_ISR_EXIT(); /* inform QK about exiting an ISR */
}

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C on EK-TM4C123GXL, QK kernel, GNU-ARM
# Last Updated for Version: 7.0.0
# Date of the Last Update: 2021-07-01
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
#
# Q u a n t u m L e a P s
# ------------------------
@ -80,7 +80,6 @@ VPATH = \
INCLUDES = \
-I../.. \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/ek-tm4c123gxl

View File

@ -339,7 +339,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\ek-tm4c123gxl</state>
@ -1360,7 +1359,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\ek-tm4c123gxl</state>
@ -2381,7 +2379,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\ek-tm4c123gxl</state>

View File

@ -339,7 +339,7 @@
<MiscControls></MiscControls>
<Define>__FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -959,7 +959,7 @@
<MiscControls></MiscControls>
<Define>NDEBUG __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -1579,7 +1579,7 @@
<MiscControls></MiscControls>
<Define>Q_SPY __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
</VariousControls>
</Cads>
<Aads>

View File

@ -61,7 +61,7 @@ void GPIOPortA_IRQHandler(void);
/* ISRs used in this project ===============================================*/
void SysTick_Handler(void) {
QF_TICK_X(0U, (void *)0); /* process time events for rate 0 */
QTIMEEVT_TICK_X(0U, (void *)0); /* process time events for rate 0 */
QV_ARM_ERRATUM_838869();
}

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C on EK-TM4C123GXL, QV kernel, GNU-ARM
# Last Updated for Version: 7.0.0
# Date of the Last Update: 2021-07-01
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
#
# Q u a n t u m L e a P s
# ------------------------
@ -80,7 +80,6 @@ VPATH = \
INCLUDES = \
-I../.. \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/ek-tm4c123gxl

View File

@ -317,7 +317,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qv\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\ek-tm4c123gxl</state>
@ -1287,7 +1286,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qv\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\ek-tm4c123gxl</state>
@ -2257,7 +2255,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qv\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\ek-tm4c123gxl</state>

View File

@ -0,0 +1,5 @@
![STM32 EFM32-SLSTK3401A](../../../doxygen/images/bd_EFM32-SLSTK3401A.jpg)
Documentation for this example is available in the QP/C Manual at:
- https://www.state-machine.com/qpc/arm-cm_dpp_efm32-slstk3401a.html

View File

@ -1,21 +1,33 @@
/*.$file${.::dpp.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$file${.::dpp.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*
* Model: dpp.qm
* File: ${.::dpp.h}
*
* This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
* This code has been generated by QM 5.2.1 <www.state-machine.com/qm>.
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation.
* SPDX-License-Identifier: GPL-3.0-or-later
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
* This generated code is open source software: you can redistribute it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* NOTE:
* Alternatively, this generated code may be distributed under the terms
* of Quantum Leaps commercial licenses, which expressly supersede the GNU
* General Public License and are specifically designed for licensees
* interested in retaining the proprietary status of their code.
*
* Contact information:
* <www.state-machine.com/licensing>
* <info@state-machine.com>
*/
/*.$endhead${.::dpp.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$endhead${.::dpp.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#ifndef DPP_H
#define DPP_H
@ -36,8 +48,9 @@ enum {
N_PHILO = 5 /* number of Philos */
};
/*.$declare${Events::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${Events::TableEvt} .....................................................*/
/*$declare${Events::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${Events::TableEvt} ......................................................*/
typedef struct {
/* protected: */
QEvt super;
@ -45,26 +58,30 @@ typedef struct {
/* public: */
uint8_t philoNum;
} TableEvt;
/*.$enddecl${Events::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table_ctor} ......................................................*/
void Table_ctor(void);
/*.$enddecl${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$enddecl${Events::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$declare${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Table_ctor} .......................................................*/
void Table_ctor(void);
/*$enddecl${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$declare${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::AO_Table} .........................................................*/
/* opaque pointer to the Table AO */
extern QActive * const AO_Table;
/*.$enddecl${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddecl${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo_ctor} ......................................................*/
/*$declare${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Philo_ctor} .......................................................*/
void Philo_ctor(uint8_t n);
/*.$enddecl${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$enddecl${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$declare${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::AO_Philo[N_PHILO]} ................................................*/
/* opaque pointers to the Philo AOs */
extern QActive * const AO_Philo[N_PHILO];
/*.$enddecl${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddecl${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#ifdef QXK_H
void Test1_ctor(void);
@ -74,3 +91,4 @@ extern QActive * const AO_Philo[N_PHILO];
#endif /* QXK_H */
#endif /* DPP_H */

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.1.3" links="1">
<documentation>Dining Philosopher Problem example
NOTE: Requries QP5.</documentation>
<model version="5.2.1" links="1">
<documentation>Dining Philosopher Problem example</documentation>
<!--${qpc}-->
<framework name="qpc"/>
<!--${Events}-->
@ -111,7 +110,7 @@ Q_ASSERT_ID(20, Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
<entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
<exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
pe-&gt;philoNum = PHILO_ID(me);
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
QACTIVE_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
QTimeEvt_disarm(&amp;me-&gt;timeEvt);</exit>
<!--${AOs::Philo::SM::eating::TIMEOUT}-->
<tran trig="TIMEOUT" target="../../1">
@ -190,7 +189,7 @@ for (n = 0U; n &lt; N_PHILO; ++n) { /* give permissions to eat... */
me-&gt;fork[n] = USED;
te = Q_NEW(TableEvt, EAT_SIG);
te-&gt;philoNum = n;
QF_PUBLISH(&amp;te-&gt;super, &amp;me-&gt;super);
QACTIVE_PUBLISH(&amp;te-&gt;super, &amp;me-&gt;super);
me-&gt;isHungry[n] = 0U;
BSP_displayPhilStat(n, &quot;eating &quot;);
}
@ -213,7 +212,7 @@ me-&gt;fork[m] = USED;
me-&gt;fork[n] = USED;
pe = Q_NEW(TableEvt, EAT_SIG);
pe-&gt;philoNum = n;
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
QACTIVE_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
BSP_displayPhilStat(n, &quot;eating &quot;);</action>
<choice_glyph conn="19,26,5,-1,10">
<action box="1,0,10,2"/>
@ -255,7 +254,7 @@ if ((me-&gt;isHungry[m] != 0U) &amp;&amp; (me-&gt;fork[m] == FREE)) {
me-&gt;isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe-&gt;philoNum = m;
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
QACTIVE_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
BSP_displayPhilStat(m, &quot;eating &quot;);
}
m = LEFT(n); /* check the left neighbor */
@ -266,7 +265,7 @@ if ((me-&gt;isHungry[m] != 0U) &amp;&amp; (me-&gt;fork[n] == FREE)) {
me-&gt;isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe-&gt;philoNum = m;
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
QACTIVE_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
BSP_displayPhilStat(m, &quot;eating &quot;);
}</action>
<tran_glyph conn="4,34,3,-1,15">

View File

@ -1,21 +1,33 @@
/*.$file${.::philo.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$file${.::philo.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*
* Model: dpp.qm
* File: ${.::philo.c}
*
* This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
* This code has been generated by QM 5.2.1 <www.state-machine.com/qm>.
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation.
* SPDX-License-Identifier: GPL-3.0-or-later
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
* This generated code is open source software: you can redistribute it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* NOTE:
* Alternatively, this generated code may be distributed under the terms
* of Quantum Leaps commercial licenses, which expressly supersede the GNU
* General Public License and are specifically designed for licensees
* interested in retaining the proprietary status of their code.
*
* Contact information:
* <www.state-machine.com/licensing>
* <info@state-machine.com>
*/
/*.$endhead${.::philo.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$endhead${.::philo.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#include "qpc.h"
#include "dpp.h"
#include "bsp.h"
@ -23,8 +35,9 @@
Q_DEFINE_THIS_MODULE("philo")
/* Active object class -----------------------------------------------------*/
/*.$declare${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo} ...........................................................*/
/*$declare${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Philo} ............................................................*/
typedef struct Philo {
/* protected: */
QActive super;
@ -41,7 +54,7 @@ static QState Philo_initial(Philo * const me, void const * const par);
static QState Philo_thinking(Philo * const me, QEvt const * const e);
static QState Philo_hungry(Philo * const me, QEvt const * const e);
static QState Philo_eating(Philo * const me, QEvt const * const e);
/*.$enddecl${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddecl${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/* helper macros to provide a randomized think time for Philos */
#define THINK_TIME \
@ -53,16 +66,16 @@ static QState Philo_eating(Philo * const me, QEvt const * const e);
#define PHILO_ID(me_) ((uint8_t)((me_) - &Philo_inst[0]))
/* Global objects ----------------------------------------------------------*/
/*.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*. Check for the minimum required QP version */
/*$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/* Check for the minimum required QP version */
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpc version 6.9.0 or higher required
#endif
/*.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/* opaque pointers to the Philo AOs */
/*.${AOs::AO_Philo[N_PHILO]} ...............................................*/
/*$define${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::AO_Philo[N_PHILO]} ................................................*/
QActive * const AO_Philo[N_PHILO] = {
&Philo_inst[0].super,
&Philo_inst[1].super,
@ -70,23 +83,26 @@ QActive * const AO_Philo[N_PHILO] = {
&Philo_inst[3].super,
&Philo_inst[4].super
};
/*.$enddef${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddef${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/* Philo definition --------------------------------------------------------*/
/*.$define${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo_ctor} ......................................................*/
/*$define${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Philo_ctor} .......................................................*/
void Philo_ctor(uint8_t n) {
Philo *me = &Philo_inst[n];
QActive_ctor(&me->super, Q_STATE_CAST(&Philo_initial));
QTimeEvt_ctorX(&me->timeEvt, &me->super, TIMEOUT_SIG, 0U);
}
/*.$enddef${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo} ...........................................................*/
/*$enddef${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$define${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Philo} ............................................................*/
Philo Philo_inst[N_PHILO];
/*.${AOs::Philo::SM} .......................................................*/
/*${AOs::Philo::SM} ........................................................*/
static QState Philo_initial(Philo * const me, void const * const par) {
/*.${AOs::Philo::SM::initial} */
/*${AOs::Philo::SM::initial} */
(void)par; /* unused parameter */
static bool registered = false;
@ -114,28 +130,29 @@ static QState Philo_initial(Philo * const me, void const * const par) {
QActive_subscribe(&me->super, TEST_SIG);
return Q_TRAN(&Philo_thinking);
}
/*.${AOs::Philo::SM::thinking} .............................................*/
/*${AOs::Philo::SM::thinking} ..............................................*/
static QState Philo_thinking(Philo * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Philo::SM::thinking} */
/*${AOs::Philo::SM::thinking} */
case Q_ENTRY_SIG: {
QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::thinking} */
/*${AOs::Philo::SM::thinking} */
case Q_EXIT_SIG: {
QTimeEvt_disarm(&me->timeEvt);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::thinking::TIMEOUT} */
/*${AOs::Philo::SM::thinking::TIMEOUT} */
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Philo_hungry);
break;
}
/*.${AOs::Philo::SM::thinking::EAT, DONE} */
/*${AOs::Philo::SM::thinking::EAT, DONE} */
case EAT_SIG: /* intentionally fall through */
case DONE_SIG: {
/* EAT or DONE must be for other Philos than this one */
@ -150,11 +167,12 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
}
return status_;
}
/*.${AOs::Philo::SM::hungry} ...............................................*/
/*${AOs::Philo::SM::hungry} ................................................*/
static QState Philo_hungry(Philo * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Philo::SM::hungry} */
/*${AOs::Philo::SM::hungry} */
case Q_ENTRY_SIG: {
TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
pe->philoNum = PHILO_ID(me);
@ -162,9 +180,9 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::hungry::EAT} */
/*${AOs::Philo::SM::hungry::EAT} */
case EAT_SIG: {
/*.${AOs::Philo::SM::hungry::EAT::[Q_EVT_CAST(TableEvt)->philoNum=~} */
/*${AOs::Philo::SM::hungry::EAT::[Q_EVT_CAST(TableEvt)->philoNum=~} */
if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
status_ = Q_TRAN(&Philo_eating);
}
@ -173,7 +191,7 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
}
break;
}
/*.${AOs::Philo::SM::hungry::DONE} */
/*${AOs::Philo::SM::hungry::DONE} */
case DONE_SIG: {
/* DONE must be for other Philos than this one */
Q_ASSERT_ID(20, Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
@ -187,31 +205,32 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
}
return status_;
}
/*.${AOs::Philo::SM::eating} ...............................................*/
/*${AOs::Philo::SM::eating} ................................................*/
static QState Philo_eating(Philo * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Philo::SM::eating} */
/*${AOs::Philo::SM::eating} */
case Q_ENTRY_SIG: {
QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::eating} */
/*${AOs::Philo::SM::eating} */
case Q_EXIT_SIG: {
TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
pe->philoNum = PHILO_ID(me);
QF_PUBLISH(&pe->super, &me->super);
QACTIVE_PUBLISH(&pe->super, &me->super);
QTimeEvt_disarm(&me->timeEvt);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::eating::TIMEOUT} */
/*${AOs::Philo::SM::eating::TIMEOUT} */
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Philo_thinking);
break;
}
/*.${AOs::Philo::SM::eating::EAT, DONE} */
/*${AOs::Philo::SM::eating::EAT, DONE} */
case EAT_SIG: /* intentionally fall through */
case DONE_SIG: {
/* EAT or DONE must be for other Philos than this one */
@ -226,4 +245,4 @@ static QState Philo_eating(Philo * const me, QEvt const * const e) {
}
return status_;
}
/*.$enddef${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddef${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/

View File

@ -10,7 +10,7 @@
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<tExt>*.txt; *.h; *.inc; *.md</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>3</nTsel>
<nTsel>4</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@ -117,6 +117,11 @@
<pMon>Segger\JL2CM3.dll</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
<Key>JL2CM3</Key>
@ -135,7 +140,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGTARM</Key>
<Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
<Name>(1010=1121,593,1571,1150,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@ -975,7 +980,7 @@
<GroupNumber>4</GroupNumber>
<FileNumber>30</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>..\..\..\..\..\ports\arm-cm\qk\armclang\qk_port.c</PathWithFileName>

View File

@ -10,13 +10,13 @@
<TargetName>dpp-dbg</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>EFM32PG1B200F256GM48</Device>
<Vendor>Silicon Labs</Vendor>
<PackID>SiliconLabs.EFM32PG1B_DFP.5.5.0</PackID>
<PackID>SiliconLabs.GeckoPlatform_EFM32PG1B_DFP.4.0.0</PackID>
<PackURL>https://www.silabs.com/documents/public/cmsis-packs/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IROM(0x00000000,0x00020000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -185,6 +185,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -338,7 +339,7 @@
<MiscControls></MiscControls>
<Define>EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -351,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -546,6 +547,57 @@
<FileName>qk_port.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\ports\arm-cm\qk\armclang\qk_port.c</FilePath>
<FileOption>
<CommonProperty>
<UseCPPCompiler>2</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>2</IncludeInBuild>
<AlwaysBuild>2</AlwaysBuild>
<GenerateAssemblyFile>2</GenerateAssemblyFile>
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds>
<Cads>
<interw>2</interw>
<Optim>0</Optim>
<oTime>2</oTime>
<SplitLS>2</SplitLS>
<OneElfS>2</OneElfS>
<Strict>2</Strict>
<EnumInt>2</EnumInt>
<PlainCh>2</PlainCh>
<Ropi>2</Ropi>
<Rwpi>2</Rwpi>
<wLevel>0</wLevel>
<uThumb>2</uThumb>
<uSurpInc>2</uSurpInc>
<uC99>2</uC99>
<uGnu>2</uGnu>
<useXO>2</useXO>
<v6Lang>0</v6Lang>
<v6LangP>0</v6LangP>
<vShortEn>2</vShortEn>
<vShortWch>2</vShortWch>
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>QK_USE_IRQ_NUM=25 QK_USE_IRQ_HANDLER=CRYPTO_IRQHandler</Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
</File>
<File>
<FileName>qk_port.h</FileName>
@ -620,7 +672,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -665,7 +717,7 @@
<TargetCommonOption>
<Device>EFM32PG1B200F256GM48</Device>
<Vendor>Silicon Labs</Vendor>
<PackID>SiliconLabs.EFM32PG1B_DFP.5.5.0</PackID>
<PackID>SiliconLabs.GeckoPlatform_EFM32PG1B_DFP.4.0.0</PackID>
<PackURL>https://www.silabs.com/documents/public/cmsis-packs/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IROM(0x00000000,0x00020000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -834,6 +886,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -987,7 +1040,7 @@
<MiscControls></MiscControls>
<Define>NDEBUG EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -1000,7 +1053,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>
@ -1269,7 +1322,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1314,7 +1367,7 @@
<TargetCommonOption>
<Device>EFM32PG1B200F256GM48</Device>
<Vendor>Silicon Labs</Vendor>
<PackID>SiliconLabs.EFM32PG1B_DFP.5.5.0</PackID>
<PackID>SiliconLabs.GeckoPlatform_EFM32PG1B_DFP.4.0.0</PackID>
<PackURL>https://www.silabs.com/documents/public/cmsis-packs/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IROM(0x00000000,0x00020000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -1483,6 +1536,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1636,7 +1690,7 @@
<MiscControls></MiscControls>
<Define>Q_SPY EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -1649,7 +1703,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=1024 Heap_Size=16</Define>

View File

@ -96,7 +96,7 @@ void SysTick_Handler(void) {
}
#endif
//QF_TICK_X(0U, &l_SysTick_Handler); /* process time events for rate 0 */
//QTIMEEVT_TICK_X(0U, &l_SysTick_Handler); /* process time events for rate 0 */
QACTIVE_POST(the_Ticker0, 0, &l_SysTick_Handler); /* post to Ticker0 */
/* Perform the debouncing of buttons. The algorithm for debouncing
@ -112,11 +112,11 @@ void SysTick_Handler(void) {
if ((tmp & (1U << PB0_PIN)) != 0U) { /* debounced PB0 state changed? */
if ((buttons.depressed & (1U << PB0_PIN)) != 0U) { /* PB0 depressed?*/
static QEvt const pauseEvt = { PAUSE_SIG, 0U, 0U};
QF_PUBLISH(&pauseEvt, &l_SysTick_Handler);
QACTIVE_PUBLISH(&pauseEvt, &l_SysTick_Handler);
}
else { /* the button is released */
static QEvt const serveEvt = { SERVE_SIG, 0U, 0U};
QF_PUBLISH(&serveEvt, &l_SysTick_Handler);
QACTIVE_PUBLISH(&serveEvt, &l_SysTick_Handler);
}
}

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C on EMF32-SLSTK3401A, QK kernel, GNU-ARM
# Last Updated for Version: 7.0.0
# Date of the Last Update: 2021-07-01
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
#
# Q u a n t u m L e a P s
# ------------------------
@ -80,7 +80,6 @@ VPATH = \
INCLUDES = \
-I../.. \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/efm32pg1b
@ -138,7 +137,9 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES := -DEFM32PG1B200F256GM48=1
DEFINES := -DEFM32PG1B200F256GM48=1 \
-DQK_USE_IRQ_NUM=25 \
-DQK_USE_IRQ_HANDLER=CRYPTO_IRQHandler
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -338,7 +338,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -1392,7 +1391,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -2446,7 +2444,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -3259,6 +3256,255 @@
<name>QP_port</name>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar\qk_port.c</name>
<configuration>
<name>Debug</name>
<settings>
<name>ICCARM</name>
<data>
<version>37</version>
<wantNonLocal>0</wantNonLocal>
<debug>1</debug>
<option>
<name>CCOptimizationNoSizeConstraints</name>
<state>0</state>
</option>
<option>
<name>CCDefines</name>
<state>EFM32PG1B200F256GM48</state>
<state>QK_USE_IRQ_NUM=25</state>
<state>QK_USE_IRQ_HANDLER=CRYPTO_IRQHandler</state>
</option>
<option>
<name>CCPreprocFile</name>
<state>0</state>
</option>
<option>
<name>CCPreprocComments</name>
<state>0</state>
</option>
<option>
<name>CCPreprocLine</name>
<state>0</state>
</option>
<option>
<name>CCListCFile</name>
<state>0</state>
</option>
<option>
<name>CCListCMnemonics</name>
<state>0</state>
</option>
<option>
<name>CCListCMessages</name>
<state>0</state>
</option>
<option>
<name>CCListAssFile</name>
<state>0</state>
</option>
<option>
<name>CCListAssSource</name>
<state>0</state>
</option>
<option>
<name>CCEnableRemarks</name>
<state>0</state>
</option>
<option>
<name>CCDiagSuppress</name>
<state>Pa050</state>
</option>
<option>
<name>CCDiagRemark</name>
<state></state>
</option>
<option>
<name>CCDiagWarning</name>
<state></state>
</option>
<option>
<name>CCDiagError</name>
<state></state>
</option>
<option>
<name>CCObjPrefix</name>
<state>1</state>
</option>
<option>
<name>CCAllowList</name>
<version>1</version>
<state>11111110</state>
</option>
<option>
<name>CCDebugInfo</name>
<state>1</state>
</option>
<option>
<name>IEndianMode</name>
<state>1</state>
</option>
<option>
<name>IProcessor</name>
<state>1</state>
</option>
<option>
<name>IExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>IExtraOptions</name>
<state></state>
</option>
<option>
<name>CCLangConformance</name>
<state>0</state>
</option>
<option>
<name>CCSignedPlainChar</name>
<state>1</state>
</option>
<option>
<name>CCRequirePrototypes</name>
<state>1</state>
</option>
<option>
<name>CCDiagWarnAreErr</name>
<state>0</state>
</option>
<option>
<name>CCCompilerRuntimeInfo</name>
<state>0</state>
</option>
<option>
<name>IFpuProcessor</name>
<state>1</state>
</option>
<option>
<name>OutputFile</name>
<state>$FILE_BNAME$.o</state>
</option>
<option>
<name>CCLibConfigHeader</name>
<state>1</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
</option>
<option>
<name>CCStdIncCheck</name>
<state>0</state>
</option>
<option>
<name>CCCodeSection</name>
<state>.text</state>
</option>
<option>
<name>IProcessorMode2</name>
<state>1</state>
</option>
<option>
<name>CCOptLevel</name>
<state>3</state>
</option>
<option>
<name>CCOptStrategy</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCOptLevelSlave</name>
<state>3</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
</option>
<option>
<name>CCPosIndRwpi</name>
<state>0</state>
</option>
<option>
<name>CCPosIndNoDynInit</name>
<state>0</state>
</option>
<option>
<name>IccLang</name>
<state>2</state>
</option>
<option>
<name>IccCDialect</name>
<state>1</state>
</option>
<option>
<name>IccAllowVLA</name>
<state>0</state>
</option>
<option>
<name>IccStaticDestr</name>
<state>1</state>
</option>
<option>
<name>IccCppInlineSemantics</name>
<state>1</state>
</option>
<option>
<name>IccCmsis</name>
<state>1</state>
</option>
<option>
<name>IccFloatSemantics</name>
<state>0</state>
</option>
<option>
<name>CCNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>CCOptStrategySlave</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCEncSource</name>
<state>0</state>
</option>
<option>
<name>CCEncOutput</name>
<state>0</state>
</option>
<option>
<name>CCEncOutputBom</name>
<state>1</state>
</option>
<option>
<name>CCEncInput</name>
<state>0</state>
</option>
<option>
<name>IccExceptions2</name>
<state>0</state>
</option>
<option>
<name>IccRTTI2</name>
<state>0</state>
</option>
<option>
<name>CCStackProtection</name>
<state>0</state>
</option>
</data>
</settings>
</configuration>
</file>
</group>
<group>

View File

@ -338,7 +338,7 @@
<MiscControls></MiscControls>
<Define>EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -987,7 +987,7 @@
<MiscControls></MiscControls>
<Define>NDEBUG EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -1636,7 +1636,7 @@
<MiscControls></MiscControls>
<Define>Q_SPY EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qv\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>

View File

@ -94,7 +94,7 @@ void SysTick_Handler(void) {
}
#endif
//QF_TICK_X(0U, &l_SysTick_Handler); /* process time events for rate 0 */
//QTIMEEVT_TICK_X(0U, &l_SysTick_Handler); /* process time events for rate 0 */
QACTIVE_POST(the_Ticker0, 0, &l_SysTick_Handler); /* post to Ticker0 */
/* Perform the debouncing of buttons. The algorithm for debouncing
@ -110,11 +110,11 @@ void SysTick_Handler(void) {
if ((tmp & (1U << PB0_PIN)) != 0U) { /* debounced PB0 state changed? */
if ((buttons.depressed & (1U << PB0_PIN)) != 0U) { /* PB0 depressed?*/
static QEvt const pauseEvt = { PAUSE_SIG, 0U, 0U};
QF_PUBLISH(&pauseEvt, &l_SysTick_Handler);
QACTIVE_PUBLISH(&pauseEvt, &l_SysTick_Handler);
}
else { /* the button is released */
static QEvt const serveEvt = { SERVE_SIG, 0U, 0U};
QF_PUBLISH(&serveEvt, &l_SysTick_Handler);
QACTIVE_PUBLISH(&serveEvt, &l_SysTick_Handler);
}
}
QV_ARM_ERRATUM_838869();

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C on EMF32-SLSTK3401A, QV kernel, GNU-ARM
# Last Updated for Version: 7.0.0
# Date of the Last Update: 2021-07-01
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
#
# Q u a n t u m L e a P s
# ------------------------
@ -80,7 +80,6 @@ VPATH = \
INCLUDES = \
-I../.. \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/efm32pg1b

View File

@ -339,7 +339,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qv\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -1361,7 +1360,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qv\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -2383,7 +2381,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qv\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>

View File

@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>3</nTsel>
<nTsel>4</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
@ -120,7 +120,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>DLGUARM</Key>
<Name>/</Name>
<Name></Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
@ -491,7 +491,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>3</nTsel>
<nTsel>4</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>

View File

@ -16,7 +16,7 @@
<TargetCommonOption>
<Device>EFM32PG1B200F256GM48</Device>
<Vendor>Silicon Labs</Vendor>
<PackID>SiliconLabs.EFM32PG1B_DFP.5.5.0</PackID>
<PackID>SiliconLabs.GeckoPlatform_EFM32PG1B_DFP.4.0.0</PackID>
<PackURL>https://www.silabs.com/documents/public/cmsis-packs/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IROM(0x00000000,0x00020000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -339,7 +339,7 @@
<MiscControls></MiscControls>
<Define>EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qxk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qxk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -572,6 +572,57 @@
<FileName>qxk_port.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\..\ports\arm-cm\qxk\armclang\qxk_port.c</FilePath>
<FileOption>
<CommonProperty>
<UseCPPCompiler>2</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>2</IncludeInBuild>
<AlwaysBuild>2</AlwaysBuild>
<GenerateAssemblyFile>2</GenerateAssemblyFile>
<AssembleAssemblyFile>2</AssembleAssemblyFile>
<PublicsOnly>2</PublicsOnly>
<StopOnExitCode>11</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
<ComprImg>1</ComprImg>
</CommonProperty>
<FileArmAds>
<Cads>
<interw>2</interw>
<Optim>0</Optim>
<oTime>2</oTime>
<SplitLS>2</SplitLS>
<OneElfS>2</OneElfS>
<Strict>2</Strict>
<EnumInt>2</EnumInt>
<PlainCh>2</PlainCh>
<Ropi>2</Ropi>
<Rwpi>2</Rwpi>
<wLevel>0</wLevel>
<uThumb>2</uThumb>
<uSurpInc>2</uSurpInc>
<uC99>2</uC99>
<uGnu>2</uGnu>
<useXO>2</useXO>
<v6Lang>0</v6Lang>
<v6LangP>0</v6LangP>
<vShortEn>2</vShortEn>
<vShortWch>2</vShortWch>
<v6Lto>2</v6Lto>
<v6WtE>2</v6WtE>
<v6Rtti>2</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>QXK_USE_IRQ_NUM=25 QXK_USE_IRQ_HANDLER=CRYPTO_IRQHandler</Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
</File>
<File>
<FileName>qxk_port.h</FileName>
@ -686,7 +737,7 @@
<TargetCommonOption>
<Device>EFM32PG1B200F256GM48</Device>
<Vendor>Silicon Labs</Vendor>
<PackID>SiliconLabs.EFM32PG1B_DFP.5.5.0</PackID>
<PackID>SiliconLabs.GeckoPlatform_EFM32PG1B_DFP.4.0.0</PackID>
<PackURL>https://www.silabs.com/documents/public/cmsis-packs/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IROM(0x00000000,0x00020000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -1009,7 +1060,7 @@
<MiscControls></MiscControls>
<Define>NDEBUG EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qxk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qxk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -1350,13 +1401,13 @@
<TargetName>dpp-spy</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6070000::V6.7::.\ARMCLANG</pCCUsed>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
<Device>EFM32PG1B200F256GM48</Device>
<Vendor>Silicon Labs</Vendor>
<PackID>SiliconLabs.EFM32PG1B_DFP.5.5.0</PackID>
<PackID>SiliconLabs.GeckoPlatform_EFM32PG1B_DFP.4.0.0</PackID>
<PackURL>https://www.silabs.com/documents/public/cmsis-packs/</PackURL>
<Cpu>IRAM(0x20000000,0x00008000) IROM(0x00000000,0x00020000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
@ -1679,7 +1730,7 @@
<MiscControls></MiscControls>
<Define>Q_SPY EFM32PG1B200F256GM48=1 __FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qxk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qxk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\efm32pg1b</IncludePath>
</VariousControls>
</Cads>
<Aads>

View File

@ -97,7 +97,7 @@ void SysTick_Handler(void) {
}
#endif
/*QF_TICK_X(0U, &l_SysTick_Handler);*/ /* process time events for rate 0 */
/*QTIMEEVT_TICK_X(0U, &l_SysTick_Handler);*/ /* process time events for rate 0 */
QACTIVE_POST(the_Ticker0, 0, &l_SysTick_Handler); /* post to Ticker0 */
/* Perform the debouncing of buttons. The algorithm for debouncing
@ -113,11 +113,11 @@ void SysTick_Handler(void) {
if ((tmp & (1U << PB0_PIN)) != 0U) { /* debounced PB0 state changed? */
if ((buttons.depressed & (1U << PB0_PIN)) != 0U) { /* PB0 depressed?*/
static QEvt const pauseEvt = { PAUSE_SIG, 0U, 0U};
QF_PUBLISH(&pauseEvt, &l_SysTick_Handler);
QACTIVE_PUBLISH(&pauseEvt, &l_SysTick_Handler);
}
else { /* the button is released */
static QEvt const serveEvt = { SERVE_SIG, 0U, 0U};
QF_PUBLISH(&serveEvt, &l_SysTick_Handler);
QACTIVE_PUBLISH(&serveEvt, &l_SysTick_Handler);
}
}
@ -131,7 +131,7 @@ void GPIO_EVEN_IRQHandler(void) { /* for testing, NOTE03 */
QACTIVE_POST(AO_Table, Q_NEW(QEvt, TEST_SIG),
&l_GPIO_EVEN_IRQHandler);
*/
QF_PUBLISH(Q_NEW(QEvt, TEST_SIG), /* for testing... */
QACTIVE_PUBLISH(Q_NEW(QEvt, TEST_SIG), /* for testing... */
&l_GPIO_EVEN_IRQHandler);
QXK_ISR_EXIT(); /* inform QXK about exiting an ISR */

View File

@ -1,13 +1,13 @@
##############################################################################
# Product: Makefile for QP/C on EMF32-SLSTK3401A, QXK kernel, GNU-ARM
# Last Updated for Version: 7.0.0
# Date of the Last Update: 2021-07-01
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
# Copyright (C) 2005-2022 Quantum Leaps, LLC. All rights reserved.
#
# This program is open source software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
@ -80,7 +80,6 @@ VPATH = \
INCLUDES = \
-I../.. \
-I$(QPC)/include \
-I$(QPC)/src \
-I$(QP_PORT_DIR) \
-I$(QPC)/3rd_party/CMSIS/Include \
-I$(QPC)/3rd_party/efm32pg1b
@ -142,7 +141,9 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES := -DEFM32PG1B200F256GM48=1
DEFINES := -DEFM32PG1B200F256GM48=1 \
-DQXK_USE_IRQ_NUM=25 \
-DQXK_USE_IRQ_HANDLER=CRYPTO_IRQHandler
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -338,7 +338,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qxk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -1392,7 +1391,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qxk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -2446,7 +2444,6 @@
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\src</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qxk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
@ -3274,6 +3271,255 @@
<name>QP_port</name>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qxk\iar\qxk_port.c</name>
<configuration>
<name>Debug</name>
<settings>
<name>ICCARM</name>
<data>
<version>37</version>
<wantNonLocal>0</wantNonLocal>
<debug>1</debug>
<option>
<name>CCOptimizationNoSizeConstraints</name>
<state>0</state>
</option>
<option>
<name>CCDefines</name>
<state>EFM32PG1B200F256GM48</state>
<state>QXK_USE_IRQ_NUM=25</state>
<state>QXK_USE_IRQ_HANDLER=CRYPTO_IRQHandler</state>
</option>
<option>
<name>CCPreprocFile</name>
<state>0</state>
</option>
<option>
<name>CCPreprocComments</name>
<state>0</state>
</option>
<option>
<name>CCPreprocLine</name>
<state>0</state>
</option>
<option>
<name>CCListCFile</name>
<state>0</state>
</option>
<option>
<name>CCListCMnemonics</name>
<state>0</state>
</option>
<option>
<name>CCListCMessages</name>
<state>0</state>
</option>
<option>
<name>CCListAssFile</name>
<state>0</state>
</option>
<option>
<name>CCListAssSource</name>
<state>0</state>
</option>
<option>
<name>CCEnableRemarks</name>
<state>0</state>
</option>
<option>
<name>CCDiagSuppress</name>
<state>Pa050</state>
</option>
<option>
<name>CCDiagRemark</name>
<state></state>
</option>
<option>
<name>CCDiagWarning</name>
<state></state>
</option>
<option>
<name>CCDiagError</name>
<state></state>
</option>
<option>
<name>CCObjPrefix</name>
<state>1</state>
</option>
<option>
<name>CCAllowList</name>
<version>1</version>
<state>00000000</state>
</option>
<option>
<name>CCDebugInfo</name>
<state>1</state>
</option>
<option>
<name>IEndianMode</name>
<state>1</state>
</option>
<option>
<name>IProcessor</name>
<state>1</state>
</option>
<option>
<name>IExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>IExtraOptions</name>
<state></state>
</option>
<option>
<name>CCLangConformance</name>
<state>0</state>
</option>
<option>
<name>CCSignedPlainChar</name>
<state>1</state>
</option>
<option>
<name>CCRequirePrototypes</name>
<state>1</state>
</option>
<option>
<name>CCDiagWarnAreErr</name>
<state>0</state>
</option>
<option>
<name>CCCompilerRuntimeInfo</name>
<state>0</state>
</option>
<option>
<name>IFpuProcessor</name>
<state>1</state>
</option>
<option>
<name>OutputFile</name>
<state>$FILE_BNAME$.o</state>
</option>
<option>
<name>CCLibConfigHeader</name>
<state>1</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\..</state>
<state>$PROJ_DIR$\..\..</state>
<state>$PROJ_DIR$\..\..\..\..\..\include</state>
<state>$PROJ_DIR$\..\..\..\..\..\ports\arm-cm\qxk\iar</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\CMSIS\Include</state>
<state>$PROJ_DIR$\..\..\..\..\..\3rd_party\efm32pg1b</state>
</option>
<option>
<name>CCStdIncCheck</name>
<state>0</state>
</option>
<option>
<name>CCCodeSection</name>
<state>.text</state>
</option>
<option>
<name>IProcessorMode2</name>
<state>1</state>
</option>
<option>
<name>CCOptLevel</name>
<state>1</state>
</option>
<option>
<name>CCOptStrategy</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCOptLevelSlave</name>
<state>1</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
</option>
<option>
<name>CCPosIndRwpi</name>
<state>0</state>
</option>
<option>
<name>CCPosIndNoDynInit</name>
<state>0</state>
</option>
<option>
<name>IccLang</name>
<state>2</state>
</option>
<option>
<name>IccCDialect</name>
<state>1</state>
</option>
<option>
<name>IccAllowVLA</name>
<state>0</state>
</option>
<option>
<name>IccStaticDestr</name>
<state>0</state>
</option>
<option>
<name>IccCppInlineSemantics</name>
<state>0</state>
</option>
<option>
<name>IccCmsis</name>
<state>1</state>
</option>
<option>
<name>IccFloatSemantics</name>
<state>0</state>
</option>
<option>
<name>CCNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>CCOptStrategySlave</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCEncSource</name>
<state>0</state>
</option>
<option>
<name>CCEncOutput</name>
<state>0</state>
</option>
<option>
<name>CCEncOutputBom</name>
<state>1</state>
</option>
<option>
<name>CCEncInput</name>
<state>0</state>
</option>
<option>
<name>IccExceptions2</name>
<state>0</state>
</option>
<option>
<name>IccRTTI2</name>
<state>0</state>
</option>
<option>
<name>CCStackProtection</name>
<state>0</state>
</option>
</data>
</settings>
</configuration>
</file>
</group>
<group>

View File

@ -88,7 +88,7 @@ static void Thread1_run(QXThread * const me) {
QXThread_delay(BSP_TICKS_PER_SEC/7); /* BLOCK */
/* publish to thread2 */
//QF_PUBLISH(Q_NEW(QEvt, TEST_SIG), &l_test1.super);
//QACTIVE_PUBLISH(Q_NEW(QEvt, TEST_SIG), &l_test1.super);
/* test TLS */
lib_fun(1U);

View File

@ -1,21 +1,33 @@
/*.$file${.::table.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$file${.::table.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*
* Model: dpp.qm
* File: ${.::table.c}
*
* This code has been generated by QM 5.1.3 <www.state-machine.com/qm/>.
* This code has been generated by QM 5.2.1 <www.state-machine.com/qm>.
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation.
* SPDX-License-Identifier: GPL-3.0-or-later
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
* This generated code is open source software: you can redistribute it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* NOTE:
* Alternatively, this generated code may be distributed under the terms
* of Quantum Leaps commercial licenses, which expressly supersede the GNU
* General Public License and are specifically designed for licensees
* interested in retaining the proprietary status of their code.
*
* Contact information:
* <www.state-machine.com/licensing>
* <info@state-machine.com>
*/
/*.$endhead${.::table.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$endhead${.::table.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#include "qpc.h"
#include "dpp.h"
#include "bsp.h"
@ -23,8 +35,9 @@
Q_DEFINE_THIS_MODULE("table")
/* Active object class -----------------------------------------------------*/
/*.$declare${AOs::Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table} ...........................................................*/
/*$declare${AOs::Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Table} ............................................................*/
typedef struct Table {
/* protected: */
QActive super;
@ -42,7 +55,7 @@ static QState Table_initial(Table * const me, void const * const par);
static QState Table_active(Table * const me, QEvt const * const e);
static QState Table_serving(Table * const me, QEvt const * const e);
static QState Table_paused(Table * const me, QEvt const * const e);
/*.$enddecl${AOs::Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddecl${AOs::Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#define RIGHT(n_) ((uint8_t)(((n_) + (N_PHILO - 1U)) % N_PHILO))
#define LEFT(n_) ((uint8_t)(((n_) + 1U) % N_PHILO))
@ -50,22 +63,23 @@ static QState Table_paused(Table * const me, QEvt const * const e);
#define USED ((uint8_t)1)
/* Global-scope objects ----------------------------------------------------*/
/*.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*. Check for the minimum required QP version */
/*$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/* Check for the minimum required QP version */
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpc version 6.9.0 or higher required
#endif
/*.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/* opaque pointer to the Table AO */
/*.${AOs::AO_Table} ........................................................*/
/*$define${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::AO_Table} .........................................................*/
QActive * const AO_Table = &Table_inst.super;
/*.$enddef${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddef${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*..........................................................................*/
/*.$define${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table_ctor} ......................................................*/
/*$define${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Table_ctor} .......................................................*/
void Table_ctor(void) {
Table *me = &Table_inst;
@ -76,13 +90,15 @@ void Table_ctor(void) {
me->isHungry[n] = 0U;
}
}
/*.$enddef${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table} ...........................................................*/
/*$enddef${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$define${AOs::Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Table} ............................................................*/
Table Table_inst;
/*.${AOs::Table::SM} .......................................................*/
/*${AOs::Table::SM} ........................................................*/
static QState Table_initial(Table * const me, void const * const par) {
/*.${AOs::Table::SM::initial} */
/*${AOs::Table::SM::initial} */
(void)par; /* unused parameter */
QS_OBJ_DICTIONARY(&Table_inst);
@ -104,11 +120,12 @@ static QState Table_initial(Table * const me, void const * const par) {
return Q_TRAN(&Table_serving);
}
/*.${AOs::Table::SM::active} ...............................................*/
/*${AOs::Table::SM::active} ................................................*/
static QState Table_active(Table * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Table::SM::active::EAT} */
/*${AOs::Table::SM::active::EAT} */
case EAT_SIG: {
Q_ERROR_ID(60);
status_ = Q_HANDLED();
@ -121,11 +138,12 @@ static QState Table_active(Table * const me, QEvt const * const e) {
}
return status_;
}
/*.${AOs::Table::SM::active::serving} ......................................*/
/*${AOs::Table::SM::active::serving} .......................................*/
static QState Table_serving(Table * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Table::SM::active::serving} */
/*${AOs::Table::SM::active::serving} */
case Q_ENTRY_SIG: {
uint8_t n;
for (n = 0U; n < N_PHILO; ++n) { /* give permissions to eat... */
@ -139,7 +157,7 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
me->fork[n] = USED;
te = Q_NEW(TableEvt, EAT_SIG);
te->philoNum = n;
QF_PUBLISH(&te->super, &me->super);
QACTIVE_PUBLISH(&te->super, &me->super);
me->isHungry[n] = 0U;
BSP_displayPhilStat(n, "eating ");
}
@ -147,7 +165,7 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::serving::HUNGRY} */
/*${AOs::Table::SM::active::serving::HUNGRY} */
case HUNGRY_SIG: {
uint8_t n, m;
@ -157,25 +175,25 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
BSP_displayPhilStat(n, "hungry ");
m = LEFT(n);
/*.${AOs::Table::SM::active::serving::HUNGRY::[bothfree]} */
/*${AOs::Table::SM::active::serving::HUNGRY::[bothfree]} */
if ((me->fork[m] == FREE) && (me->fork[n] == FREE)) {
TableEvt *pe;
me->fork[m] = USED;
me->fork[n] = USED;
pe = Q_NEW(TableEvt, EAT_SIG);
pe->philoNum = n;
QF_PUBLISH(&pe->super, &me->super);
QACTIVE_PUBLISH(&pe->super, &me->super);
BSP_displayPhilStat(n, "eating ");
status_ = Q_HANDLED();
}
/*.${AOs::Table::SM::active::serving::HUNGRY::[else]} */
/*${AOs::Table::SM::active::serving::HUNGRY::[else]} */
else {
me->isHungry[n] = 1U;
status_ = Q_HANDLED();
}
break;
}
/*.${AOs::Table::SM::active::serving::DONE} */
/*${AOs::Table::SM::active::serving::DONE} */
case DONE_SIG: {
uint8_t n, m;
TableEvt *pe;
@ -199,7 +217,7 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
me->isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe->philoNum = m;
QF_PUBLISH(&pe->super, &me->super);
QACTIVE_PUBLISH(&pe->super, &me->super);
BSP_displayPhilStat(m, "eating ");
}
m = LEFT(n); /* check the left neighbor */
@ -210,13 +228,13 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
me->isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe->philoNum = m;
QF_PUBLISH(&pe->super, &me->super);
QACTIVE_PUBLISH(&pe->super, &me->super);
BSP_displayPhilStat(m, "eating ");
}
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::serving::PAUSE} */
/*${AOs::Table::SM::active::serving::PAUSE} */
case PAUSE_SIG: {
status_ = Q_TRAN(&Table_paused);
break;
@ -228,28 +246,29 @@ static QState Table_serving(Table * const me, QEvt const * const e) {
}
return status_;
}
/*.${AOs::Table::SM::active::paused} .......................................*/
/*${AOs::Table::SM::active::paused} ........................................*/
static QState Table_paused(Table * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Table::SM::active::paused} */
/*${AOs::Table::SM::active::paused} */
case Q_ENTRY_SIG: {
BSP_displayPaused(1U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::paused} */
/*${AOs::Table::SM::active::paused} */
case Q_EXIT_SIG: {
BSP_displayPaused(0U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::paused::SERVE} */
/*${AOs::Table::SM::active::paused::SERVE} */
case SERVE_SIG: {
status_ = Q_TRAN(&Table_serving);
break;
}
/*.${AOs::Table::SM::active::paused::HUNGRY} */
/*${AOs::Table::SM::active::paused::HUNGRY} */
case HUNGRY_SIG: {
uint8_t n = Q_EVT_CAST(TableEvt)->philoNum;
/* philo ID must be in range and he must be not hungry */
@ -259,7 +278,7 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
status_ = Q_HANDLED();
break;
}
/*.${AOs::Table::SM::active::paused::DONE} */
/*${AOs::Table::SM::active::paused::DONE} */
case DONE_SIG: {
uint8_t n, m;
@ -284,4 +303,4 @@ static QState Table_paused(Table * const me, QEvt const * const e) {
}
return status_;
}
/*.$enddef${AOs::Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddef${AOs::Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/

View File

@ -226,7 +226,7 @@ void QF_onCleanup(void) {
}
/*..........................................................................*/
void QF_onClockTick(void) {
QF_TICK_X(0U, &l_clock_tick); /* perform the QF clock tick processing */
QTIMEEVT_TICK_X(0U, &l_clock_tick); /* perform the QF clock tick processing */
QS_RX_INPUT(); /* handle the QS-RX input */
QS_OUTPUT(); /* handle the QS output */

View File

@ -0,0 +1,5 @@
![STM32 EFM32-SLSTK3401A](../../../doxygen/images/bd_EK-TM4C123GXL.jpg)
Documentation for this example is available in the QP/C Manual at:
- https://www.state-machine.com/qpc/arm-cm_dpp_ek-tm4c123gxl.html

View File

@ -1,21 +1,33 @@
/*.$file${.::dpp.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$file${.::dpp.h} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*
* Model: dpp.qm
* File: ${.::dpp.h}
*
* This code has been generated by QM 5.1.4 <www.state-machine.com/qm/>.
* This code has been generated by QM 5.2.1 <www.state-machine.com/qm>.
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation.
* SPDX-License-Identifier: GPL-3.0-or-later
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
* This generated code is open source software: you can redistribute it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* NOTE:
* Alternatively, this generated code may be distributed under the terms
* of Quantum Leaps commercial licenses, which expressly supersede the GNU
* General Public License and are specifically designed for licensees
* interested in retaining the proprietary status of their code.
*
* Contact information:
* <www.state-machine.com/licensing>
* <info@state-machine.com>
*/
/*.$endhead${.::dpp.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$endhead${.::dpp.h} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#ifndef DPP_H
#define DPP_H
@ -32,8 +44,9 @@ enum DPPSignals {
MAX_SIG /* the last signal */
};
/*.$declare${Events::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${Events::TableEvt} .....................................................*/
/*$declare${Events::TableEvt} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${Events::TableEvt} ......................................................*/
typedef struct {
/* protected: */
QEvt super;
@ -41,26 +54,32 @@ typedef struct {
/* public: */
uint8_t philoNum;
} TableEvt;
/*.$enddecl${Events::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddecl${Events::TableEvt} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/* number of philosophers */
#define N_PHILO ((uint8_t)5)
/*.$declare${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo_ctor} ......................................................*/
void Philo_ctor(void);
/*.$enddecl${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
extern QActive * const AO_Philo[N_PHILO];
/*.$enddecl${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$declare${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.$declare${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Table_ctor} ......................................................*/
/*${AOs::Philo_ctor} .......................................................*/
void Philo_ctor(void);
/*$enddecl${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$declare${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::AO_Philo[N_PHILO]} ................................................*/
extern QActive * const AO_Philo[N_PHILO];
/*$enddecl${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$declare${AOs::Table_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Table_ctor} .......................................................*/
void Table_ctor(void);
/*.$enddecl${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$declare${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$enddecl${AOs::Table_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$declare${AOs::AO_Table} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::AO_Table} .........................................................*/
extern QActive * const AO_Table;
/*.$enddecl${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddecl${AOs::AO_Table} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#ifdef QXK_H
void Test1_ctor(void);
@ -70,3 +89,4 @@ extern QActive * const AO_Table;
#endif /* QXK_H */
#endif /* DPP_H */

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.1.4" links="1">
<model version="5.2.1" links="1">
<documentation>Dining Philosopher Problem example</documentation>
<!--${qpc}-->
<framework name="qpc"/>
@ -120,7 +120,7 @@ Q_ASSERT(Q_EVT_CAST(TableEvt)-&gt;philoNum != PHILO_ID(me));</action>
<entry>QTimeEvt_armX(&amp;me-&gt;timeEvt, EAT_TIME, 0U);</entry>
<exit>TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
pe-&gt;philoNum = PHILO_ID(me);
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);</exit>
QACTIVE_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);</exit>
<!--${AOs::Philo::SM::eating::TIMEOUT}-->
<tran trig="TIMEOUT" target="../../1">
<tran_glyph conn="2,51,3,1,22,-41,-5">
@ -213,7 +213,7 @@ for (n = 0U; n &lt; N_PHILO; ++n) { /* give permissions to eat... */
me-&gt;fork[n] = USED;
te = Q_NEW(TableEvt, EAT_SIG);
te-&gt;philoNum = n;
QF_PUBLISH(&amp;te-&gt;super, &amp;me-&gt;super);
QACTIVE_PUBLISH(&amp;te-&gt;super, &amp;me-&gt;super);
me-&gt;isHungry[n] = 0U;
BSP_displayPhilStat(n, &quot;eating &quot;);
}
@ -236,7 +236,7 @@ me-&gt;fork[m] = USED;
me-&gt;fork[n] = USED;
pe = Q_NEW(TableEvt, EAT_SIG);
pe-&gt;philoNum = n;
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
QACTIVE_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
BSP_displayPhilStat(n, &quot;eating &quot;);</action>
<choice_glyph conn="19,26,5,-1,10">
<action box="1,0,10,2"/>
@ -278,7 +278,7 @@ if ((me-&gt;isHungry[m] != 0U) &amp;&amp; (me-&gt;fork[m] == FREE)) {
me-&gt;isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe-&gt;philoNum = m;
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
QACTIVE_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
BSP_displayPhilStat(m, &quot;eating &quot;);
}
m = LEFT(n); /* check the left neighbor */
@ -289,7 +289,7 @@ if ((me-&gt;isHungry[m] != 0U) &amp;&amp; (me-&gt;fork[n] == FREE)) {
me-&gt;isHungry[m] = 0U;
pe = Q_NEW(TableEvt, EAT_SIG);
pe-&gt;philoNum = m;
QF_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
QACTIVE_PUBLISH(&amp;pe-&gt;super, &amp;me-&gt;super);
BSP_displayPhilStat(m, &quot;eating &quot;);
}</action>
<tran_glyph conn="4,34,3,-1,15">

View File

@ -34,7 +34,7 @@
@echo.
:: NOTE: adjust to for your installation directory of PC-Lint-Plus
@set PCLP=C:\tools\lint-plus\windows\pclp32.exe
@set PCLP=C:\tools\lint-plus\windows\pclp64.exe
if NOT exist "%PCLP%" (
@echo The PC-Lint-Plus toolset not found. Please adjust lin.bat

View File

@ -1,21 +1,33 @@
/*.$file${.::philo.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*$file${.::philo.c} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*
* Model: dpp.qm
* File: ${.::philo.c}
*
* This code has been generated by QM 5.1.4 <www.state-machine.com/qm/>.
* This code has been generated by QM 5.2.1 <www.state-machine.com/qm>.
* DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
*
* This program is open source software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation.
* SPDX-License-Identifier: GPL-3.0-or-later
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
* This generated code is open source software: you can redistribute it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* NOTE:
* Alternatively, this generated code may be distributed under the terms
* of Quantum Leaps commercial licenses, which expressly supersede the GNU
* General Public License and are specifically designed for licensees
* interested in retaining the proprietary status of their code.
*
* Contact information:
* <www.state-machine.com/licensing>
* <info@state-machine.com>
*/
/*.$endhead${.::philo.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$endhead${.::philo.c} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#include "qpc.h"
#include "dpp.h"
#include "bsp.h"
@ -23,8 +35,9 @@
Q_DEFINE_THIS_FILE
/* Active object class -----------------------------------------------------*/
/*.$declare${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo} ...........................................................*/
/*$declare${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Philo} ............................................................*/
typedef struct Philo {
/* protected: */
QActive super;
@ -41,7 +54,7 @@ static QState Philo_initial(Philo * const me, void const * const par);
static QState Philo_thinking(Philo * const me, QEvt const * const e);
static QState Philo_hungry(Philo * const me, QEvt const * const e);
static QState Philo_eating(Philo * const me, QEvt const * const e);
/*.$enddecl${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddecl${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#define THINK_TIME \
(QTimeEvtCtr)((BSP_random() % BSP_TICKS_PER_SEC) + (BSP_TICKS_PER_SEC/2U))
@ -53,14 +66,16 @@ static inline uint8_t PHILO_ID(Philo * const me) {
return (uint8_t)(me - &Philo_inst[0]);
}
/*.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*. Check for the minimum required QP version */
/*$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/* Check for the minimum required QP version */
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpc version 6.9.0 or higher required
#endif
/*.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::AO_Philo[N_PHILO]} ...............................................*/
/*$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$define${AOs::AO_Philo[N_PHILO]} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::AO_Philo[N_PHILO]} ................................................*/
QActive * const AO_Philo[N_PHILO] = { /* "opaque" pointers to Philo AO */
&Philo_inst[0].super,
&Philo_inst[1].super,
@ -68,9 +83,10 @@ QActive * const AO_Philo[N_PHILO] = { /* "opaque" pointers to Philo AO */
&Philo_inst[3].super,
&Philo_inst[4].super
};
/*.$enddef${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo_ctor} ......................................................*/
/*$enddef${AOs::AO_Philo[N_PHILO]} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$define${AOs::Philo_ctor} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Philo_ctor} .......................................................*/
void Philo_ctor(void) {
uint8_t n;
Philo *me;
@ -80,13 +96,15 @@ void Philo_ctor(void) {
QTimeEvt_ctorX(&me->timeEvt, &me->super, (enum_t)TIMEOUT_SIG, 0U);
}
}
/*.$enddef${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*.$define${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*.${AOs::Philo} ...........................................................*/
/*$enddef${AOs::Philo_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$define${AOs::Philo} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
/*${AOs::Philo} ............................................................*/
Philo Philo_inst[N_PHILO];
/*.${AOs::Philo::SM} .......................................................*/
/*${AOs::Philo::SM} ........................................................*/
static QState Philo_initial(Philo * const me, void const * const par) {
/*.${AOs::Philo::SM::initial} */
/*${AOs::Philo::SM::initial} */
(void)par; /* unused parameter */
static bool registered = false;
@ -116,28 +134,29 @@ static QState Philo_initial(Philo * const me, void const * const par) {
QActive_subscribe(&me->super, (enum_t)TEST_SIG);
return Q_TRAN(&Philo_thinking);
}
/*.${AOs::Philo::SM::thinking} .............................................*/
/*${AOs::Philo::SM::thinking} ..............................................*/
static QState Philo_thinking(Philo * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Philo::SM::thinking} */
/*${AOs::Philo::SM::thinking} */
case Q_ENTRY_SIG: {
QTimeEvt_armX(&me->timeEvt, THINK_TIME, 0U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::thinking} */
/*${AOs::Philo::SM::thinking} */
case Q_EXIT_SIG: {
(void)QTimeEvt_disarm(&me->timeEvt);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::thinking::TIMEOUT} */
/*${AOs::Philo::SM::thinking::TIMEOUT} */
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Philo_hungry);
break;
}
/*.${AOs::Philo::SM::thinking::EAT, DONE} */
/*${AOs::Philo::SM::thinking::EAT, DONE} */
case EAT_SIG: /* intentionally fall through */
case DONE_SIG: {
/* EAT or DONE must be for other Philos than this one */
@ -145,7 +164,7 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::thinking::TEST} */
/*${AOs::Philo::SM::thinking::TEST} */
case TEST_SIG: {
status_ = Q_HANDLED();
break;
@ -157,11 +176,12 @@ static QState Philo_thinking(Philo * const me, QEvt const * const e) {
}
return status_;
}
/*.${AOs::Philo::SM::hungry} ...............................................*/
/*${AOs::Philo::SM::hungry} ................................................*/
static QState Philo_hungry(Philo * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Philo::SM::hungry} */
/*${AOs::Philo::SM::hungry} */
case Q_ENTRY_SIG: {
TableEvt *pe = Q_NEW(TableEvt, HUNGRY_SIG);
pe->philoNum = PHILO_ID(me);
@ -169,9 +189,9 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::hungry::EAT} */
/*${AOs::Philo::SM::hungry::EAT} */
case EAT_SIG: {
/*.${AOs::Philo::SM::hungry::EAT::[Q_EVT_CAST(TableEvt)->philoNum=~} */
/*${AOs::Philo::SM::hungry::EAT::[Q_EVT_CAST(TableEvt)->philoNum=~} */
if (Q_EVT_CAST(TableEvt)->philoNum == PHILO_ID(me)) {
status_ = Q_TRAN(&Philo_eating);
}
@ -180,7 +200,7 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
}
break;
}
/*.${AOs::Philo::SM::hungry::DONE} */
/*${AOs::Philo::SM::hungry::DONE} */
case DONE_SIG: {
/* DONE must be for other Philos than this one */
Q_ASSERT(Q_EVT_CAST(TableEvt)->philoNum != PHILO_ID(me));
@ -194,30 +214,31 @@ static QState Philo_hungry(Philo * const me, QEvt const * const e) {
}
return status_;
}
/*.${AOs::Philo::SM::eating} ...............................................*/
/*${AOs::Philo::SM::eating} ................................................*/
static QState Philo_eating(Philo * const me, QEvt const * const e) {
QState status_;
switch (e->sig) {
/*.${AOs::Philo::SM::eating} */
/*${AOs::Philo::SM::eating} */
case Q_ENTRY_SIG: {
QTimeEvt_armX(&me->timeEvt, EAT_TIME, 0U);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::eating} */
/*${AOs::Philo::SM::eating} */
case Q_EXIT_SIG: {
TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
pe->philoNum = PHILO_ID(me);
QF_PUBLISH(&pe->super, &me->super);
QACTIVE_PUBLISH(&pe->super, &me->super);
status_ = Q_HANDLED();
break;
}
/*.${AOs::Philo::SM::eating::TIMEOUT} */
/*${AOs::Philo::SM::eating::TIMEOUT} */
case TIMEOUT_SIG: {
status_ = Q_TRAN(&Philo_thinking);
break;
}
/*.${AOs::Philo::SM::eating::EAT, DONE} */
/*${AOs::Philo::SM::eating::EAT, DONE} */
case EAT_SIG: /* intentionally fall through */
case DONE_SIG: {
/* EAT or DONE must be for other Philos than this one */
@ -232,4 +253,4 @@ static QState Philo_eating(Philo * const me, QEvt const * const e) {
}
return status_;
}
/*.$enddef${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
/*$enddef${AOs::Philo} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/

View File

@ -338,7 +338,7 @@
<MiscControls></MiscControls>
<Define>__FPU_PRESENT</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -967,7 +967,7 @@
<MiscControls></MiscControls>
<Define>NDEBUG TARGET_IS_TM4C123_RB1</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
</VariousControls>
</Cads>
<Aads>
@ -1596,7 +1596,7 @@
<MiscControls></MiscControls>
<Define>Q_SPY TARGET_IS_TM4C123_RB1</Define>
<Undefine></Undefine>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\src;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
<IncludePath>..\..;..\..\..\..\..\include;..\..\..\..\..\ports\arm-cm\qk\armclang;..\..\..\..\..\3rd_party\CMSIS\Include;..\..\..\..\..\3rd_party\ek-tm4c123gxl</IncludePath>
</VariousControls>
</Cads>
<Aads>

Some files were not shown because too many files have changed in this diff Show More