5.4.0
15
.gitignore
vendored
@ -4,6 +4,7 @@
|
||||
*.lib
|
||||
*.a
|
||||
*.elf
|
||||
*.err
|
||||
*.hex
|
||||
*.exe
|
||||
*.EXE
|
||||
@ -19,9 +20,23 @@
|
||||
*.tmp
|
||||
*.log
|
||||
*.chm
|
||||
*.zip
|
||||
*.ncb
|
||||
*.suo
|
||||
*.chw
|
||||
*.sfr
|
||||
*.user
|
||||
*.avrsuo
|
||||
*.Debug
|
||||
*.Release
|
||||
lint*.out
|
||||
*.Miro
|
||||
*.bak
|
||||
|
||||
3rd_party/
|
||||
doc/
|
||||
test/
|
||||
test_ports/
|
||||
dbg/
|
||||
rel/
|
||||
spy/
|
||||
|
7
COPYING
@ -1,4 +1,4 @@
|
||||
Copyright (C) 2002-2013 Quantum Leaps, LLC. All rights reserved.
|
||||
Copyright (C) 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
|
||||
@ -21,6 +21,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact information:
|
||||
--------------------
|
||||
Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
http://www.state-machine.com
|
||||
e-mail: info@quantum-leaps.com
|
||||
Web: http://www.state-machine.com
|
||||
Email: info@state-machine.com
|
||||
|
73
README.txt
Normal file
@ -0,0 +1,73 @@
|
||||
About AP/C
|
||||
==========
|
||||
QP/C (Quantum Platform in C) is a lightweight, open source software framework
|
||||
for building responsive and modular real-time embedded applications as
|
||||
systems of cooperating, event-driven active objects (actors). The QP/C
|
||||
framework is a member of a larger family consisting of QP/C, QP/C++, and
|
||||
QP-nano frameworks, which are all strictly quality controlled, thoroughly
|
||||
documented, and commercially licensable.
|
||||
|
||||
All QP frameworks can run on bare-metal single-chip microcontrollers,
|
||||
completely replacing a traditional Real-Time Operating System (RTOS).
|
||||
Ports and ready-to-use examples are provided for major CPU families.
|
||||
|
||||
QP/C can also work with many traditional RTOSes and desktop OSes (such as
|
||||
Windows, Linux including embedded Linux).
|
||||
|
||||
The behavior of active objects is specified in QP by means of hierarchical
|
||||
state machines (UML statecharts). The frameworks support manual coding of
|
||||
UML state machines in C or C++ as well as fully automatic code generation
|
||||
by means of the free graphical QM modeling tool.
|
||||
|
||||
The QP frameworks are used in millions of products worldwide in aerospace,
|
||||
medical devices, consumer electronics, wired and wireless telecommunications,
|
||||
industrial automation, transportation, robotics, and many more. The QP
|
||||
frameworks and the QM modeling tool receive over 40,000 downloads a year.
|
||||
|
||||
The book, Practical UML Statecharts in C/C++, 2nd Edition provides a detailed
|
||||
design study of the QP frameworks and explains all the related concepts.
|
||||
|
||||
***
|
||||
NOTE: For more information about QP/C, please visit:
|
||||
http://www.state-machine.com/qp/qpc
|
||||
****
|
||||
|
||||
|
||||
Licensing QP/C
|
||||
==============
|
||||
QP/C is licensed under the increasingly popular 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 licensed commercially, in which case you don't use any
|
||||
open source license and you do not violate your policy.
|
||||
|
||||
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
|
||||
GPL version 3 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.
|
||||
|
||||
Closed Source Projects:
|
||||
-----------------------
|
||||
If you are developing and distributing traditional closed source
|
||||
applications, you can purchase one of 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.
|
||||
|
||||
|
||||
Contact Information:
|
||||
====================
|
||||
Quantum Leaps, LLC
|
||||
Web: www.state-machine.com
|
||||
Email: info@state-machine.com
|
3
README.url
Normal file
@ -0,0 +1,3 @@
|
||||
[InternetShortcut]
|
||||
URL=http://www.state-machine.com/qpcpp/index.html
|
||||
IconFile=http://www.state-machine.com/qp.ico
|
556
doxygen/Doxyfile
125
doxygen/about.dox
Normal file
@ -0,0 +1,125 @@
|
||||
/*! @mainpage About QP/C++
|
||||
|
||||
@tableofcontents
|
||||
|
||||
<p><a class="extern" target="_blank" href="http://www.state-machine.com/qp"><strong>QP/C++™ (Quantum Platform in C++)</strong></a> is a lightweight, open source software framework for building responsive and modular real-time embedded applications as systems of cooperating, event-driven <a class="extern" target="_blank" href="http://www.state-machine.com/qp/index.php#Active">active objects</a> (<a href="http://en.wikipedia.org/wiki/Actor_model">actors</a>). The QP/C++™ framework is a member of a larger family consisting of QP/C++, QP/C, and QP-nano frameworks, which are all strictly quality controlled, thoroughly documented, and commercially licensable.
|
||||
</p>
|
||||
|
||||
@image html logo_qp.jpg
|
||||
|
||||
All QP™ frameworks can run on @ref exa_native "bare-metal single-chip microcontrollers", completely replacing a traditional Real-Time Operating System (RTOS). Ports and ready-to-use examples are provided for major @ref exa_ref_mcu "CPU families".
|
||||
|
||||
QP/C++ can also work with many traditional @ref exa_rtos "RTOSes" and @ref exa_rtos "desktop OSes" (such as Windows, Linux including embedded Linux).
|
||||
|
||||
The behavior of active objects is specified in QP by means of <a class="extern" target="_blank" href="http://en.wikipedia.org/wiki/UML_state_machine">hierarchical state machines (UML statecharts)</a>. The frameworks support manual coding of UML state machines in C or C++ as well as fully automatic code generation by means of the free graphical <a class="extern" target="_blank" href="http://www.state-machine.com/qm/help">QM™ modeling tool</a>.
|
||||
|
||||
The QP frameworks are used in millions of products worldwide in aerospace, medical devices, consumer electronics, wired and wireless telecommunications, industrial automation, transportation, robotics, and many more. The QP frameworks and the <a class="extern" target="_blank" href="http://www.state-machine.com/qm/help">QM modeling tool</a> receive over <a class="extern" target="_blank" href="http://sourceforge.net/projects/qpc/files/stats/timeline?dates=2014-01-01+to+2014-12-31">40,000 downloads a year</a>. The book, <a class="extern" target="_blank" href="http://www.state-machine.com/psicc2" >Practical UML Statecharts in C/C++, 2nd Edition</a> provides a detailed design study of the QP frameworks and explains all the related concepts.
|
||||
|
||||
@note
|
||||
For more information about QP, please visit: <a class="extern" target="_blank" href="http://www.state-machine.com/qp"><strong>state-machine.com/qp</strong></a>
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section download Downloading QP/C++
|
||||
QP/C++ is available for download from <a class="extern" target="_blank" href="http://sourceforge.net/projects/qpc/files/QP-Cpp">SourceForge.net</a>--the world's biggest open source repository. The summary of available downloads is also available from <a class="extern" target="_blank" href="http://www.state-machine.com/downloads">Quantum Leaps download page</a>.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section licensing Licensing QP/C++
|
||||
|
||||
QP/C++ is licensed under the increasingly popular <a class="extern" target="_blank" href="http://www.state-machine.com/licensing">dual licensing model</a>, 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 licensed commercially, in which case you don't use any open source license and you do not violate your policy.
|
||||
|
||||
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="http://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.
|
||||
|
||||
Closed Source Projects:
|
||||
-----------------------
|
||||
If you are developing and distributing traditional closed source applications, you can purchase one of <a class="extern" target="_blank" href="http://www.state-machine.com/licensing/index.php#Commercial">Quantum Leaps commercial licenses</a>, 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 getting_started Getting Started with QP/C++
|
||||
The Quantum Leaps Application Note <a class="extern" target="_blank" href="http://www.state-machine.com/quickstart/Getting_Started_with_QPCpp.pdf"><strong>Getting Started with QP/C++</strong></a> provides step-by-step instructions on how to get started with QP/C quickly.
|
||||
|
||||
@image html AN_Getting_Started_with_QPC.jpg
|
||||
|
||||
The standard QP/C++ distribution contains also many @ref exa "Example Projects", which are specifically designed to help you learn to use QP/C++ and to serve you as starting points for your own projects.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section support Help and Support
|
||||
Please post any **technical questions** to the <a class="extern" target="_blank" href="http://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.
|
||||
|
||||
Training and consulting services are also available from Quantum Leaps. Please refer to the <a class="extern" target="_blank" href="http://www.state-machine.com/support/">Support web-page</a> for more information.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section qpc_files Directories and Files
|
||||
|
||||
The following annotated directory tree lists the top-level directories provided in the standard QP/C++ distribution.
|
||||
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">qpcpp</span>
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">3rd_party</span> — Third-Party code used in the QP/C++ @ref ports "ports" and @ref exa "examples"
|
||||
</li>
|
||||
<li><span class="img folder">examples</span> — @ref exa "QP/C++ Examples"
|
||||
</li>
|
||||
<li><span class="img folder">ports</span> — @ref ports "QP/C++ Ports"
|
||||
</li>
|
||||
<li><span class="img folder">include</span> — Platform-independent QP/C++ API (see <a href="dir_d44c64559bbebec7f509842c48db8b23.html"><strong>include</strong></a>)
|
||||
</li>
|
||||
<li><span class="img folder">source</span> — Platform-independent QP/C++ source code (see @ref <a href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html"><strong>source</strong></a>)
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section misra MISRA Compliance
|
||||
|
||||
<p>The QP/C++ framework comply with most of the Motor Industry Software Reliability Association (MISRA) MISRA-C++:2008 rules.
|
||||
</p>
|
||||
|
||||
@image html AN_MISRA.jpg "QP/C++ MISRA-C++:2008 Compliance Matrix"
|
||||
|
||||
All deviations are carefully limited into very specific contexts and are documented with the Application Note: <a class="extern" target="_blank" href="http://www.state-machine.com/resources/AN_QP-Cpp_MISRA.pdf"><strong>QP/C++ MISRA-C++:2008 Compliance Matrix</strong></a>.
|
||||
|
||||
@note
|
||||
MISRA and MISRA C are registered trademarks of MIRA Ltd, held on behalf of the MISRA Consortium.
|
||||
|
||||
The MISRA guidelines place great emphasis on the use of static code analysts tools to check compliance with the MISRA-C++ language subset. To this end, QP/C++ comes with an extensive support for automatic rule checking with @ref misra_lint "PC-Lint". The QP frameworks go even beyond MISRA, by complying with the <strong>strict type checking</strong> of PC-Lint and a very consistent, documented <a class="extern" target="_blank" href="http://www.state-machine.com/resources/AN_QL_Coding_Standard.pdf" >Quantum Leaps Coding Standard</a>.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section pc-lint PC-Lint Support
|
||||
|
||||
The QP/C++ framework comes with extensive support for automatic rule checking by means of <a class="extern" target="_blank" href="http://www.gimpel.com/">PC-Lint</a>, which is designed not just for proving compliance of the QP/C++ framework code, but more importantly, to aid in checking compliance of the application-level code. Any organization engaged in designing safety-related embedded software could benefit from the unprecedented quality infrastructure built around the QP/C++ framework.
|
||||
|
||||
@sa @ref lint "Lint Port"
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section contact Contact Information
|
||||
|
||||
- Quantum Leaps Web site: <a class="extern" target="_blank" href="http://www.state-machine.com">www.state-machine.com</a>
|
||||
|
||||
- Quantum Leaps licensing: <a class="extern" target="_blank" href="http://www.state-machine.com">www.state-machine.com/licensing</a>
|
||||
|
||||
- QP/QM on SourceForge.net: <a class="extern" target="_blank" href="http://sourceforge.net/projects/qpc">sourceforge.net/projects/qpc</a>
|
||||
|
||||
- e-mail: <a class="extern" target="_blank" href="mailto:info@state-machine.com">info@state-machine.com</a>
|
||||
|
||||
@image html logo_ql_TM.jpg
|
||||
Copyright © 2002-2015 Quantum Leaps, LLC. All Rights Reserved.
|
||||
|
||||
|
||||
@next{exa}
|
||||
*/
|
||||
|
75
doxygen/design.dox
Normal file
@ -0,0 +1,75 @@
|
||||
/*! @page design Design
|
||||
|
||||
@tableofcontents
|
||||
|
||||
@section oop Object-Orientation
|
||||
|
||||
As most C++ frameworks, QP/C++ uses classes, inheritance, and polymorphism as the main mechanisms for customizing the framework into applications. The framewok is also layered and consists of components with well defined responsibilities.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section comp Components of QP/C++
|
||||
The QP/C++ active object framework is comprised of the following components:
|
||||
|
||||
@image html qp_components.jpg "Components of the QP Framework"
|
||||
|
||||
<div class="separate"></div>
|
||||
@subsection comp_qep QEP 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. (See also @ref qep).
|
||||
|
||||
<div class="separate"></div>
|
||||
@subsection comp_qf QF Active-Object Framework
|
||||
QF is a portable, event-driven, active-object (actor) framework for execution of **active objects** (concurrent state machines) specifically designed for real-time embedded (RTE) systems. (See also @ref qf).
|
||||
|
||||
<div class="separate"></div>
|
||||
@subsection comp_qk QK Preemptive Kernel
|
||||
QK is a tiny **preemptive**, priority-based, non-blocking, real-time kernel designed specifically for executing active objects. QK meets all the requirement of the <a class="extern" target="_blank" href="http://en.wikipedia.org/wiki/Rate-monotonic_scheduling"><strong>Rate Monotonic Scheduling</strong></a> (a.k.a. Rate Monotonic Analysis — RMA) and can be used in hard real-time systems. (See also @ref qk).
|
||||
|
||||
<div class="separate"></div>
|
||||
@subsection comp_qv QV Cooperative Kernel
|
||||
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. (See also @ref qv).
|
||||
|
||||
<div class="separate"></div>
|
||||
@subsection comp_qs QS Software Tracing System
|
||||
QS is 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. (See also @ref qs).
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section classes Classes in QP/C++
|
||||
The figure below shows the main classes comprising the QP/C++ framework and their relation to the application-level code, such as the @ref game example application.
|
||||
|
||||
@image html qp_classes.png "Main Classes in the QP Framework"
|
||||
|
||||
<ul class="tag">
|
||||
<li><span class="tag">0</span> The QP::QEvt class represents events without parameters and serves as the base class for derivation of time events and any events with parameters. For example, application-level events `ObjectPosEvt` and `ObjectImageEvt` inherit QP::QEvt and add to it some parameters (see <span class="tag">8</span>).
|
||||
</li>
|
||||
|
||||
<li><span class="tag">1</span> The abstract QP::QMsm class represents the most fundamental State Machine in QP/C++. This class implements the fastest and the most efficient strategy for coding hierarchical state machines, but this strategy is not human-maintainable and requires the use of the <a class="extern" target="_blank" href="http://www.state-machine.com/qm">QM modeling tool</a>. The class is abstract, meaning that it is not designed to be instantiated directly, but rather only for inheritance. The @ref game application provides an example of application-level classes deriving directly from QP::QMsm (see <span class="tag">7</span>).
|
||||
</li>
|
||||
|
||||
<li><span class="tag">2</span> The abstract QP::QHsm class derives from QP::QMsm and implements the state machine coding strategy suitable for manual coding and maintaining the code. The QP::QHsm strategy is also supported by the <a class="extern" target="_blank" href="http://www.state-machine.com/qm">QM modeling tool</a>, but is not as fast or efficient as the QP::QMsm strategy.
|
||||
</li>
|
||||
|
||||
<li><span class="tag">3</span> The abstract QP::QMActive class represents an active object that uses the QP::QMsm style state machine implementation strategy. This strategy requires the use of the QM modeling tool to generate state machine code automatically, but the code is faster than in the QP::QHsm style implementation strategy and needs less run-time support (smaller event-processor).
|
||||
</li>
|
||||
|
||||
<li><span class="tag">4</span> The abstract QP::QActive class represents an active object that uses the QP::QHsm style implementation strategy for state machines. This strategy is tailored to manual coding, but it is also supported by the QM modeling tool. The resulting code is slower than in the QP::QMsm-style implementation strategy.
|
||||
</li>
|
||||
|
||||
<li><span class="tag">5</span> The QP::QTimeEvt class represents time events in QP. **Time events** are special QP events equipped with the notion of time passage. The basic usage model of the time events is as follows. An active object allocates one or more QP::QTimeEvt objects (provides the storage for them). When the active object needs to arrange for a timeout, it arms one of its time events to fire either just once (one-shot) or periodically. Each time event times out independently from the others, so a QP application can make multiple parallel timeout requests (from the same or different active objects). When QP detects that the appropriate moment has arrived, it inserts the time event directly into the recipient's event queue. The recipient then processes the time event just like any other event.
|
||||
</li>
|
||||
|
||||
<li><span class="tag">6</span> Active Objects in the application derive either from the QP::QMActive or QP::QActive base class.
|
||||
</li>
|
||||
|
||||
<li><span class="tag">7</span> Applications can also use classes derived directly from the QP::QMsm or QP::QHsm base classes to represent "raw" state machines that are not active objects, because they don't have event queue and execution thread. Such "raw" state machines are typically used as "Orthogonal Components".
|
||||
</li>
|
||||
|
||||
<li><span class="tag">8</span> Application-level events with parameters derive from the QP::QEvt class.
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
@next{exa}
|
||||
*/
|
||||
|
389
doxygen/exa.dox
Normal file
@ -0,0 +1,389 @@
|
||||
/*! @page exa Examples
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
@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:
|
||||
|
||||
- **to help you learn how to use QP/C** — the examples show the intended way of using QP/C features and structuring QP/C applications.
|
||||
|
||||
- **to provide you with a starting point for your own projects** — the examples are complete working projects, with correctly pre-configured tools, such as compiler options, linker script, debugger setup, etc.
|
||||
|
||||
@note
|
||||
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
|
||||
Starting with QP/C release 5.4.0, **all** examples 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 examples can't be added or updated independently from the QP/C baseline code.
|
||||
|
||||
All examples are located in sub-directories of the <span class="img folder">examples</span> @ref qpc_files "top-level folder", with the hierarchical organization outlined below:
|
||||
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">examples</span>
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm-cm</span> — Native examples for ARM-Cortex-M (bare-metal) <span class="tag">A</span>
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">blinky_ek-tm4c123gxl</span> — Blinky example for EK-TM4C123GXL board
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">qk</span> — Version for the @ref comp_qk "preemptive QK kernel"
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm</span> — build with ARM toolset
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">dbg</span> — Debug @ref exa_sec_conf "build configuration"
|
||||
</li>
|
||||
<li><span class="img folder">rel</span> — Release build configuration
|
||||
</li>
|
||||
<li><span class="img folder">spy</span> — Spy build configuration
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">gnu</span> — build with GNU toolset
|
||||
</li>
|
||||
<li><span class="img folder">iar</span> — build with IAR toolset
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">qv</span> — Version for the @ref comp_qv "cooperative QV kernel"
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm</span> — build with ARM toolset
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">dbg</span> — Debug @ref exa_sec_conf "build configuration"
|
||||
</li>
|
||||
<li><span class="img folder">rel</span> — Release build configuration
|
||||
</li>
|
||||
<li><span class="img folder">spy</span> — Spy build configuration
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">gnu</span> — build with GNU toolset
|
||||
</li>
|
||||
<li><span class="img folder">iar</span> — build with IAR toolset
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img file_c">...</span> — source code independent on the toolset
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<li><span class="img folder">ucos-ii</span> — Examples for uCOS-II (3rd-party RTOS) <span class="tag">B</span>
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm-cm</span> — Examples for ARM-Cortex-M
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">blinky_ek-tm4c123gxl</span> — Blinky example for EK-TM4C123GXL board
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm</span> — build with ARM toolset
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">dbg</span> — Debug build configuration
|
||||
</li>
|
||||
<li><span class="img folder">rel</span> — Release build configuration
|
||||
</li>
|
||||
<li><span class="img folder">spy</span> — Spy build configuration
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">iar</span> — build with IAR toolset
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<li><span class="img folder">lwip</span> — Examples for lwIP (3rd-party TCP/IP) <span class="tag">C</span>
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm-cm</span> — Examples for ARM-Cortex-M
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">lwip_ek-lm3s6965</span> — lwIP example for EK-LM3S6965 board
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">qk</span> — Version for the @ref comp_qk "preemptive QK kernel"
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">gnu</span> — build with GNU toolset
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">dbg</span> — Debug build configuration
|
||||
</li>
|
||||
<li><span class="img folder">rel</span> — Release build configuration
|
||||
</li>
|
||||
<li><span class="img folder">spy</span> — Spy build configuration
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">iar</span> — build with IAR toolset
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">qv</span> — Version for the @ref comp_qv "cooperative QV kernel"
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">gnu</span> — build with GNU toolset
|
||||
</li>
|
||||
<li><span class="img folder">iar</span> — build with IAR toolset
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<ul class="tag">
|
||||
<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_qk "QK" and @ref comp_qv "QV" kernels, respectively.
|
||||
</li>
|
||||
|
||||
<li><span class="tag">B</span> @subpage exa_rtos "Examples for 3rd-party RTOS"/@subpage 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>
|
||||
|
||||
<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.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@note
|
||||
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 **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 @subpage exa_apps "example applications", which are described on the separate pages:
|
||||
|
||||
- @ref blinky
|
||||
- @ref dpp
|
||||
- @ref game
|
||||
|
||||
With the exception of the game application, all other example applications can be implemented on a board with just a couple of LEDs. The @ref game application is a bit more involved and requires a small graphic display on the board.
|
||||
|
||||
Beyond these basic applications for demonstrating and testing the various @ref ports "QP/C ports", the QP/C distribution contains all examples described in the book <a class="extern" target="_blank" href="http://www.state-machine.com/psicc2" >Practical UML Statecharts in C/C++, 2nd Edition</a> (@sa exa_win32).
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@subsection exa_sec_boards Development Boards
|
||||
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 toolsets are used.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@subsection exa_sec_conf Build Configurations
|
||||
QP examples @ref ports "QP ports" are provided in the following three **build configurations**:
|
||||
|
||||
- **Debug** — this configuration is built with full debugging information and minimal optimization. When the QP framework finds no events to process, the framework busy-idles until there are new events to process. The @ref comp_qs "QS trace instrumentation" is **disabled**.
|
||||
|
||||
- **Release** — this configuration is built with no debugging information and high optimization. Single-stepping and debugging at the source-code level is effectively impossible due to the lack of debugging information and optimized code, but the debugger can be used to download and start the executable. When the QP framework finds no events to process, the framework puts the CPU to sleep until there are new events to process. The @ref comp_qs "QS trace instrumentation" is **disabled**.
|
||||
|
||||
- **Spy** — like the debug variant, this variant is built with full debugging information and minimal optimization. Additionally, it is build with the @ref comp_qs "QS trace instrumentation" enabled. The on-board serial port and the Q-Spy host application are used for sending and viewing trace data. Like the Debug configuration, the QP framework busy-idles until there are new events to process.
|
||||
|
||||
|
||||
@remark
|
||||
<strong>Why do you need multiple build configurations?</strong>@n
|
||||
The different phases of embedded software lifecycle 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="http://www.state-machine.com/qm/help"><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.
|
||||
|
||||
@note
|
||||
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> @ref qpc_files "top-level folder".
|
||||
|
||||
@note
|
||||
As far as possible, the code in the <span class="img folder">3rd_party</span> folder has been left unchanged from the original source. (Any modified code is clearly identified by top-level comments that detail the applied changes.) For that reason, the Third-Party code might produce **compilation warnings** in your builds.
|
||||
|
||||
The code in the <span class="img folder">3rd_party</span> folder comes from various sources, and Quantum
|
||||
Leaps, LLC expressly makes **no claims of ownership** to any of this code, even though some of the code might be customized or modified by Quantum Leaps.
|
||||
|
||||
@attention
|
||||
The Third-Party software components included in the <span class="img folder">3rd_party</span> folder are licensed under a variety of different licensing terms that are defined by the respective owners of this software and are spelled out in the `README.txt` or `LICENSE.txt` files included in the respective
|
||||
sub-folders.
|
||||
|
||||
|
||||
@next{exa_ref}
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_ref Cross-Reference
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
@tableofcontents
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section exa_ref_native Native Examples (Bare-Metal)
|
||||
- @ref exa_arm-cm (Cortex-M0/M0+/M3/M4/M4F)
|
||||
- @ref exa_arm7-9 ("classic ARM")
|
||||
- @ref exa_avr (8-bit megaAVR)
|
||||
- @ref exa_msp430 ("classic" MSP430 and "extended" MSP430x)
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section exa_ref_rtos Examples for Third-Party RTOS
|
||||
- @ref exa_cmsis-rtx (ARM Ltd.)
|
||||
- @ref exa_embos (SEGGER)
|
||||
- @ref exa_freertos (Real Time Engineers Ltd.)
|
||||
- @ref exa_threadx (Express Logic)
|
||||
- @ref exa_ucos-ii (Micrium)
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section exa_ref_os Examples for Third-Party OS
|
||||
- @ref exa_posix
|
||||
- @ref exa_win32
|
||||
- @ref exa_win32-qv
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section exa_ref_mwware Examples for Third-Party Middleware
|
||||
- @ref exa_qt (open source/commercial, see http://qt.io )
|
||||
- @ref exa_lwip (open source, see http://lwip.wikia.com/wiki/LwIP_Wiki )
|
||||
- @ref exa_emwin (SEGGER) — coming soon...
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@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.
|
||||
|
||||
@note
|
||||
You can hover the mouse cursor over the <span class="board"></span> icon in the list below to see the picture of the board.
|
||||
|
||||
- ARM Cortex-M Boards:
|
||||
- <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL">EK-TM4C123GXL</a> (TivaC LaunchPad)
|
||||
- <a class="preview board" href="bd_mbed-LPC1768.jpg" title="mbed-LPC1768">mbed-LPC1768</a>
|
||||
- <a class="preview board" href="bd_nucleo-l053r8.jpg" title="NUCLEO-L053R8">NUCLEO-L053R8</a>
|
||||
- <a class="preview board" href="bd_nucleo-l152re.jpg" title="NUCLEO-L152RE">NUCLEO-L152RE</a>
|
||||
- <a class="preview board" href="bd_EK-LM3S811.jpg" title="EK-LM3S811">EK-LM3S811</a>
|
||||
- <a class="preview board" href="bd_EK-LM3S6965.jpg" title="EK-LM3S6965">EK-LM3S6965</a>
|
||||
- <a class="preview board" href="bd_STM32F4-Discovery.jpg" title="STM32F4-Discovery">STM32F4-Discovery</a>
|
||||
|
||||
- ARM7 Boards:
|
||||
- <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK">AT91SAM7S-EK</a>
|
||||
|
||||
- AVR (megaAVR) Boards:
|
||||
- <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO">Arduino-UNO</a>
|
||||
|
||||
- MSP430 Boards:
|
||||
- <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2">MSP-EXP430G2</a> (MSP430 LaunchPad)
|
||||
- <a class="preview board" href="bd_MSP-EXP430F5529LP.jpg" title="MSP-EXP430F5529LP">MSP-EXP430F5529LP</a> (MSP430X LaunchPad)
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section exa_ref_mcu Examples by MCU Architecture
|
||||
- ARM Cortex-M0/M0+
|
||||
- @ref arm-cm_dpp_nucleo-l053r8 <a class="preview board" href="bd_nucleo-l053r8.jpg" title="NUCLEO-L053R8"></a>
|
||||
- ARM Cortex-M3
|
||||
- @ref arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_nucleo-l152re.jpg" title="NUCLEO-L152RE"></a>
|
||||
- @ref arm-cm_game_ek-lm3s811 <a class="preview board" href="bd_EK-LM3S811.jpg" title="EK-LM3S811"></a>
|
||||
- @ref arm-cm_dpp_mbed-lpc1768 <a class="preview board" href="bd_mbed-LPC1768.jpg" title="mbed-LPC1768"></a>
|
||||
- @ref lwip_ek-lm3s6965 <a class="preview board" href="bd_EK-LM3S6965.jpg" title="EK-LM3S6965"></a>
|
||||
- ARM Cortex-M4F (with hardware FPU)
|
||||
- @ref arm-cm_blinky_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- ARM7 / ARM9
|
||||
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a>
|
||||
|
||||
- AVRmega
|
||||
- @ref avr_blinky_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
- @ref avr_dpp_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
|
||||
- AVR32UC (coming soon...)
|
||||
|
||||
- MSP430
|
||||
- @ref msp430_blinky_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></a>
|
||||
- @ref msp430_blinky_msp-exp430f5529lp <a class="preview board" href="bd_MSP-EXP430F5529LP.jpg" title="MSP-EXP430F5529LP"></a>
|
||||
- @ref msp430_dpp_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></a>
|
||||
|
||||
- PIC24 /dsPIC (coming soon...)
|
||||
- PIC32 (coming soon...)
|
||||
- Renesas RX (coming soon...)
|
||||
- TI TMS320C28x (C28x) (coming soon...)
|
||||
- TI TMS320C55x (C55x) (coming soon...)
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section exa_ref_tools Examples by Development Toolset
|
||||
- ARM architecture
|
||||
- ARM (ARM-Keil)
|
||||
- @ref arm-cm_blinky_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_mbed-lpc1768 <a class="preview board" href="bd_mbed-LPC1768.jpg" title="mbed-LPC1768"></a>
|
||||
- @ref arm-cm_dpp_nucleo-l053r8 <a class="preview board" href="bd_nucleo-l053r8.jpg" title="NUCLEO-L053R8"></a>
|
||||
- @ref arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_nucleo-l152re.jpg" title="NUCLEO-L152RE"></a>
|
||||
- @ref arm-cm_game_ek-lm3s811 <a class="preview board" href="bd_EK-LM3S811.jpg" title="EK-LM3S811"></a>
|
||||
- GNU-ARM
|
||||
- @ref arm-cm_blinky_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_mbed-lpc1768 <a class="preview board" href="bd_mbed-LPC1768.jpg" title="mbed-LPC1768"></a>
|
||||
- @ref arm-cm_dpp_nucleo-l053r8 <a class="preview board" href="bd_nucleo-l053r8.jpg" title="NUCLEO-L053R8"></a>
|
||||
- @ref arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_nucleo-l152re.jpg" title="NUCLEO-L152RE"></a>
|
||||
- @ref arm-cm_game_ek-lm3s811 <a class="preview board" href="bd_EK-LM3S811.jpg" title="EK-LM3S811"></a>
|
||||
- @ref lwip_ek-lm3s6965 <a class="preview board" href="bd_EK-LM3S6965.jpg" title="EK-LM3S6965"></a>
|
||||
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a>
|
||||
- IAR EWARM
|
||||
- @ref arm-cm_blinky_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_mbed-lpc1768 <a class="preview board" href="bd_mbed-LPC1768.jpg" title="mbed-LPC1768"></a>
|
||||
- @ref arm-cm_dpp_nucleo-l053r8 <a class="preview board" href="bd_nucleo-l053r8.jpg" title="NUCLEO-L053R8"></a>
|
||||
- @ref arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_nucleo-l152re.jpg" title="NUCLEO-L152RE"></a>
|
||||
- @ref arm-cm_game_ek-lm3s811 <a class="preview board" href="bd_EK-LM3S811.jpg" title="EK-LM3S811"></a>
|
||||
- @ref lwip_ek-lm3s6965 <a class="preview board" href="bd_EK-LM3S6965.jpg" title="EK-LM3S6965"></a>
|
||||
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a>
|
||||
|
||||
- AVR architecture
|
||||
- GNU-AVR (WinAVR)
|
||||
- @ref avr_blinky_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
- @ref avr_dpp_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
- IAR EWAVR
|
||||
- @ref avr_blinky_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
- @ref avr_dpp_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
|
||||
- MSP430 architecture
|
||||
- CCS-430
|
||||
- @ref msp430_blinky_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></a>
|
||||
- @ref msp430_blinky_msp-exp430f5529lp <a class="preview board" href="bd_MSP-EXP430F5529LP.jpg" title="MSP-EXP430F5529LP"></a>
|
||||
- @ref msp430_dpp_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></a>
|
||||
- IAR EW430
|
||||
- @ref msp430_blinky_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></a>
|
||||
- @ref msp430_blinky_msp-exp430f5529lp <a class="preview board" href="bd_MSP-EXP430F5529LP.jpg" title="MSP-EXP430F5529LP"></a>
|
||||
- @ref msp430_dpp_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></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>
|
||||
- @ref avr_blinky_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
- @ref avr_dpp_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
- NXP
|
||||
- @ref arm-cm_dpp_mbed-lpc1768 <a class="preview board" href="bd_mbed-LPC1768.jpg" title="mbed-LPC1768"></a>
|
||||
- STMicroelectronics
|
||||
- @ref arm-cm_dpp_nucleo-l053r8 <a class="preview board" href="bd_nucleo-l053r8.jpg" title="NUCLEO-L053R8"></a>
|
||||
- @ref arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_nucleo-l152re.jpg" title="NUCLEO-L152RE"></a>
|
||||
- Texas Instruments
|
||||
- @ref arm-cm_blinky_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_game_ek-lm3s811 <a class="preview board" href="bd_EK-LM3S811.jpg" title="EK-LM3S811"></a>
|
||||
- @ref lwip_ek-lm3s6965 <a class="preview board" href="bd_EK-LM3S6965.jpg" title="EK-LM3S6965"></a>
|
||||
|
||||
@next{exa_native}
|
||||
*/
|
83
doxygen/exa_apps.dox
Normal file
@ -0,0 +1,83 @@
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_apps Example Applications
|
||||
|
||||
<p>To demonstrate QP/C features, you need to create an application that does "something interesting". Instead of inventing this "something interesting" for each and every example, most of the example projects implement one of the three example applications, which are described on the separate pages:
|
||||
</p>
|
||||
|
||||
- @subpage blinky
|
||||
- @subpage dpp
|
||||
- @subpage game
|
||||
|
||||
Additionally, the QP/C distribution contains several application examples described in the <a class="extern" target="_blank" href="http://www.state-machine.com/psicc2">PSiCC2</a> book.
|
||||
|
||||
- Calculator
|
||||
- QHsmTst
|
||||
- PELICAN
|
||||
- ...
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page blinky Simple Blinky Application
|
||||
|
||||
<p>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 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.
|
||||
</p>
|
||||
|
||||
@image html blinky_ek-tm4c123gxl.gif Blinky on EK-TM4C123GLX (TivaC LaunchPad)
|
||||
|
||||
The ultra-simple Blinky application, which consists of just one active object named `Blinky`, is intentionally kept small and illustrates only the most basic QP features, such as:
|
||||
|
||||
- defining a simple Blinky active object (AO) @ref oop "class";
|
||||
- hand-coding the simple state machine of the Blinky AO;
|
||||
- using a periodic time event;
|
||||
- initializing the QP framework; and
|
||||
- starting an AO.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section blinky_sm State Machine
|
||||
The very simple state machine of the Blinky AO is shown in the figure below:
|
||||
|
||||
@image html SM_blinky.png "State Machine of the Blinky AO"
|
||||
|
||||
<ul class="tag">
|
||||
<li><span class="tag">1</span> The top-most initial transition in this state machine arms a QP time event (QTimeEvt_armX()) to deliver the `TIMEOUT` signal every half second, so that the LED can stay on for one half second and off for the other half.
|
||||
</li>
|
||||
|
||||
<li><span class="tag">2</span> The initial transition leads to state "off", which turns the LED off in the entry action (`BSP_ledOff()`).
|
||||
</li>
|
||||
|
||||
<li><span class="tag">3</span> When the `TIMEOUT` event arrives in the "off" state, the "off" state transitions to the "on" state
|
||||
</li>
|
||||
|
||||
<li><span class="tag">4</span> The "on" state turns the LED on in the entry action (`BSP_ledOn()`).
|
||||
</li>
|
||||
|
||||
<li><span class="tag">5</span> When the `TIMEOUT` event arrives in the "on" state, the "on" state transitions back to "off", which cases execution of the entry action, in which the LED is turned off. From that point on the cycle repeats forever because the `TIMEOUT` events keep getting generated at the pre-determined rate.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
@next{dpp}
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page dpp Dining Philosophers Problem (DPP)
|
||||
|
||||
@image html dpp_win32.jpg
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
@next{game}
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page game "Fly 'n' Shoot" Game
|
||||
|
||||
@image html game_win32.jpg
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
|
79
doxygen/exa_mware.dox
Normal file
@ -0,0 +1,79 @@
|
||||
/*! @page exa_mware Third-Party Middleware
|
||||
|
||||
- @subpage exa_qt
|
||||
- @subpage exa_lwip
|
||||
- @subpage exa_emwin
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_qt Qt (GUI Framework)
|
||||
|
||||
- \subpage qt_dpp
|
||||
- \subpage qt_dpp-gui
|
||||
- \subpage qt_game-gui
|
||||
- \subpage qt_pelican-gui
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page qt_dpp DPP (Console) for Qt
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page qt_dpp-gui DPP-GUI for Qt
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page qt_game-gui Game-GUI for Qt
|
||||
|
||||
@image html qt_game-gui.png
|
||||
@n@n
|
||||
@image html qtcreator_game-gui.png
|
||||
@n@n
|
||||
@image html qtdesign_game-gui.png
|
||||
@n@n
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page qt_pelican-gui PELICAN-GUI for Qt
|
||||
|
||||
PEdestrian LIght CONtrolled (PELICAN) crossing example for Qt
|
||||
|
||||
@image html qt_pelican-gui.png
|
||||
@n@n
|
||||
@image html qtdesign_pelican-gui.png
|
||||
@n@n
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_lwip lwIP TCP/IP
|
||||
|
||||
- @subpage lwip_ek-lm3s6965
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page lwip_ek-lm3s6965 lwIP on EK-LM3S6965
|
||||
|
||||
@image html bd_EK-LM3S6965.jpg EK-LM3S6965 board
|
||||
|
||||
lwIP example for Texas Instruments EK-LM3S6965 (Cortex-M3) with GNU-ARM and IAR-ARM toolsets.
|
||||
|
||||
@image html bd_EK-LM3S6965_lwip.jpg QP-lwIP on EK-LM3S6965
|
||||
@n@n
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_emwin emWin Embedded GUI
|
||||
|
||||
coming soon...
|
||||
|
||||
*/
|
239
doxygen/exa_native.dox
Normal file
@ -0,0 +1,239 @@
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_native Native Examples (Bare-Metal)
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
@tableofcontents
|
||||
|
||||
<p>The QP/C framework contains real-time kernels (@ref comp_qv and @ref comp_qk), so it can run natively ("bare-metal") on single-chip microcontrollers, completely replacing a traditional RTOS. The following ready-to-use, native (bare-metal) examples are provided for QP/C:
|
||||
</p>
|
||||
|
||||
@note
|
||||
You can hover the mouse cursor over the <span class="board"></span> icon in the list below to see the picture of the board.
|
||||
|
||||
- @subpage exa_arm-cm (Cortex-M0/M0+/M3/M4F)
|
||||
- @ref arm-cm_blinky_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @ref arm-cm_dpp_mbed-lpc1768 <a class="preview board" href="bd_mbed-LPC1768.jpg" title="mbed-LPC1768"></a>
|
||||
- @ref arm-cm_dpp_nucleo-l053r8 <a class="preview board" href="bd_nucleo-l053r8.jpg" title="NUCLEO-L053R8"></a>
|
||||
- @ref arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_nucleo-l152re.jpg" title="NUCLEO-L152RE"></a>
|
||||
- @ref arm-cm_game_ek-lm3s811 <a class="preview board" href="bd_EK-LM3S811.jpg" title="EK-LM3S811"></a>
|
||||
|
||||
- @subpage exa_arm7-9 ("classic" ARM)
|
||||
- @ref arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a>
|
||||
|
||||
- @subpage exa_avr (8-bit megaAVR)
|
||||
- @ref avr_blinky_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
- @ref avr_dpp_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
|
||||
- @subpage exa_msp430 ("classic" MSP430 and "extended" MSP430x)
|
||||
- @ref msp430_blinky_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></a>
|
||||
- @ref msp430_blinky_msp-exp430f5529lp <a class="preview board" href="bd_MSP-EXP430F5529LP.jpg" title="MSP-EXP430F5529LP"></a>
|
||||
- @ref msp430_dpp_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></a>
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_arm-cm ARM Cortex-M
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
The native (bare-metal) QP/C examples for ARM Cortex-M are as follows:
|
||||
|
||||
- @subpage arm-cm_blinky_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @subpage arm-cm_dpp_ek-tm4c123gxl <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @subpage arm-cm_dpp_mbed-lpc1768 <a class="preview board" href="bd_mbed-LPC1768.jpg" title="mbed-LPC1768"></a>
|
||||
- @subpage arm-cm_dpp_nucleo-l053r8 <a class="preview board" href="bd_nucleo-l053r8.jpg" title="NUCLEO-L053R8"></a>
|
||||
- @subpage arm-cm_dpp_nucleo-l152re <a class="preview board" href="bd_nucleo-l152re.jpg" title="NUCLEO-L152RE"></a>
|
||||
- @subpage arm-cm_game_ek-lm3s811 <a class="preview board" href="bd_EK-LM3S811.jpg" title="EK-LM3S811"></a>
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page arm-cm_blinky_ek-tm4c123gxl Blinky on EK-TM4C123GXL
|
||||
|
||||
@image html bd_EK-TM4C123GXL.jpg EK-TM4C123GXL board
|
||||
|
||||
Simple "Blinky" example for Texas Instruments TivaC123GXL MCU (Cortex-M4F), ARM (MDK-ARM), GNU-ARM, IAR EWARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page arm-cm_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
|
||||
|
||||
@image html bd_EK-TM4C123GXL.jpg EK-TM4C123GXL board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for Texas Instruments TivaC123GXL MCU (Cortex-M4F), ARM (MDK-ARM), GNU-ARM, IAR EWARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page arm-cm_dpp_mbed-lpc1768 DPP on mbed-LPC1768
|
||||
|
||||
@image html bd_mbed-LPC1768.jpg mbed-LPC1768 board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for NXP LPC1768 MCU (Cortex-M3) with GNU-ARM toolset.
|
||||
|
||||
@image html mbed-LPC1768_button.jpg Adding External Button to mbed-LPC1768
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page arm-cm_dpp_nucleo-l053r8 DPP on NUCLEO-L053R8
|
||||
|
||||
@image html bd_nucleo-l053r8.jpg NUCLEO-L053R8 board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for STM32-L053R8T6 MCU (Cortex-M0+) with ARM-Keil, GNU-ARM, and IAR-ARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page arm-cm_dpp_nucleo-l152re DPP on NUCLEO-L152RE
|
||||
|
||||
@image html bd_nucleo-l152re.jpg NUCLEO-L152RE board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for STM32-L152RET6 MCU (Cortex-M3) with ARM-Keil, GNU-ARM, and IAR-ARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page arm-cm_game_ek-lm3s811 "Fly 'n' Shoot" Game on EK-LM3S811
|
||||
|
||||
@image html bd_EK-LM3S811.jpg EK-LM3S811 board
|
||||
|
||||
"Fly 'n' Shoot" game example for Texas Instruments LM3S811 MCU (Cortex-M3), ARM (MDK-ARM), GNU-ARM, IAR EWARM toolsets.
|
||||
|
||||
@image html bd_EK-LM3S811_game.jpg Game playing on EK-LM3S811 board
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_arm7-9 ARM7 / ARM9
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
The native (bare-metal) QP/C examples for the "classic" ARM7/ARM9 are as follows:
|
||||
|
||||
- @subpage arm7-9_dpp_at91sam7s-ek <a class="preview board" href="bd_AT91SAM7S-EK.jpg" title="AT91SAM7S-EK"></a>
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page arm7-9_dpp_at91sam7s-ek DPP on AT91SAM7S-EK
|
||||
|
||||
@image html bd_AT91SAM7S-EK.jpg AT91SAM7S-EK board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for Atmel AT91SAM7S MCU (ARM7) with GNU-ARM toolset.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_avr AVR
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
The native (bare-metal) QP/C examples for the 8-bit AVRmega are as follows:
|
||||
|
||||
- @subpage avr_blinky_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
- @subpage avr_dpp_arduino-uno <a class="preview board" href="bd_Arduino-UNO.jpg" title="Arduino-UNO"></a>
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page avr_blinky_arduino-uno Blinky on Arduino-UNO
|
||||
|
||||
@image html bd_Arduino-UNO.jpg Arduino-UNO board
|
||||
|
||||
Simple Blinky example for Arduino-UNO with GNU-AVR and IAR-AVR toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page avr_dpp_arduino-uno DPP on Arduino-UNO
|
||||
|
||||
@image html bd_Arduino-UNO.jpg Arduino-UNO board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for Arduino-UNO with GNU-AVR and IAR-AVR toolsets.
|
||||
|
||||
@image html Arduino-UNO_button.jpg Adding External Button to Arduino-UNO
|
||||
|
||||
@image html Arduino-UNO_button_schem.jpg External Button Schematics
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_msp430 MSP430
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
The native (bare-metal) QP/C examples for MSP430 are as follows:
|
||||
|
||||
- @subpage msp430_blinky_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></a>
|
||||
- @subpage msp430_blinky_msp-exp430f5529lp <a class="preview board" href="bd_MSP-EXP430F5529LP.jpg" title="MSP-EXP430F5529LP"></a>
|
||||
- @subpage msp430_dpp_msp-exp430g2 <a class="preview board" href="bd_MSP-EXP430G2.jpg" title="MSP-EXP430G2"></a>
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page msp430_blinky_msp-exp430g2 Blinky on MSP-EXP430G2
|
||||
|
||||
@image html bd_MSP-EXP430G2.jpg MSP-EXP430G2 board
|
||||
|
||||
Simple Blinky example for MSP-EXP430G2 with CCS-430 and IAR-430 toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page msp430_blinky_msp-exp430f5529lp Blinky on MSP-EXP430F5529LP
|
||||
|
||||
@image html bd_MSP-EXP430F5529LP.jpg MSP-EXP430F5529LP board
|
||||
|
||||
Simple Blinky example for MSP-EXP430F5529LP with CCS-430 and IAR-430 toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page msp430_dpp_msp-exp430g2 DPP on MSP-EXP430G2
|
||||
|
||||
@image html bd_MSP-EXP430G2.jpg MSP-EXP430G2 board
|
||||
|
||||
DPP example for MSP-EXP430G2 with CCS-430 and IAR-430 toolsets.
|
||||
|
||||
@section msp430_dpp_msp-exp430g2_qs QS Output
|
||||
This example demonstrates the QS software tracing output in the Spy build configuration. QS uses the hardware UART of the MSP-EXP430G2 board connected to the Virtual COM Port on the debugger. This means that you don't need any additional wiring to receive the QS output on your development workstation.
|
||||
|
||||
The QS trace date requires the following setting of the QSPY host utility
|
||||
|
||||
@verbatim
|
||||
qspy -cCOM_PORT -b9600 -O2 -F2 -E1 -P1 -B1
|
||||
@endverbatim
|
||||
|
||||
where `COM_PORT` denotes the Virtual COM port, which you can find out in the Device Manager (see the screen shot below):
|
||||
|
||||
@image html com_msp-exp430g2.png Virtual COM port of the MSP-EXP430G2 board
|
||||
|
||||
@note
|
||||
To receive the QS data over the Virtual COM Port, you need to make sure that the jumper J3 on the MSP-EXP430G2 board is configured for the "Hardware UART" (the first two jumpers should be in the horizontal setting, as shown in the picture of the MSP-EXP430G2 board on top of this page.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
56
doxygen/exa_os.dox
Normal file
@ -0,0 +1,56 @@
|
||||
/*! @page exa_os Examples for Third-Party OS
|
||||
|
||||
- @subpage exa_posix
|
||||
- @subpage exa_win32
|
||||
- @subpage exa_win32-qv
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_posix POSIX (Linux, etc.)
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_win32 Win32 API (Windows)
|
||||
|
||||
<p>The <span class="img folder">examples/win32</span> folder contains all examples described in the book <a class="extern" target="_blank" href="http://www.state-machine.com/psicc2" >Practical UML Statecharts in C/C++, 2nd Edition</a>. These examples include:
|
||||
</p>
|
||||
|
||||
- <span class="img folder">blinky</span> Simple "Blinky" for Windows (command line)
|
||||
- <span class="img folder">calc</span> Calculator example from Chapter 2 of PSiCC2
|
||||
- <span class="img folder">comp</span> Orthogonal Component design pattern
|
||||
- <span class="img folder">comp_qm</span> Orthogonal Component with QM model design pattern
|
||||
- <span class="img folder">defer</span> Deferred Event design pattern
|
||||
- <span class="img folder">dpp</span> DPP (command-line)
|
||||
- <span class="img folder">dpp-gui</span> DPP (with GUI on Windows)
|
||||
- <span class="img folder">game-gui</span> "Fly 'n' Shoot" game from Chapter 1 of PSiCC2
|
||||
- <span class="img folder">history</span> Transition-to-History design pattern (hand-coded)
|
||||
- <span class="img folder">history_qm</span> Transition-to-History with QM model
|
||||
- <span class="img folder">qmsmtst</span> Test State Machine based on QP::QMsm with QM model
|
||||
- <span class="img folder">qhsmtst</span> Test State Machine based on QP::QHsm with QM model
|
||||
- <span class="img folder">reminder</span> Reminder design pattern from Chapter 5 of PSiCC2
|
||||
- <span class="img folder">reminder</span> Reminder design pattern different version
|
||||
|
||||
@sa
|
||||
- @ref exa_win32-qv
|
||||
- @ref win32
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_win32-qv Win32-QV (Windows)
|
||||
|
||||
<p>The <span class="img folder">examples/win32-qv</span> folder contains examples for Win32 API with the cooperative QV kernel. In the Win32-QV port all active objects share only one Win32 thread and are scheduled exactly as in the \ref comp_qv "cooperative QV kernel". The following examples are provided:
|
||||
</p>
|
||||
|
||||
- <span class="img folder">dpp</span> DPP (command-line)
|
||||
- <span class="img folder">game-gui</span> "Fly 'n' Shoot" game from Chapter 1 of PSiCC2
|
||||
|
||||
@note
|
||||
All examples for @ref exa_win32 will also work with the @ref win32-qv "Win32-QV port" without any modifications to the source code, because @ref win32-qv "Win32-QV port" is designed as a drop-in replacement for the standard @ref win32 "Win32 port". To build the examples with @ref win32-qv "Win32-QV port" you merely need to include <span class="img folder">ports/win32-qv</span> instead of <span class="img folder">ports/win32</span> and you need to link the @ref win32-qv "Win32-QV" QP library.
|
||||
|
||||
@sa
|
||||
- @ref exa_win32
|
||||
- @ref win32-qv
|
||||
*/
|
214
doxygen/exa_rtos.dox
Normal file
@ -0,0 +1,214 @@
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_rtos Examples for Third-Party RTOS
|
||||
|
||||
The main purpose of integrating QP/C with conventional RTOSes is to enable you to incorporate various communication stacks (TCP/IP, USB, CAN, etc.) as well as other middleware, which requires the ability to **block** the task code.
|
||||
|
||||
- @subpage exa_cmsis-rtx
|
||||
- @subpage exa_embos
|
||||
- @subpage exa_freertos
|
||||
- @subpage exa_threadx
|
||||
- @subpage exa_ucos-ii
|
||||
|
||||
@note
|
||||
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.
|
||||
|
||||
@next{cmsis-rtx}
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_cmsis-rtx CMSIS-RTOS RTX
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
The QP/C examples for CMSIS-RTX (on Cortex-M) are as follows:
|
||||
|
||||
- @subpage cmsis-rtx_blinky_ek-tm4c123gxl (Cortex-M4F) <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @subpage cmsis-rtx_dpp_ek-tm4c123gxl (Cortex-M4F) <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @subpage cmsis-rtx_dpp_nucleo-l053r8 (Cortex-M0+) <a class="preview board" href="bd_nucleo-l053r8.jpg" title="NUCLEO-L053R8"></a>
|
||||
- @subpage cmsis-rtx_dpp_nucleo-l152re (Cortex-M43) <a class="preview board" href="bd_nucleo-l152re.jpg" title="NUCLEO-L152RE"></a>
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page cmsis-rtx_blinky_ek-tm4c123gxl Blinky on EK-TM4C123GXL
|
||||
|
||||
@image html bd_EK-TM4C123GXL.jpg EK-TM4C123GXL board
|
||||
|
||||
Simple "Blinky" example for Texas Instruments TivaC123GXL MCU (Cortex-M4F), ARM (MDK-ARM), GNU-ARM, IAR EWARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page cmsis-rtx_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
|
||||
|
||||
@image html bd_EK-TM4C123GXL.jpg EK-TM4C123GXL board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for Texas Instruments TivaC123GXL MCU (Cortex-M4F), ARM (MDK-ARM), GNU-ARM, IAR EWARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page cmsis-rtx_dpp_nucleo-l053r8 DPP on NUCLEO-L053R8
|
||||
|
||||
@image html bd_nucleo-l053r8.jpg NUCLEO-L053R8 board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for STM32-L053R8T6 MCU (Cortex-M0+) with ARM-Keil, GNU-ARM, and IAR-ARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page cmsis-rtx_dpp_nucleo-l152re DPP on NUCLEO-L152RE
|
||||
|
||||
@image html bd_nucleo-l152re.jpg NUCLEO-L152RE board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for STM32-L152RET6 MCU (Cortex-M3) with ARM-Keil, GNU-ARM, and IAR-ARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_embos embOS
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
The QP/C examples for SEGGER embOS are as follows:
|
||||
|
||||
- ARM Cortex-M
|
||||
- @subpage embos_dpp_stm32f429-discovery (Cortex-M4F) <a class="preview board" href="bd_STM32F4-Discovery.jpg" title="STM32F4-Discovery">STM32F4-Discovery</a>
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page embos_dpp_stm32f429-discovery DPP on STM32F4-Discovery
|
||||
|
||||
@image html bd_STM32F4-Discovery.jpg STM32F4-Discovery board
|
||||
|
||||
DPP example for STM32F4407VGT6 MCU (Cortex-M4F), IAR EWARM toolset.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section embos_dpp_stm32f429-discovery_qs QS Software Tracing
|
||||
|
||||
The DPP example provides the "Spy" build configuration, which outputs the QS (Quantum Spy) software tracing data through USART2. To get the data out ouf the board, you need to connect the TTL/RS232 converter as follows:
|
||||
|
||||
<center>
|
||||
STM32F4-Discovery | TTL/RS232 Converter
|
||||
-------------------|:------------------------
|
||||
PA2 | TX
|
||||
PA3 | RX (currently not used)
|
||||
VDD | VCC
|
||||
GND | GND
|
||||
</center>
|
||||
|
||||
@image html bd_STM32F4-Discovery_RS232.jpg STM32F4-Discovery board connected to RS232 level shifter
|
||||
|
||||
The output is generated at 115200 baud rate.
|
||||
|
||||
Here is an example invocation of the QSPY host application to receive the QS data from STM32F4-Discovery:
|
||||
|
||||
\verbatim
|
||||
qspy -cCOM1
|
||||
\endverbatim
|
||||
|
||||
The actual COM port number might be different on your Windows machine. Please check the Device Manager to find the COM port number.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_freertos FreeRTOS
|
||||
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
The QP/C examples for FreeRTOS are as follows:
|
||||
|
||||
- ARM Cortex-M
|
||||
- @subpage freertos_blinky_ek-tm4c123gxl (Cortex-M4F) <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
- @subpage freertos_dpp_ek-tm4c123gxl (Cortex-M4F) <a class="preview board" href="bd_EK-TM4C123GXL.jpg" title="EK-TM4C123GXL"></a>
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page freertos_blinky_ek-tm4c123gxl Blinky on EK-TM4C123GXL
|
||||
|
||||
@image html bd_EK-TM4C123GXL.jpg EK-TM4C123GXL board
|
||||
|
||||
Simple "Blinky" example for Texas Instruments TivaC123GXL MCU (Cortex-M4F), GNU-ARM, IAR EWARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page freertos_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
|
||||
|
||||
@image html bd_EK-TM4C123GXL.jpg EK-TM4C123GXL board
|
||||
|
||||
Dining Philosophers Problem (DPP) example for Texas Instruments TivaC123GXL MCU (Cortex-M4F), GNU-ARM, IAR EWARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_threadx ThreadX
|
||||
|
||||
The QP/C examples for ThreadX (Express Logic) are as follows:
|
||||
|
||||
- @subpage threadx_dpp_visual-studio
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page threadx_dpp_visual-studio DPP Demo with VC++
|
||||
|
||||
@image html threadx_dpp.jpg DPP example for ThreadX in Command Prompt on Windows
|
||||
|
||||
DPP example built for ThreadX demo on Windows with Visual Studio.
|
||||
|
||||
@note
|
||||
Due to the limitations of the ThreadX library for Windows, the DPP example can only instantiate one `Philo[0]` active object.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
|
||||
/*##########################################################################*/
|
||||
/*! @page exa_ucos-ii uC/OS-II
|
||||
@htmlonly
|
||||
<script src="preview.js" type="text/javascript"></script>
|
||||
@endhtmlonly
|
||||
|
||||
The QP/C examples for uC/OS-II 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>
|
||||
- @subpage ucos-ii_dpp_nucleo-l152re (Cortex-M3) <a class="preview board" href="bd_STM32F4-Discovery.jpg" title="STM32F4-Discovery"></a>
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page ucos-ii_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
|
||||
|
||||
@image html bd_EK-TM4C123GXL.jpg EK-TM4C123GXL board
|
||||
|
||||
DPP example for Texas Instruments TivaC123GXL MCU (Cortex-M4F) and IAR EWARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page ucos-ii_dpp_nucleo-l152re DPP on NUCLEO-L152RE
|
||||
|
||||
@image html bd_nucleo-l152re.jpg NUCLEO-L152RE board
|
||||
|
||||
DPP example for Texas Instruments STM32 L152RET6 MCU (Cortex-M3) and IAR EWARM toolsets.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
@ -1,17 +1,16 @@
|
||||
<!-- HTML footer for doxygen 1.8.5-->
|
||||
<!-- start footer part -->
|
||||
<!--BEGIN GENERATE_TREEVIEW-->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="footer"><a href="http://www.state-machine.com">© Quantum Leaps</a>
|
||||
$projectname $projectnumber
|
||||
<li class="footer">
|
||||
<a title="Quantum Leaps: innovating embedded systems" href="http://www.state-machine.com">© Quantum Leaps</a> | <b>$projectname $projectnumber</b>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--END GENERATE_TREEVIEW-->
|
||||
<!--BEGIN !GENERATE_TREEVIEW-->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
<a href="http://www.state-machine.com">© Quantum Leaps</a> $projectname $projectnumber
|
||||
<a title="Quantum Leaps: innovating embedded systems" href="http://www.state-machine.com">© Quantum Leaps</a> | <b>$projectname $projectnumber</b>
|
||||
</small></address>
|
||||
<!--END !GENERATE_TREEVIEW-->
|
||||
</body>
|
||||
|
@ -4,6 +4,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Bluefish 2.2.4" />
|
||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@ -24,7 +25,7 @@ $extrastylesheet
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<!--BEGIN PROJECT_LOGO-->
|
||||
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
|
||||
<td id="projectlogo"><a title="Quantum Leaps: innovating embedded systems" href="http://www.state-machine.com"><img alt="Logo" src="$relpath^$projectlogo"/></a></td>
|
||||
<!--END PROJECT_LOGO-->
|
||||
<!--BEGIN PROJECT_NAME-->
|
||||
<td style="padding-left: 0.5em;">
|
||||
|
1457
doxygen/history.dox
Normal file
BIN
doxygen/images/AN_Getting_Started_with_QPC.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
doxygen/images/AN_MISRA.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
doxygen/images/AN_Simple_OOP_in_C.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
doxygen/images/Arduino-UNO_button.jpg
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
doxygen/images/Arduino-UNO_button_schem.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
doxygen/images/FA1.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
doxygen/images/SM_blinky.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
doxygen/images/bd_AT91SAM7S-EK.jpg
Normal file
After Width: | Height: | Size: 104 KiB |
BIN
doxygen/images/bd_AT91SAM7S-EK_J-Link.jpg
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
doxygen/images/bd_Arduino-UNO.jpg
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
doxygen/images/bd_EK-LM3S6965.jpg
Normal file
After Width: | Height: | Size: 93 KiB |
BIN
doxygen/images/bd_EK-LM3S6965_lwip.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
doxygen/images/bd_EK-LM3S811.jpg
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
doxygen/images/bd_EK-LM3S811_game.jpg
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
doxygen/images/bd_EK-TM4C123GXL.jpg
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
doxygen/images/bd_MSP-EXP430F5529LP.jpg
Normal file
After Width: | Height: | Size: 111 KiB |
BIN
doxygen/images/bd_MSP-EXP430G2.jpg
Normal file
After Width: | Height: | Size: 112 KiB |
BIN
doxygen/images/bd_NUCLEO-L053R8.jpg
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
doxygen/images/bd_NUCLEO-L152RE.jpg
Normal file
After Width: | Height: | Size: 75 KiB |
BIN
doxygen/images/bd_STM32F4-Discovery.jpg
Normal file
After Width: | Height: | Size: 127 KiB |
BIN
doxygen/images/bd_STM32F4-Discovery_RS232.jpg
Normal file
After Width: | Height: | Size: 107 KiB |
BIN
doxygen/images/bd_mbed-LPC1768.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
doxygen/images/blinky_ek-tm4c123gxl.gif
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
doxygen/images/com_msp-exp430g2.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
doxygen/images/header_logo_ql.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
doxygen/images/logo_qp.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
doxygen/images/logo_qt.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
doxygen/images/mbed-LPC1768_button.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
doxygen/images/qp_classes.png
Normal file
After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 33 KiB |
BIN
doxygen/images/qt_game-gui.png
Normal file
After Width: | Height: | Size: 238 KiB |
BIN
doxygen/images/qt_pelican-gui.png
Normal file
After Width: | Height: | Size: 255 KiB |
BIN
doxygen/images/qtcreator_game-gui.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
doxygen/images/qtdesign_game-gui.png
Normal file
After Width: | Height: | Size: 373 KiB |
BIN
doxygen/images/qtdesign_pelican-gui.png
Normal file
After Width: | Height: | Size: 364 KiB |
BIN
doxygen/images/threadx_dpp.jpg
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
doxygen/images/under_construction.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
doxygen/img/board.png
Normal file
After Width: | Height: | Size: 400 B |
BIN
doxygen/img/checkboxoff.png
Normal file
After Width: | Height: | Size: 250 B |
BIN
doxygen/img/checkboxon.png
Normal file
After Width: | Height: | Size: 165 B |
BIN
doxygen/img/extern.png
Normal file
After Width: | Height: | Size: 143 B |
BIN
doxygen/img/file.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
doxygen/img/file_doc.png
Normal file
After Width: | Height: | Size: 555 B |
BIN
doxygen/img/file_header.png
Normal file
After Width: | Height: | Size: 604 B |
BIN
doxygen/img/file_source_c.png
Normal file
After Width: | Height: | Size: 624 B |
BIN
doxygen/img/file_source_cpp.png
Normal file
After Width: | Height: | Size: 807 B |
BIN
doxygen/img/folder.png
Normal file
After Width: | Height: | Size: 458 B |
BIN
doxygen/img/forbidden.png
Normal file
After Width: | Height: | Size: 859 B |
BIN
doxygen/img/header_bg.png
Normal file
After Width: | Height: | Size: 506 B |
29
doxygen/img/img.htm
Normal file
@ -0,0 +1,29 @@
|
||||
<!-- HTML header for doxygen 1.8.5-->
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<title>QP built-in images</title>
|
||||
|
||||
<img src="board.png">
|
||||
<img src="checkboxoff.png">
|
||||
<img src="checkboxon.png">
|
||||
<img src="extern.png">
|
||||
<img src="file.png">
|
||||
<img src="file_doc.png">
|
||||
<img src="file_header.png">
|
||||
<img src="file_source_c.png">
|
||||
<img src="file_source_cpp.png">
|
||||
<img src="folder.png">
|
||||
<img src="forbidden.png">
|
||||
<img src="header_bg.png">
|
||||
<img src="img.htm">
|
||||
<img src="minus.png">
|
||||
<img src="model.png">
|
||||
<img src="movie.png">
|
||||
<img src="qp_link.png">
|
||||
<img src="radiooff.png">
|
||||
<img src="radioon.png">
|
||||
|
||||
</body>
|
||||
</html>
|
BIN
doxygen/img/minus.png
Normal file
After Width: | Height: | Size: 289 B |
BIN
doxygen/img/model.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
doxygen/img/movie.png
Normal file
After Width: | Height: | Size: 486 B |
BIN
doxygen/img/qp_link.png
Normal file
After Width: | Height: | Size: 734 B |
BIN
doxygen/img/radiooff.png
Normal file
After Width: | Height: | Size: 250 B |
BIN
doxygen/img/radioon.png
Normal file
After Width: | Height: | Size: 243 B |
6
doxygen/lint.dox
Normal file
@ -0,0 +1,6 @@
|
||||
/*! @page lint PC-Lint
|
||||
The QP/C framework comes with extensive support for automatic rule checking by means of <a class="extern" target="_blank" href="http://www.gimpel.com/">PC-Lint</a>, which is designed not just for proving compliance of the Q/CP framework code, but more importantly, to aid in checking compliance of the application-level code. Any organization engaged in designing safety-related embedded software could benefit from the unprecedented quality infrastructure built around the QP/C framework.
|
||||
|
||||
@sa ports_lint
|
||||
|
||||
*/
|
82
doxygen/log.txt
Normal file
@ -0,0 +1,82 @@
|
||||
D:/qp/qpc/doxygen/macros.h:66: warning: Member QACTIVE_EQUEUE_SIGNAL_(me_) (macro definition) of file macros.h is not documented.
|
||||
D:/qp/qpc/doxygen/macros.h:76: warning: Member QACTIVE_EQUEUE_ONEMPTY_(me_) (macro definition) of file macros.h is not documented.
|
||||
D:/qp/qpc/include/qassert.h:197: warning: argument 'module' of command @param is not found in the argument list of Q_onAssert(char_t const Q_ROM *const file, int_t line)
|
||||
D:/qp/qpc/include/qassert.h:197: warning: The following parameters of Q_onAssert(char_t const Q_ROM *const file, int_t line) are not documented:
|
||||
parameter 'file'
|
||||
D:/qp/qpc/include/qf.h:650: warning: explicit link request to 'Q_EVT_CTOR' could not be resolved
|
||||
D:/qp/qpc/include/qf.h:679: warning: explicit link request to 'Q_EVT_CTOR' could not be resolved
|
||||
D:/qp/qpc/include/qf.h:665: warning: The following parameters of Q_NEW_X(e_, evtT_, margin_, sig_) are not documented:
|
||||
parameter 'e_'
|
||||
D:/qp/qpc/include/qf.h:191: warning: argument 'stkSize_' of command @param is not found in the argument list of QACTIVE_START(me_, prio_, qSto_, qLen_, stkSto_, stkLen_, param_)
|
||||
D:/qp/qpc/include/qf.h:191: warning: The following parameters of QACTIVE_START(me_, prio_, qSto_, qLen_, stkSto_, stkLen_, param_) are not documented:
|
||||
parameter 'stkLen_'
|
||||
D:/qp/qpc/include/qf.h:567: warning: argument 'tickRate' of command @param is not found in the argument list of QF_TICK_X(tickRate_, sender_)
|
||||
D:/qp/qpc/include/qf.h:567: warning: argument 'sender' of command @param is not found in the argument list of QF_TICK_X(tickRate_, sender_)
|
||||
D:/qp/qpc/include/qf.h:567: warning: The following parameters of QF_TICK_X(tickRate_, sender_) are not documented:
|
||||
parameter 'tickRate_'
|
||||
parameter 'sender_'
|
||||
D:/qp/qpc/source/qf_actq.c:59: warning: The following parameters of QActive_post_(QActive *const me, QEvt const *const e, uint_fast16_t const margin, void const *const sender) are not documented:
|
||||
parameter 'sender'
|
||||
D:/qp/qpc/source/qf_actq.c:191: warning: expected whitespace after [ command
|
||||
D:/qp/qpc/source/qf_actq.c:183: warning: The following parameters of QActive_postLIFO_(QActive *const me, QEvt const *const e) are not documented:
|
||||
parameter 'e'
|
||||
D:/qp/qpc/source/qf_time.c:57: warning: The following parameters of QF_tickX_(uint_fast8_t const tickRate, void const *const sender) are not documented:
|
||||
parameter 'sender'
|
||||
D:/qp/qpc/include/qmpool.h:45: warning: explicit link request to 'QMPoolSize' could not be resolved
|
||||
D:/qp/qpc/include/qmpool.h:72: warning: explicit link request to 'QMPoolCtr' could not be resolved
|
||||
D:/qp/qpc/include/qmpool.h:63: warning: Member QMPoolSize (typedef) of file qmpool.h is not documented.
|
||||
D:/qp/qpc/include/qmpool.h:89: warning: Member QMPoolCtr (typedef) of file qmpool.h is not documented.
|
||||
D:/qp/qpc/include/qmpool.h:72: warning: explicit link request to 'QMPoolCtr' could not be resolved
|
||||
D:/qp/qpc/include/qmpool.h:45: warning: explicit link request to 'QMPoolSize' could not be resolved
|
||||
D:/qp/qpc/include/qs.h:178: warning: Member Q_ROM (macro definition) of file qs.h is not documented.
|
||||
D:/qp/qpc/include/qs.h:181: warning: Member Q_ROM_BYTE(rom_var_) (macro definition) of file qs.h is not documented.
|
||||
D:/qp/qpc/include/qs.h:1074: warning: Member QS_priv_ (variable) of file qs.h is not documented.
|
||||
D:/qp/qpc/include/qs.h:429: warning: explicit link request to 'QS_QF_ACTIVE_POST' could not be resolved
|
||||
D:/qp/qpc/include/qs.h:469: warning: explicit link request to 'QS_QF_EQUEUE_POST' could not be resolved
|
||||
D:/qp/qpc/include/qs.h:491: warning: explicit link request to 'QS_QF_TIMEEVT_PUBLISH' could not be resolved
|
||||
D:/qp/qpc/include/qv.h:48: warning: explicit link request to 'QEqueue' could not be resolved
|
||||
D:/qp/qpc/ports/lint/qf_port.h:271: warning: Member crit_stat_t (typedef) of file qf_port.h is not documented.
|
||||
D:/qp/qpc/ports/lint/qf_port.h:211: warning: Member intDisable(void) (function) of file qf_port.h is not documented.
|
||||
D:/qp/qpc/ports/lint/qf_port.h:212: warning: Member intEnable(void) (function) of file qf_port.h is not documented.
|
||||
D:/qp/qpc/ports/lint/qf_port.h:272: warning: Member critEntry(void) (function) of file qf_port.h is not documented.
|
||||
D:/qp/qpc/ports/lint/qf_port.h:273: warning: Member critExit(QF_CRIT_STAT_TYPE stat) (function) of file qf_port.h is not documented.
|
||||
D:/qp/qpc/ports/lint/qf_port.h:274: warning: Member QV_onIdle(void) (function) of file qf_port.h is not documented.
|
||||
D:/qp/qpc/ports/lint/qf_port.h:152: warning: explicit link request to 'QMPoolCtr' could not be resolved
|
||||
D:/qp/qpc/ports/lint/qf_port.h:150: warning: explicit link request to 'QMPoolSize' could not be resolved
|
||||
D:/qp/qpc/ports/lint/qf_port.h:151: warning: explicit link request to 'QMPoolCtr' could not be resolved
|
||||
D:/qp/qpc/ports/lint/qf_port.h:128: warning: explicit link request to 'QMPoolSize' could not be resolved
|
||||
D:/qp/qpc/ports/lint/qf_port.h:126: warning: explicit link request to 'QMPoolSize' could not be resolved
|
||||
D:/qp/qpc/ports/lint/qf_port.h:127: warning: explicit link request to 'QMPoolSize' could not be resolved
|
||||
D:/qp/qpc/ports/lint/qk_port.h:66: warning: explicit link request to 'QK_EXT_TYPE' could not be resolved
|
||||
D:/qp/qpc/ports/lint/qk_port.h:54: warning: explicit link request to 'QK_EXT_TYPE' could not be resolved
|
||||
D:/qp/qpc/ports/lint/stdbool.h:22: warning: Member __bool_true_false_are_defined (macro definition) of file stdbool.h is not documented.
|
||||
D:/qp/qpc/source/qep_msm.c:57: warning: Member l_msm_top_s (variable) of file qep_msm.c is not documented.
|
||||
D:/qp/qpc/source/qep_msm.c:451: warning: explicit link request to 'Q_RET_INIT' could not be resolved
|
||||
D:/qp/qpc/source/qf_actq.c:59: warning: The following parameters of QActive_post_(QActive *const me, QEvt const *const e, uint_fast16_t const margin, void const *const sender) are not documented:
|
||||
parameter 'sender'
|
||||
D:/qp/qpc/source/qf_actq.c:191: warning: expected whitespace after [ command
|
||||
D:/qp/qpc/source/qf_actq.c:183: warning: The following parameters of QActive_postLIFO_(QActive *const me, QEvt const *const e) are not documented:
|
||||
parameter 'e'
|
||||
D:/qp/qpc/source/qf_time.c:57: warning: The following parameters of QF_tickX_(uint_fast8_t const tickRate, void const *const sender) are not documented:
|
||||
parameter 'sender'
|
||||
D:/qp/qpc/source/qs.c:47: warning: Member QS_priv_ (variable) of file qs.c is not documented.
|
||||
D:/qp/qpc/doxygen/exa_os.dox:41: warning: unable to resolve reference to `ports_win32' for \ref command
|
||||
D:/qp/qpc/doxygen/exa_os.dox:59: warning: unable to resolve reference to `ports_win32-qv' for \ref command
|
||||
D:/qp/qpc/doxygen/ports_rtos.dox:53: warning: Found unknown command `\uCOS'
|
||||
D:/qp/qpc/doxygen/history.dox:22: warning: unable to resolve reference to `ports_native:' for \ref command
|
||||
D:/qp/qpc/doxygen/history.dox:61: warning: Found unknown command `\win32'
|
||||
D:/qp/qpc/doxygen/history.dox:479: warning: explicit link request to 'if' could not be resolved
|
||||
D:/qp/qpc/doxygen/history.dox:464: warning: Unsupported xml/html tag <qpc> found
|
||||
D:/qp/qpc/doxygen/history.dox:471: warning: Unsupported xml/html tag <qpc> found
|
||||
D:/qp/qpc/doxygen/history.dox:107: warning: explicit link request to 'XXX_onYYY()' could not be resolved
|
||||
D:/qp/qpc/doxygen/history.dox:67: warning: explicit link request to 'QF_FSM_ACTIVE' could not be resolved
|
||||
D:/qp/qpc/doxygen/history.dox:68: warning: explicit link request to 'QF_ACTIVE_SUPER_' could not be resolved
|
||||
D:/qp/qpc/doxygen/history.dox:68: warning: explicit link request to 'QF_ACTIVE_CTOR_' could not be resolved
|
||||
D:/qp/qpc/doxygen/history.dox:68: warning: explicit link request to 'QF_ACTIVE_INIT_' could not be resolved
|
||||
D:/qp/qpc/doxygen/history.dox:69: warning: explicit link request to 'QF_ACTIVE_DISPATCH_' could not be resolved
|
||||
D:/qp/qpc/doxygen/history.dox:69: warning: explicit link request to 'QF_ACTIVE_STATE_' could not be resolved
|
||||
D:/qp/qpc/source/qf_pkg.h:101: warning: Member next (variable) of class QFreeBlock is not documented.
|
||||
D:/qp/qpc/include/qep.h:289: warning: Member target (variable) of class QMTranActTable is not documented.
|
||||
D:/qp/qpc/include/qep.h:290: warning: Member act[1] (variable) of class QMTranActTable is not documented.
|
||||
D:/qp/qpc/doxygen/ab.dox:136: warning: unable to resolve reference to `misra_lint' for \ref command
|
||||
D:/qp/qpc/doxygen/ab.dox:101: warning: unexpected token TK_EOF as the argument of ref
|
@ -1,8 +1,8 @@
|
||||
@echo off
|
||||
:: ==========================================================================
|
||||
:: Product: QP/C++ script for generating Doxygen documentation
|
||||
:: Last Updated for Version: 5.3.1
|
||||
:: Date of the Last Update: 2014-09-18
|
||||
:: Last Updated for Version: 5.4.0
|
||||
:: Date of the Last Update: 2015-04.-03
|
||||
::
|
||||
:: Q u a n t u m L e a P s
|
||||
:: ---------------------------
|
||||
@ -34,45 +34,57 @@
|
||||
:: ==========================================================================
|
||||
setlocal
|
||||
|
||||
@echo usage:
|
||||
@echo make
|
||||
@echo make -CHM
|
||||
echo usage:
|
||||
echo make
|
||||
echo make -CHM
|
||||
|
||||
@echo Cleanup...
|
||||
@echo off
|
||||
rm help\*.*
|
||||
rmdir /S /Q help\search
|
||||
@echo on
|
||||
|
||||
set VERSION=5.3.1
|
||||
set VERSION=5.4.0
|
||||
|
||||
:: Generate Resource Standard Metrics for QP/C++ .............................
|
||||
set DOXHOME="C:\tools\doxygen\bin"
|
||||
set RCMHOME="C:\tools\MSquared\M2 RSM"
|
||||
|
||||
set RSM_OUTPUT=qpcpp_metrics.txt
|
||||
set RSM_INPUT=..\include\*.h ..\qep\source\*.h ..\qep\source\*.cpp ..\qf\source\*.h ..\qf\source\*.cpp ..\qk\source\*.h ..\qk\source\*.cpp ..\qs\source\*.h ..\qs\source\*.cpp
|
||||
set RSM_OUTPUT=metrics.dox
|
||||
set RSM_INPUT=..\include\*.h ..\source\*.h ..\source\*.cpp
|
||||
|
||||
echo /** \page metrics Code Metrics > %RSM_OUTPUT%
|
||||
echo.>> %RSM_OUTPUT%
|
||||
echo \code >> %RSM_OUTPUT%
|
||||
echo Standard Code Metrics for QP/C++ %VERSION% >> %RSM_OUTPUT%
|
||||
echo Standard Code Metrics for QP/C %VERSION% >> %RSM_OUTPUT%
|
||||
|
||||
%RCMHOME%\rsm.exe -fd -xNOCOMMAND -xNOCONFIG -u"File cfg rsm_qpcpp.cfg" %RSM_INPUT% >> %RSM_OUTPUT%
|
||||
|
||||
echo \endcode >> %RSM_OUTPUT%
|
||||
echo */ >> %RSM_OUTPUT%
|
||||
|
||||
@echo off
|
||||
:: Generate Doxygen Documentation ...........................................
|
||||
if "%1"=="-CHM" (
|
||||
|
||||
echo Generating HTML...
|
||||
::( type Doxyfile & echo GENERATE_HTMLHELP=YES ) | %DOXHOME%\doxygen.exe -
|
||||
%DOXHOME%\doxygen.exe Doxyfile-CHM
|
||||
|
||||
@echo off
|
||||
@echo "C:\tools\HTML Help Workshop\hhw.exe"
|
||||
@echo In HHW: you need to add all img\*.htm files to the project
|
||||
@echo off
|
||||
echo Adding custom images...
|
||||
xcopy preview.js tmp\
|
||||
xcopy img tmp\img\
|
||||
echo img\img.htm >> tmp\index.hhp
|
||||
|
||||
echo Generate CHM...
|
||||
"C:\tools\HTML Help Workshop\hhc.exe" tmp\index.hhp
|
||||
|
||||
echo Cleanup...
|
||||
rmdir /S /Q tmp
|
||||
echo CHM file generated in ..\doc\
|
||||
|
||||
) else (
|
||||
echo Cleanup...
|
||||
rmdir /S /Q ..\..\doc\qpcpp
|
||||
|
||||
echo Adding custom images...
|
||||
xcopy preview.js ..\..\doc\qpcpp\
|
||||
xcopy img ..\..\doc\qpcpp\img\
|
||||
copy images\favicon.ico ..\..\doc\qpcpp
|
||||
|
||||
echo Generating HTML...
|
||||
%DOXHOME%\doxygen.exe Doxyfile
|
||||
)
|
||||
|
||||
|
2719
doxygen/metrics.dox
Normal file
59
doxygen/modules.dox
Normal file
@ -0,0 +1,59 @@
|
||||
/*! @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 qk QK
|
||||
|
||||
@brief
|
||||
Preemptive Non-Blocking Kernel
|
||||
|
||||
QK is a tiny **preemptive**, priority-based, non-blocking kernel designed specifically for executing active objects. 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.
|
||||
*/
|
||||
/*!
|
||||
@defgroup qv QV
|
||||
|
||||
@brief
|
||||
Cooperative Run-to-Completion Kernel
|
||||
|
||||
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.
|
||||
*/
|
||||
/*!
|
||||
@defgroup qs QS
|
||||
|
||||
@brief
|
||||
Software Tracing Instrumentation
|
||||
|
||||
QS is 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.
|
||||
*/
|
||||
/*! @dir ../include
|
||||
|
||||
Platform-independent QP/C API
|
||||
|
||||
@note
|
||||
The QP/C <span class="img folder">include</span> directory needs to be added to the compiler's include path in the applications using QP/C.
|
||||
*/
|
||||
/*! @dir ../source
|
||||
|
||||
Platform-independent QP/C implementation
|
||||
|
||||
Files from this directory need to be added to the project, to build the QP/C framework from source code.
|
||||
|
||||
@attention
|
||||
Not all QP/C source files should be added to every project. For example, native QP/C ports to the preemptive QK kernel should **not** contain the file <span class="img file_c">qv.c</span> and conversely, QP/C ports to the cooperative QV kernel should not contain the files <span class="img file_c">qk.c</span> and <span class="img file_c">qk_mutex.c</span>.
|
||||
|
||||
@note
|
||||
The QP/C <span class="img folder">source</span> directory needs to be added to the compiler's include path in the applications using QP/C, because QP/C is built from sources.
|
||||
|
||||
*/
|
132
doxygen/ports.dox
Normal file
@ -0,0 +1,132 @@
|
||||
/*! @page ports Ports
|
||||
|
||||
@section ports_gen General Comments
|
||||
The QP/C framework can be easily adapted to various operating systems, processor architectures, and compilers. Adapting the QP/C software is called porting and the QP/C framework has been designed from the ground up to make porting easy.
|
||||
|
||||
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 comp_qv "QV" or @ref comp_qk "QK")
|
||||
|
||||
- @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 Windows or 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.
|
||||
|
||||
All ports are located in sub-directories of the <span class="img folder">ports</span> @ref qpc_files "top-level folder", with the hierarchical organization outlined below:
|
||||
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">ports</span>
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm-cm</span> — Native ports for ARM-Cortex-M (bare-metal) <span class="tag">A</span>
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">qk</span> — Port to the @ref comp_qk "preemptive QK kernel"
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm</span> — Port to ARM-KEIL toolset
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">dbg</span> — Debug @ref exa_sec_conf "build configuration"
|
||||
</li>
|
||||
<li><span class="img folder">rel</span> — Release build configuration
|
||||
</li>
|
||||
<li><span class="img folder">spy</span> — Spy build configuration
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">gnu</span> — Port to GNU toolset
|
||||
</li>
|
||||
<li><span class="img folder">iar</span> — Port to IAR toolset
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">qk</span> — Port to the @ref comp_qv "cooperative QV kernel"
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm</span> — Port to ARM-KEIL toolset
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">dbg</span> — Debug @ref exa_sec_conf "build configuration"
|
||||
</li>
|
||||
<li><span class="img folder">rel</span> — Release build configuration
|
||||
</li>
|
||||
<li><span class="img folder">spy</span> — Spy build configuration
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">gnu</span> — Port to GNU toolset
|
||||
</li>
|
||||
<li><span class="img folder">iar</span> — Port to IAR toolset
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<li><span class="img folder">ucos-ii</span> — Port to uCOS-II (3rd-party RTOS) <span class="tag">B</span>
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm-cm</span> — Port to ARM-Cortex-M
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">arm</span> — build with ARM toolset
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">dbg</span> — Debug build configuration
|
||||
</li>
|
||||
<li><span class="img folder">rel</span> — Release build configuration
|
||||
</li>
|
||||
<li><span class="img folder">spy</span> — Spy build configuration
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">iar</span> — build with IAR toolset
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<li><span class="img folder">win32</span> — Port to Win32 (Windows) <span class="tag">C</span>
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">mingw</span> — build with MinGW (GNU) toolset
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">dbg</span> — Debug build configuration
|
||||
</li>
|
||||
<li><span class="img folder">rel</span> — Release build configuration
|
||||
</li>
|
||||
<li><span class="img folder">spy</span> — Spy build configuration
|
||||
</li>
|
||||
</ul>
|
||||
<li><span class="img folder">vc</span> — build with Visual C++ toolset
|
||||
</li>
|
||||
<ul class="tag">
|
||||
<li><span class="img folder">Debug</span> — Debug build configuration
|
||||
</li>
|
||||
<li><span class="img folder">Release</span> — Release build configuration
|
||||
</li>
|
||||
<li><span class="img folder">QSpy</span> — Spy build configuration
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<ul class="tag">
|
||||
<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>
|
||||
|
||||
<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). Under that directory, the sub-directories, such as <span class="img folder">mingw</span>, contain builds for the specified toolset, such as MinGW or Visual C++ here.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@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}
|
||||
*/
|
66
doxygen/ports_native.dox
Normal file
@ -0,0 +1,66 @@
|
||||
/*##########################################################################*/
|
||||
/*! @page ports_native Native (Bare-Metal) Ports
|
||||
|
||||
- @subpage lint (generic C compiler)
|
||||
- @subpage arm-cm (Cortex-M0/M0+/M3/M4/M4F)
|
||||
- @ref arm-cm_qk (ARM-KEIL, GNU-ARM, IAR-ARM toolsets)
|
||||
- @ref arm-cm_qv (ARM-KEIL, GNU-ARM, IAR-ARM toolsets)
|
||||
- @subpage arm7-9 ("classic" ARM)
|
||||
- @ref arm7-9_qk (GNU-ARM, IAR-ARM toolsets)
|
||||
- @ref arm7-9_qv (GNU-ARM, IAR-ARM toolsets)
|
||||
- @subpage avr (megaAVR)
|
||||
- @ref avr_qk (GNU-AVR, IAR-AVR toolsets)
|
||||
- @ref avr_qv (GNU-AVR, IAR-AVR toolsets)
|
||||
- @subpage msp430 ("classic" MSP430 and "extended" MSP430X)
|
||||
- @ref msp430_qv (CCS, IAR toolsets)
|
||||
- @ref msp430_qk (CCS, IAR toolsets)
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page lint PC-Lint
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page arm7-9 ARM7/ARM9
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
@section arm7-9_qk Preemptive QK Kernel
|
||||
|
||||
\includelineno ports/arm7-9/qk/iar/qk_port.s
|
||||
|
||||
@section arm7-9_qv Cooperative QV Kernel
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page arm-cm ARM Cortex-M
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
@section arm-cm_qk Preemptive QK Kernel
|
||||
|
||||
@section arm-cm_qv Cooperative QV Kernel
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page avr AVR
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
@section avr_qk Preemptive QK Kernel
|
||||
|
||||
@section avr_qv Cooperative QV Kernel
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page msp430 MSP430
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
@section msp430_qk Preemptive QK Kernel
|
||||
|
||||
@section msp430_qv Cooperative QV Kernel
|
||||
|
||||
*/
|
35
doxygen/ports_os.dox
Normal file
@ -0,0 +1,35 @@
|
||||
/*##########################################################################*/
|
||||
/*! @page ports_os Ports to Third-Party OS
|
||||
|
||||
- @subpage posix (Linux, embedded-Linux, BSD, etc.)
|
||||
- @subpage qt (Windows, Linux, Mac OS-X, Android, etc.)
|
||||
- @subpage win32 API (Windows)
|
||||
- @subpage win32-qv (Windows with QV)
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page posix POSIX
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page qt Qt GUI Framework
|
||||
|
||||
@image html logo_qt.jpg
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page win32 Win32 API (Windows)
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page win32-qv Win32-QV (Windows with QV)
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
100
doxygen/ports_rtos.dox
Normal file
@ -0,0 +1,100 @@
|
||||
/*##########################################################################*/
|
||||
/*! @page ports_rtos Ports to Third-Party RTOS
|
||||
|
||||
The main purpose of integrating QP/C with conventional RTOSes is to enable you to incorporate various communication stacks (TCP/IP, USB, CAN, etc.) as well as other middleware, which requires the ability to **block** the task code.
|
||||
|
||||
- @subpage cmsis-rtx
|
||||
- @subpage embos
|
||||
- @subpage freertos
|
||||
- @subpage threadx
|
||||
- @subpage ucos-ii
|
||||
|
||||
@note
|
||||
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.
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page cmsis-rtx CMSIS-RTOS RTX
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page embos embOS
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page freertos FreeRTOS
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page threadx ThreadX
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
||||
/*##########################################################################*/
|
||||
/*! @page ucos-ii uC/OS-II
|
||||
|
||||
@section ucos-ii_about About the QP Port to uC/OS-II
|
||||
This directory contains a generic platform-independent QP/C port to uC/OS-II V2.92.
|
||||
|
||||
Typically, you should not need to change the files in this directory to adapt the QP-uC/OS port on any CPU/Compiler to which uC/OS-II has been ported, because all the CPU and compiler specifics are handled by the uC/OS-II RTOS.
|
||||
|
||||
@note
|
||||
Currently, the port has been tested only on ARM Cortex-M3 and M4F.
|
||||
|
||||
|
||||
@section ucos-ii_source uC/OS-II Source and ARM Cortex-M3/M4 Ports
|
||||
The uC/OS-II V2.92 source code and ports are located in 3rd_party@uCOS-II. Please make sure to read about uC/OS-II licensing in the README file found in this directory.
|
||||
|
||||
@note
|
||||
The official Micrium ARM-Cortex-M ports have been modified by Quantum Leaps to remove the dependencies on the Micrium's uC-CPU and uC-LIB components, and instead to inter-operate with the Cortex Microcontroller Software Interface Standard (CMSIS).
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@section ucos-ii_using Using this QP Port to uC/OS-II
|
||||
The example projects for this port are located in @ref exa_ucos-ii "examples/ucos-ii/arm-cm/dpp_ek-tm4c123gxl".
|
||||
|
||||
Currently, ARM-KEIL and IAR-ARM toolsets are supported (in the <span class="img folder">arm</span> and <span class="img folder">iar</span> sub-directories within this example project).
|
||||
|
||||
The example projects use this port by directly including the QP source code (and this port) in the application projects. There is no QP library to build.
|
||||
|
||||
However, this port can also be used as a library, in which case you need to build the QP library yourself and include in your project.
|
||||
|
||||
|
||||
<div class="separate"></div>
|
||||
@subsection ucos-ii_build QP Source Files Needed in this QP Port
|
||||
Whether you use this QP port as source files or as a library, it is important to note that not all QP soruce files should be included. Here is the list of QP source files needed:
|
||||
|
||||
@verbatim
|
||||
qpc
|
||||
+-source
|
||||
| +-qep_hsm.c
|
||||
| +-qep_msm.c
|
||||
| +-qf_act.c
|
||||
| +-qf_defer.c
|
||||
| +-qf_dyn.c
|
||||
| +-qf_ps.c
|
||||
| +-qf_qeq.c
|
||||
| +-qf_qmact.c
|
||||
| +-qf_time.c
|
||||
| |
|
||||
| +-qs.c - included only in the Spy build configuration
|
||||
| +-qs_fp.c - included only in the Spy build configuration
|
||||
|
|
||||
+-ports
|
||||
| +-ucos-ii
|
||||
| | +-qf_port.c
|
||||
@endverbatim
|
||||
|
||||
@note
|
||||
Specifically, the QP source files qf_actq.c and qf_mem.c must **NOT** be included in the build, because this functionality is taken from uC/OS-II.
|
||||
|
||||
@image html under_construction.jpg
|
||||
|
||||
*/
|
36
doxygen/preview.js
Normal file
@ -0,0 +1,36 @@
|
||||
/* Image preview script
|
||||
* powered by jQuery (http://www.jquery.com)
|
||||
* written by Alen Grakalic (http://cssglobe.com)
|
||||
* for more info visit
|
||||
* http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
|
||||
*/
|
||||
this.imagePreview = function(){
|
||||
// you might want to adjust to get the right result
|
||||
horOffset = -100;
|
||||
verOffset = 0;
|
||||
|
||||
/* END CONFIG */
|
||||
$("a.preview").hover(function(e){
|
||||
this.t = this.title;
|
||||
this.title = "";
|
||||
var c = (this.t != "") ? "<br/>" + this.t : "";
|
||||
$("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
|
||||
$("#preview")
|
||||
.css("top",(e.pageY - verOffset) + "px")
|
||||
.css("left",(e.pageX + horOffset) + "px")
|
||||
.fadeIn("fast");
|
||||
},
|
||||
function(){
|
||||
this.title = this.t;
|
||||
$("#preview").remove();
|
||||
});
|
||||
$("a.preview").mousemove(function(e){
|
||||
$("#preview")
|
||||
.css("top",(e.pageY - verOffset) + "px")
|
||||
.css("left",(e.pageX + horOffset) + "px");
|
||||
});
|
||||
};
|
||||
// starting the script on page load
|
||||
$(document).ready(function(){
|
||||
imagePreview();
|
||||
});
|
211
doxygen/ql.css
Normal file
@ -0,0 +1,211 @@
|
||||
/* QL overrides ---------------------------------------------- */
|
||||
h1 { font-size: 135%; }
|
||||
h2 { font-size: 115%; }
|
||||
h3 { font-size: 105%; }
|
||||
h1.groupheader { font-size: 110%; }
|
||||
h2.groupheader { font-size: 105%; }
|
||||
h3.groupheader { font-size: 100%; }
|
||||
pre.fragment { line-height: 100%; font-size: 13px; }
|
||||
div.line { line-height: 100%;}
|
||||
|
||||
div.toc {
|
||||
padding: 10px 10px;
|
||||
margin: 0 10px 10px 10px;
|
||||
}
|
||||
|
||||
/* QL additions ---------------------------------------------- */
|
||||
#titlearea {
|
||||
background: #FFFFFF url(img/header_bg.png) repeat-x;
|
||||
}
|
||||
#projectlogo {
|
||||
display: block;
|
||||
min-width: 180px;
|
||||
vertical-align: top;
|
||||
}
|
||||
#projectname {
|
||||
padding-left:20px;
|
||||
/*text-align: center;*/
|
||||
}
|
||||
|
||||
.title {
|
||||
color: #354C7B;
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
color: #354C7B;
|
||||
}
|
||||
a.extern {
|
||||
background:url(img/extern.png) no-repeat right;
|
||||
padding-right: 14px;
|
||||
text-decoration:none;
|
||||
}
|
||||
.extern:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
pre.code {
|
||||
background-color: #EEEEEE;
|
||||
}
|
||||
img {
|
||||
max-width:100%;
|
||||
height:auto;
|
||||
}
|
||||
img.left {
|
||||
float: left;
|
||||
padding-right: 10px;
|
||||
}
|
||||
img.right {
|
||||
float: right;
|
||||
padding-left: 10px;
|
||||
}
|
||||
table.indextable {
|
||||
border: 1px solid #777;
|
||||
border-collapse: collapse;
|
||||
background-color: #f0f0f0;
|
||||
font-size: 100%;
|
||||
}
|
||||
table.indextable th {
|
||||
text-align: left;
|
||||
text-indent:5px;
|
||||
}
|
||||
table.indextable td {
|
||||
border: 1px solid #777;
|
||||
border-collapse: collapse;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.indextable ul {
|
||||
margin-left:20px;
|
||||
}
|
||||
table.indextable ul {padding-left:8px;}
|
||||
|
||||
.highlight {background-color:#ffff33; }
|
||||
.menu {background-color:#dddddd; }
|
||||
.underline {text-decoration:underline; }
|
||||
.strong {background-color:#ffff33; font-weight:bold; }
|
||||
.preprocessor, span.preprocessor a {color:darkblue; }
|
||||
.comment {color: darkred; font-style:italic; }
|
||||
.string, span.char { color: darkgreen; }
|
||||
.separate {
|
||||
border: none;
|
||||
border-top: 1px #bfbfbf solid;
|
||||
width: 300px;
|
||||
}
|
||||
.button {
|
||||
border-style: solid;
|
||||
border-color: white #625f5d #625f5d #eeeeee;
|
||||
border-width: 2px;
|
||||
font-size: 10pt;
|
||||
color: black;
|
||||
background-color: #d4d0c8;
|
||||
white-space: nowrap;
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
.button:hover {
|
||||
border-style: solid;
|
||||
border-color: #625f5d #eeeeee #eeeeee #625f5d;
|
||||
border-width: 2px;
|
||||
font-size: 10pt;
|
||||
color: black;
|
||||
background-color: #d4d0c8;
|
||||
white-space: nowrap;
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
}
|
||||
.checkbox {
|
||||
background:url(img/checkboxoff.png) no-repeat 2px 2px;
|
||||
padding-left: 16px;
|
||||
font-family: Tahoma;
|
||||
font-size: 10pt;
|
||||
background-color: #d4d0c8;
|
||||
color: black;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.checkbox:hover {
|
||||
background:url(img/checkboxon.png) no-repeat 2px 2px;
|
||||
font-size: 10pt;
|
||||
background-color: #d4d0c8;
|
||||
padding-left: 16px;
|
||||
color: black;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.radio {
|
||||
background:url(img/radiooff.png) no-repeat 2px 2px;
|
||||
font-size: 10pt;
|
||||
background-color: #d4d0c8;
|
||||
padding-left: 14px;
|
||||
color: black;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.radio:hover {
|
||||
background:url(img/radioon.png) no-repeat 2px 2px;
|
||||
font-size: 10pt;
|
||||
background-color: #d4d0c8;
|
||||
padding-left: 14px;
|
||||
color: black;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.board {
|
||||
background: url(img/board.png) no-repeat;
|
||||
background-position: right;
|
||||
padding: 2px 20px 0px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.img {
|
||||
padding-left: 20px;
|
||||
white-space: nowrap;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
dl.note {
|
||||
margin: 0px 10px 0px 0px;
|
||||
padding: 5px 15px 10px 15px;
|
||||
background-color: #FFFFEE;
|
||||
border: 1px solid #EEEE77;
|
||||
border-radius: 7px 7px 7px 7px;
|
||||
}
|
||||
|
||||
dl.attention {
|
||||
margin: 0px 10px 0px 0px;
|
||||
padding: 5px 15px 10px 15px;
|
||||
background-color: #FFCC00;
|
||||
border: 1px solid #CCA300;
|
||||
border-radius: 7px 7px 7px 7px;
|
||||
}
|
||||
dl.remark {
|
||||
margin: 0px 10px 0px 0px;
|
||||
padding: 10px 15px 10px 15px;
|
||||
background-color: #E6E6E6;
|
||||
border: 1px solid #B2B2B2;
|
||||
border-radius: 7px 7px 7px 7px;
|
||||
}
|
||||
|
||||
ul.tag {list-style-type:none;}
|
||||
span.tag {
|
||||
background-color:#000;
|
||||
color:#fff;
|
||||
font-weight:bold;
|
||||
padding:0 4px 0 4px;
|
||||
margin: 0 4px 0 0;
|
||||
}
|
||||
|
||||
div.clear { clear: both; }
|
||||
|
||||
#preview{
|
||||
position:absolute;
|
||||
border:1px solid #ccc;
|
||||
background:#77f;
|
||||
padding:2px;
|
||||
display:none;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
/* icons ----------------------------------------------------- */
|
||||
.qp_link {background:url(img/qp_link.png) no-repeat;}
|
||||
.folder {background:url(img/folder.png) no-repeat;}
|
||||
.file {background:url(img/file.png) no-repeat;}
|
||||
.file_doc {background:url(img/file_doc.png) no-repeat;}
|
||||
.file_h {background:url(img/file_header.png) no-repeat;}
|
||||
.file_c {background:url(img/file_source_c.png) no-repeat;}
|
||||
.file_cpp {background:url(img/file_source_cpp.png) no-repeat;}
|
||||
.file_ino {background:url(img/file_source_ino.png) no-repeat;}
|
||||
.file_tcl {background:url(img/file_source_tcl.png) no-repeat;}
|
||||
.file_mak {background:url(img/file_make.png) no-repeat;}
|
@ -1,237 +0,0 @@
|
||||
/**
|
||||
\defgroup qep QEP (QP Event Processor)
|
||||
\defgroup qf QF (Active Object (Actor) Framework)
|
||||
\defgroup qk QK (Preemptive Run-to-Completin Kernel)
|
||||
\defgroup qs QS (Software Tracing Instrumentation)
|
||||
|
||||
\anchor main_page
|
||||
\mainpage About QP/C++
|
||||
|
||||
\tableofcontents
|
||||
|
||||
<a href="http://www.state-machine.com/qm/"><strong>QP™ (Quantum Platform)</strong></a> is a family of lightweight, open source software frameworks for building responsive and modular real-time embedded applications as systems of cooperating, event-driven <a href="http://www.state-machine.com/qp/index.php#Active">active objects</a> (<a href="http://en.wikipedia.org/wiki/Actor_model">actors</a>). The QP™ family consists of QP/C, QP/C++, and QP-nano frameworks, which are all strictly quality controlled, superbly documented, and commercially licensable.
|
||||
|
||||
\image html qp_components.jpg
|
||||
|
||||
All QP™ frameworks can run on "bare-metal" single-chip microcontrollers, completely replacing a traditional Real-Time Operating System (RTOS). Ports and ready-to-use examples are provided for most major <a href="http://www.state-machine.com/downloads/index.php#QDK">CPU families</a>. QP/C and QP/C++ can also work with a traditional OS/RTOS, such as: <a href="http://www.state-machine.com/linux/">POSIX (Linux, embedded Linux, QNX, INTEGRITY)</a>, <a href="http://www.state-machine.com/win32/">Windows (Windows embedded, Windows CE)</a>, <a href="http://www.state-machine.com/android/">Android-NDK</a>, <a href="http://www.state-machine.com/threadx/">ThreadX</a>, <a href="http://www.state-machine.com/ucos2/">MicroC/OS</a>, etc.
|
||||
|
||||
The behavior of active objects is specified in QP by means of <a href="http://en.wikipedia.org/wiki/UML_state_machine">hierarchical state machines (UML statecharts)</a>. The frameworks support manual coding of UML state machines in C or C++ as well as fully automatic code generation by means of the free graphical <a href="http://www.state-machine.com/qm/">QM™ modeling tool</a>.
|
||||
|
||||
\image html PSiCC2_250x200.jpg
|
||||
|
||||
The QP frameworks are used in millions of products worldwide in aerospace, robotics, consumer electronics, wired and wireless telecommunications, industrial automation, transportation, and many more. The QP frameworks and the QM modeling tool receive over <a href="http://sourceforge.net/projects/qpc/files/stats/timeline?dates=2012-08-28+to+2013-08-28">30,000 downloads a year</a> (not even counting downloads of QP ports).
|
||||
|
||||
QP is available for download from <a href="http://sourceforge.net/projects/qpc">SourceForge.net</a>--the world's biggest open source repository. The summary of available downloads is also available from <a href="http://www.state-machine.com/downloads">Quantum Leaps download page</a>.
|
||||
|
||||
For more information about QP, please visit:
|
||||
<a href="http://www.state-machine.com/qp"><strong>state-machine.com/qp</strong></a>
|
||||
|
||||
--------
|
||||
\section licensing QP/C++ Licensing
|
||||
|
||||
|
||||
QP/C++ is licensed under the increasingly popular 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 licensed commercially, in which case you don't use any open source license and you do not violate your policy.
|
||||
|
||||
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 GPL version 2 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.
|
||||
|
||||
Closed Source Projects:
|
||||
-----------------------
|
||||
If you are developing and distributing traditional closed source applications, you can purchase one of 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 contact Contact Information
|
||||
|
||||
- Quantum Leaps Web site: http://www.state-machine.com
|
||||
- Quantum Leaps licensing: http://www.state-machine.com/licensing
|
||||
- QP/QM on SourceForge.net: http://sourceforge.net/projects/qpc
|
||||
- e-mail: info@state-machine.com
|
||||
|
||||
--------
|
||||
\section files Directories and Files
|
||||
|
||||
The following annotated directory tree lists the most important directories
|
||||
and files provided in the standard QP/C++ distribution.
|
||||
|
||||
\verbatim
|
||||
qpcpp\ - QP/C++ root directory
|
||||
|
|
||||
+-qpcpp.chm - "QP/C++ Reference Manual" in CHM Help format
|
||||
|
|
||||
+-doxygen\ - QP/C++ documentation generated with Doxygen
|
||||
| | +- . . .
|
||||
| +-Doxyfile - Doxygen configuration file to generate the Manual
|
||||
| +- . . .
|
||||
|
|
||||
+-examples\ - QP examples
|
||||
| | +-posix\ - Examples for POSIX (Linux, BSD, etc.)
|
||||
| | | +-gnu\ - Examples with the GNU compiler
|
||||
| | | | +-dpp\ - Dining Philosopher Problem (DPP) example
|
||||
| | | | | +-dbg\ - Debug build
|
||||
| | | | | +-rel\ - Release build
|
||||
| | | | | +-spy\ - Spy build (with software instrumentation)
|
||||
| | | | | +-dpp.qm - QM model file for this project
|
||||
| | | | | +-Makefile - GNU Makefile to build the DPP application
|
||||
| | | | | +-. . .
|
||||
| | |
|
||||
| | +-win32\ - Examples for Win32 (Windows)
|
||||
| | | +-mingw\ - Examples for the MinGW (GNU) compiler
|
||||
| | | | +-dpp\ - Dining Philosopher Problem (DPP) example
|
||||
| | | | | +-dbg\ - Debug build
|
||||
| | | | | | +-dpp.exe - DPP executable (Debug configuration)
|
||||
| | | | | +-rel\ - Release build
|
||||
| | | | | +-spy\ - Spy build (with software tracing)
|
||||
| | | | | +-dpp.qm - QM model file for this project
|
||||
| | | | | +-Makefile - GNU Makefile to build the DPP application
|
||||
| | | | | +-. . .
|
||||
| | | | +-game-gui\ - "Fly 'n' Shoot" game example (GUI)
|
||||
| | | | +-calc\ - Calculator example
|
||||
| | | | +-qhsmtst\ - QHsmTst example (PSiCC2 in Chapter 2)
|
||||
| | | | +-comp\ - "Orthogonal Component" pattern (PSiCC2 Chapter 5)
|
||||
| | | | +-defer\ - "Deferred Event" pattern (PSiCC2 Chapter 5)
|
||||
| | | | +-history\ - "Transition to History" pattern (PSiCC2 Chapter 5)
|
||||
| | | | +-hook\ - "Ultimate Hook" pattern (Chapter 5)
|
||||
| | | | +-reminder\ - "Reminder" pattern (PSiCC2 Chapter 5)
|
||||
| | | | +-reminder2\ - "Reminder" pattern different example
|
||||
| | | |
|
||||
| | | +-vc\ - Examples for the Visual C++ compiler
|
||||
| | | | +-dpp\ - Dining Philosopher Problem (DPP) example (console)
|
||||
| | | | | +-Debug\ - Debug build
|
||||
| | | | | | +-dpp.exe - DPP executable (Debug configuration)
|
||||
| | | | | +-Release\ - Release build
|
||||
| | | | | +-Spy\ - Spy build (with software instrumentation)
|
||||
| | | | | +-dpp.qm - QM model file for this project
|
||||
| | | | | +-dpp.sln - Visual Studio solution file
|
||||
| | | | | +-dpp.vcxproj - Visual Studio project file
|
||||
| | | | | +-. . .
|
||||
| | | | +-dpp-gui\ - Dining Philosopher Problem (DPP) example (GUI)
|
||||
| | | | +-game-gui\ - "Fly 'n' Shoot" game example (GUI)
|
||||
| |
|
||||
| +-arm-cm\ - Examples for ARM Cortex-M processor
|
||||
| | +-vanilla\ - Examples for the cooperative "vanilla" kernel
|
||||
| | | +-arm_keil\ - Examples with the ARM/Keil compiler (Keil MDK)
|
||||
| | | | +-blinky_ek-tm4c123gxl\ - Blinky example for for EK-TM4C123GXL
|
||||
| | | | +-dpp_qk-lm3s811\ - DPP example for for EK-LM3S811 board
|
||||
| | | | +-game_qk-lm3s811\ - "Fly 'n' Shoot" example for EK-LM3S811
|
||||
| | | | +-. . . - Other examples for ARM Cortex
|
||||
| | | +-gnu\ - Examples with the GNU compiler (Code Sourcery G++)
|
||||
| | | | +-blinky_ek-tm4c123gxl\ - Blinky example for for EK-TM4C123GXL
|
||||
| | | | +-dpp_qk-lm3s811\ - DPP example for for EK-LM3S811
|
||||
| | | | +-game_qk-lm3s811\ - "Fly 'n' Shoot" example for EK-LM3S811
|
||||
| | | | +-. . . - Other examples for ARM Cortex
|
||||
| | | +-iar\ - Examples with the IAR compiler
|
||||
| | | | +-blinky_ek-tm4c123gxl\ - Blinky example for for EK-TM4C123GXL
|
||||
| | | | +-dpp_qk-lm3s811\ - DPP example for for EK-LM3S811
|
||||
| | | | +-game_qk-lm3s811\ - "Fly 'n' Shoot" example for EK-LM3S811
|
||||
| | | | +-. . . - Other examples for ARM Cortex
|
||||
| | |
|
||||
| | +-qk\ - Examples for the preemptive QK kernel
|
||||
| | | +-iar\ - Examples with the IAR compiler
|
||||
| | | | +-dpp-qk_qk-lm3s811\ - DPP example for for EK-LM3S811
|
||||
| | | | +-game-qk_qk-lm3s811\ - "Fly 'n' Shoot" example for EK-LM3S811
|
||||
| | | | +-. . . - Other examples for ARM Cortex
|
||||
| | | +-gnu\ - Examples with the GNU (Sourcery CodeBench)
|
||||
| | | | +-dpp-qk_qk-lm3s811\ - DPP example for for EK-LM3S811
|
||||
| | | | +-game-qk_qk-lm3s811\ - "Fly 'n' Shoot" example for EK-LM3S811
|
||||
| | | | +-. . . - Other examples for ARM Cortex-M
|
||||
| |
|
||||
| +-. . . - Examples for other CPUs and compiler
|
||||
|
|
||||
+-include\ - QP platform-independent header files
|
||||
| +- qassert.h - QP assertions
|
||||
| +- qevt.h - QEvt declaration
|
||||
| +- qep.h - QEP platform-independent interface
|
||||
| +- qf.h - QF platform-independent interface
|
||||
| +- qk.h - QK platform-independent interface
|
||||
| +- qs.h - QS platform-independent active interface
|
||||
| +- qs_dummy.h - QS platform-independent inactive interface
|
||||
| +- qequeue.h - QF native event queue facility
|
||||
| +- qmpool.h - QF native memory pool facility
|
||||
| +- qpset.h - QF native priority set facility
|
||||
| +- qvanilla.h - QF native "vanilla" cooperative kernel interface
|
||||
| +- qp_port.h - QP port include file
|
||||
|
|
||||
+-ports\ - Platform-specific QP ports
|
||||
| +-posix\ - Ports to the POSIX (Linux, BSD, etc.)
|
||||
| | +-gnu\ - Ports with the GNU compiler
|
||||
| | | +-Makefile - make file to build the QP libraries
|
||||
| | | +-. . .
|
||||
| |
|
||||
| +-win32\ - Ports to the POSIX (Linux, BSD, etc.)
|
||||
| | +-mingw\ - Port with the MinGW (GNU) compiler
|
||||
| | | +-qp.sln - Visual Studio solution to build QP libraries
|
||||
| | | +-. . .
|
||||
| | |
|
||||
| | +-vc\ - Port with the Visual C++ compiler
|
||||
| |
|
||||
| +-arm-cm\ - Ports for ARM Cortex-M processor
|
||||
| | +-cmsis\ - Cortex Microcontroller Software Interface Standard
|
||||
| | +-vanilla\ - Ports to the cooperative "vanilla" kernel
|
||||
| | | | +-arm_keil\ - Examples with the ARM/Keil compiler (Keil MDK)
|
||||
| | | | | +-dbg\ - Debug build
|
||||
| | | | | +-rel\ - Release build
|
||||
| | | | | +-spy\ - Spy build (with software instrumentation)
|
||||
| | | | | +-make_Cortex-M3.bat - batch script for QP libraries for M3
|
||||
| | | | | +-qep_port.h - QEP platform-dependent include file
|
||||
| | | | | +-qf_port.h - QF platform-dependent include file
|
||||
| | | | | +-qs_port.h - QS platform-dependent include file
|
||||
| | | | | +-qp_port.h - QP platform-dependent include file
|
||||
| | | . . .
|
||||
| | | +-gnu\ - Ports with the GNU compiler (Sourcery CodeBench)
|
||||
| | | | | +-dbg\ - Debug build
|
||||
| | | | | +-rel\ - Release build
|
||||
| | | | | +-spy\ - Spy build (with software instrumentation)
|
||||
| | | | | +-make_cortex-m3_cs.bat - batch script for QP libraries for M3
|
||||
| | | | | +-qep_port.h - QEP platform-dependent include file
|
||||
| | | | | +-qf_port.h - QF platform-dependent include file
|
||||
| | | | | +-qs_port.h - QS platform-dependent include file
|
||||
| | | | | +-qp_port.h - QP platform-dependent include file
|
||||
| | | . . .
|
||||
| | | +-iar\ - Ports with the IAR compiler
|
||||
| | | | | +-dbg\ - Debug build
|
||||
| | | | | +-rel\ - Release build
|
||||
| | | | | +-spy\ - Spy build (with software instrumentation)
|
||||
| | | | | +-make_cortex-m3.bat - batch script for QP libraries for M3
|
||||
| | | | | +-qep_port.h - QEP platform-dependent include file
|
||||
| | | | | +-qf_port.h - QF platform-dependent include file
|
||||
| | | | | +-qs_port.h - QS platform-dependent include file
|
||||
| | | | | +-qp_port.h - QP platform-dependent include file
|
||||
| | | . . .
|
||||
| | +-qk\ - Ports to the preemptive QK kernel
|
||||
| | +-iar\ - Ports with the IAR compiler
|
||||
| | +-gnu\ - Ports with the GNU (Sourcery CodeBench)
|
||||
| | - Ports to other CPUs
|
||||
| +-lint\ - Ports for "linting" QP/C++
|
||||
| | +- qep_port.h - example qep_port.h header file for portintg QEP
|
||||
| | +- qf_port.h - example qf_port.h header file for portintg QF
|
||||
| | +- qk_port.h - example qk_port.h header file for portintg QK
|
||||
| | +- qs_port.h - example qs_port.h header file for portintg QS
|
||||
|
|
||||
+-qep\ - QEP hierarchical event processor
|
||||
| +-source\ - QEP platform-independent source code (*.cpp files)
|
||||
| | +- . . .
|
||||
|
|
||||
+-qf\ - QF real-time framework
|
||||
| +-source\ - QF platform-independent source code
|
||||
| | +- . . .
|
||||
|
|
||||
+-qk\ - QK preemptive kernel
|
||||
| +-source\ - QK platform-independent source code
|
||||
| | +- . . .
|
||||
|
|
||||
+-qs\ - QS software tracing (target component)
|
||||
| +-source\ - QS platform-independent source code
|
||||
| | +- . . .
|
||||
\endverbatim
|
||||
|
||||
|
||||
--------
|
||||
\image html logo_ql_TM.jpg
|
||||
Copyright © 2002-2014 Quantum Leaps, LLC. All Rights Reserved.\n
|
||||
http://www.state-machine.com
|
||||
|
||||
*/
|
||||
|
@ -35,13 +35,11 @@
|
||||
:: ==========================================================================
|
||||
setlocal
|
||||
|
||||
set VERSION=5.2.0
|
||||
|
||||
set RCMHOME="C:\tools\MSquared\M2 RSM"
|
||||
|
||||
set RSM_OUTPUT=qpcpp_metrics.txt
|
||||
set RSM_INPUT=..\include\*.h ..\qep\source\*.h ..\qep\source\*.cpp ..\qf\source\*.h ..\qf\source\*.cpp ..\qk\source\*.h ..\qk\source\*.cpp ..\qs\source\*.h ..\qs\source\*.cpp
|
||||
set RSM_OUTPUT=qpc_metrics.txt
|
||||
set RSM_INPUT=..\include\*.h ..\qep\source\*.h ..\qep\source\*.c ..\qf\source\*.h ..\qf\source\*.c ..\qk\source\*.h ..\qk\source\*.c ..\qs\source\*.h ..\qs\source\*.c
|
||||
|
||||
%RCMHOME%\rsm.exe -fd -n -xNOCOMMAND -xNOCONFIG -u"File cfg rsm_qpcpp.cfg" %RSM_INPUT% > %RSM_OUTPUT%
|
||||
%RCMHOME%\rsm.exe -fd -n -xNOCOMMAND -xNOCONFIG -u"File cfg rsm_qpc.cfg" %RSM_INPUT% > %RSM_OUTPUT%
|
||||
|
||||
endlocal
|
||||
|
228
doxygen/scripts/jquery.plugins.min.js
vendored
Normal file
@ -0,0 +1,228 @@
|
||||
/*
|
||||
* jQuery Color Animations
|
||||
* Copyright 2007 John Resig
|
||||
* Released under the MIT and GPL licenses.
|
||||
|
||||
*/
|
||||
(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}
|
||||
fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
|
||||
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
|
||||
return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
|
||||
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
|
||||
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
|
||||
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];return colors[jQuery.trim(color).toLowerCase()];}
|
||||
function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))
|
||||
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};})(jQuery);
|
||||
|
||||
/*
|
||||
* jQuery Form Plugin
|
||||
* version: 2.28 (10-MAY-2009)
|
||||
* @requires jQuery v1.2.2 or later
|
||||
*
|
||||
* Examples and documentation at: http://malsup.com/jquery/form/
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
;(function($) {
|
||||
|
||||
/*
|
||||
Usage Note:
|
||||
-----------
|
||||
Do not use both ajaxSubmit and ajaxForm on the same form. These
|
||||
functions are intended to be exclusive. Use ajaxSubmit if you want
|
||||
to bind your own submit handler to the form. For example,
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#myForm').bind('submit', function() {
|
||||
$(this).ajaxSubmit({
|
||||
target: '#output'
|
||||
});
|
||||
return false; // <-- important!
|
||||
});
|
||||
});
|
||||
|
||||
Use ajaxForm when you want the plugin to manage all the event binding
|
||||
for you. For example,
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#myForm').ajaxForm({
|
||||
target: '#output'
|
||||
});
|
||||
});
|
||||
|
||||
When using ajaxForm, the ajaxSubmit function will be invoked for you
|
||||
at the appropriate time.
|
||||
*/
|
||||
$.fn.ajaxSubmit=function(options){if(!this.length){log('ajaxSubmit: skipping submit process - no element selected');return this;}
|
||||
if(typeof options=='function')
|
||||
options={success:options};var url=$.trim(this.attr('action'));if(url){url=(url.match(/^([^#]+)/)||[])[1];}
|
||||
url=url||window.location.href||''
|
||||
options=$.extend({url:url,type:this.attr('method')||'GET'},options||{});var veto={};this.trigger('form-pre-serialize',[this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');return this;}
|
||||
if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log('ajaxSubmit: submit aborted via beforeSerialize callback');return this;}
|
||||
var a=this.formToArray(options.semantic);if(options.data){options.extraData=options.data;for(var n in options.data){if(options.data[n]instanceof Array){for(var k in options.data[n])
|
||||
a.push({name:n,value:options.data[n][k]});}
|
||||
else
|
||||
a.push({name:n,value:options.data[n]});}}
|
||||
if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log('ajaxSubmit: submit aborted via beforeSubmit callback');return this;}
|
||||
this.trigger('form-submit-validate',[a,this,options,veto]);if(veto.veto){log('ajaxSubmit: submit vetoed via form-submit-validate trigger');return this;}
|
||||
var q=$.param(a);if(options.type.toUpperCase()=='GET'){options.url+=(options.url.indexOf('?')>=0?'&':'?')+q;options.data=null;}
|
||||
else
|
||||
options.data=q;var $form=this,callbacks=[];if(options.resetForm)callbacks.push(function(){$form.resetForm();});if(options.clearForm)callbacks.push(function(){$form.clearForm();});if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){$(options.target).html(data).each(oldSuccess,arguments);});}
|
||||
else if(options.success)
|
||||
callbacks.push(options.success);options.success=function(data,status){for(var i=0,max=callbacks.length;i<max;i++)
|
||||
callbacks[i].apply(options,[data,status,$form]);};var files=$('input:file',this).fieldValue();var found=false;for(var j=0;j<files.length;j++)
|
||||
if(files[j])
|
||||
found=true;var multipart=false;if(options.iframe||found||multipart){if(options.closeKeepAlive)
|
||||
$.get(options.closeKeepAlive,fileUpload);else
|
||||
fileUpload();}
|
||||
else
|
||||
$.ajax(options);this.trigger('form-submit-notify',[this,options]);return this;function fileUpload(){var form=$form[0];if($(':input[name=submit]',form).length){alert('Error: Form elements must not be named "submit".');return;}
|
||||
var opts=$.extend({},$.ajaxSettings,options);var s=$.extend(true,{},$.extend(true,{},$.ajaxSettings),opts);var id='jqFormIO'+(new Date().getTime());var $io=$('<iframe id="'+id+'" name="'+id+'" src="about:blank" />');var io=$io[0];$io.css({position:'absolute',top:'-1000px',left:'-1000px'});var xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:'n/a',getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;$io.attr('src','about:blank');}};var g=opts.global;if(g&&!$.active++)$.event.trigger("ajaxStart");if(g)$.event.trigger("ajaxSend",[xhr,opts]);if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&$.active--;return;}
|
||||
if(xhr.aborted)
|
||||
return;var cbInvoked=0;var timedOut=0;var sub=form.clk;if(sub){var n=sub.name;if(n&&!sub.disabled){options.extraData=options.extraData||{};options.extraData[n]=sub.value;if(sub.type=="image"){options.extraData[name+'.x']=form.clk_x;options.extraData[name+'.y']=form.clk_y;}}}
|
||||
setTimeout(function(){var t=$form.attr('target'),a=$form.attr('action');form.setAttribute('target',id);if(form.getAttribute('method')!='POST')
|
||||
form.setAttribute('method','POST');if(form.getAttribute('action')!=opts.url)
|
||||
form.setAttribute('action',opts.url);if(!options.skipEncodingOverride){$form.attr({encoding:'multipart/form-data',enctype:'multipart/form-data'});}
|
||||
if(opts.timeout)
|
||||
setTimeout(function(){timedOut=true;cb();},opts.timeout);var extraInputs=[];try{if(options.extraData)
|
||||
for(var n in options.extraData)
|
||||
extraInputs.push($('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />').appendTo(form)[0]);$io.appendTo('body');io.attachEvent?io.attachEvent('onload',cb):io.addEventListener('load',cb,false);form.submit();}
|
||||
finally{form.setAttribute('action',a);t?form.setAttribute('target',t):$form.removeAttr('target');$(extraInputs).remove();}},10);var nullCheckFlag=0;function cb(){if(cbInvoked++)return;io.detachEvent?io.detachEvent('onload',cb):io.removeEventListener('load',cb,false);var ok=true;try{if(timedOut)throw'timeout';var data,doc;doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;if((doc.body==null||doc.body.innerHTML=='')&&!nullCheckFlag){nullCheckFlag=1;cbInvoked--;setTimeout(cb,100);return;}
|
||||
xhr.responseText=doc.body?doc.body.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;xhr.getResponseHeader=function(header){var headers={'content-type':opts.dataType};return headers[header];};if(opts.dataType=='json'||opts.dataType=='script'){var ta=doc.getElementsByTagName('textarea')[0];xhr.responseText=ta?ta.value:xhr.responseText;}
|
||||
else if(opts.dataType=='xml'&&!xhr.responseXML&&xhr.responseText!=null){xhr.responseXML=toXml(xhr.responseText);}
|
||||
data=$.httpData(xhr,opts.dataType);}
|
||||
catch(e){ok=false;$.handleError(opts,xhr,'error',e);}
|
||||
if(ok){opts.success(data,'success');if(g)$.event.trigger("ajaxSuccess",[xhr,opts]);}
|
||||
if(g)$.event.trigger("ajaxComplete",[xhr,opts]);if(g&&!--$.active)$.event.trigger("ajaxStop");if(opts.complete)opts.complete(xhr,ok?'success':'error');setTimeout(function(){$io.remove();xhr.responseXML=null;},100);};function toXml(s,doc){if(window.ActiveXObject){doc=new ActiveXObject('Microsoft.XMLDOM');doc.async='false';doc.loadXML(s);}
|
||||
else
|
||||
doc=(new DOMParser()).parseFromString(s,'text/xml');return(doc&&doc.documentElement&&doc.documentElement.tagName!='parsererror')?doc:null;};};};$.fn.ajaxForm=function(options){return this.ajaxFormUnbind().bind('submit.form-plugin',function(){$(this).ajaxSubmit(options);return false;}).each(function(){$(":submit,input:image",this).bind('click.form-plugin',function(e){var form=this.form;form.clk=this;if(this.type=='image'){if(e.offsetX!=undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else if(typeof $.fn.offset=='function'){var offset=$(this).offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-this.offsetLeft;form.clk_y=e.pageY-this.offsetTop;}}
|
||||
setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},10);});});};$.fn.ajaxFormUnbind=function(){this.unbind('submit.form-plugin');return this.each(function(){$(":submit,input:image",this).unbind('click.form-plugin');});};$.fn.formToArray=function(semantic){var a=[];if(this.length==0)return a;var form=this[0];var els=semantic?form.getElementsByTagName('*'):form.elements;if(!els)return a;for(var i=0,max=els.length;i<max;i++){var el=els[i];var n=el.name;if(!n)continue;if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}
|
||||
continue;}
|
||||
var v=$.fieldValue(el,true);if(v&&v.constructor==Array){for(var j=0,jmax=v.length;j<jmax;j++)
|
||||
a.push({name:n,value:v[j]});}
|
||||
else if(v!==null&&typeof v!='undefined')
|
||||
a.push({name:n,value:v});}
|
||||
if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0],n=input.name;if(n&&!input.disabled&&input.type=='image'){a.push({name:n,value:$input.val()});a.push({name:n+'.x',value:form.clk_x},{name:n+'.y',value:form.clk_y});}}
|
||||
return a;};$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n)return;var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++)
|
||||
a.push({name:n,value:v[i]});}
|
||||
else if(v!==null&&typeof v!='undefined')
|
||||
a.push({name:this.name,value:v});});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=='undefined'||(v.constructor==Array&&!v.length))
|
||||
continue;v.constructor==Array?$.merge(val,v):val.push(v);}
|
||||
return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(typeof successful=='undefined')successful=true;if(successful&&(!n||el.disabled||t=='reset'||t=='button'||(t=='checkbox'||t=='radio')&&!el.checked||(t=='submit'||t=='image')&&el.form&&el.form.clk!=el||tag=='select'&&el.selectedIndex==-1))
|
||||
return null;if(tag=='select'){var index=el.selectedIndex;if(index<0)return null;var a=[],ops=el.options;var one=(t=='select-one');var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v)
|
||||
v=(op.attributes&&op.attributes['value']&&!(op.attributes['value'].specified))?op.text:op.value;if(one)return v;a.push(v);}}
|
||||
return a;}
|
||||
return el.value;};$.fn.clearForm=function(){return this.each(function(){$('input,select,textarea',this).clearFields();});};$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(t=='text'||t=='password'||tag=='textarea')
|
||||
this.value='';else if(t=='checkbox'||t=='radio')
|
||||
this.checked=false;else if(tag=='select')
|
||||
this.selectedIndex=-1;});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=='function'||(typeof this.reset=='object'&&!this.reset.nodeType))
|
||||
this.reset();});};$.fn.enable=function(b){if(b==undefined)b=true;return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select==undefined)select=true;return this.each(function(){var t=this.type;if(t=='checkbox'||t=='radio')
|
||||
this.checked=select;else if(this.tagName.toLowerCase()=='option'){var $sel=$(this).parent('select');if(select&&$sel[0]&&$sel[0].type=='select-one'){$sel.find('option').selected(false);}
|
||||
this.selected=select;}});};function log(){if($.fn.ajaxSubmit.debug&&window.console&&window.console.log)
|
||||
window.console.log('[jquery.form] '+Array.prototype.join.call(arguments,''));};})(jQuery);
|
||||
|
||||
/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
*
|
||||
* $LastChangedDate: 2007-12-20 08:43:48 -0600 (Thu, 20 Dec 2007) $
|
||||
* $Rev: 4257 $
|
||||
*
|
||||
* Version: 1.2
|
||||
*
|
||||
* Requires: jQuery 1.2+
|
||||
*/
|
||||
(function($){$.dimensions={version:'1.2'};$.each(['Height','Width'],function(i,name){$.fn['inner'+name]=function(){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';return this.is(':visible')?this[0]['client'+name]:num(this,name.toLowerCase())+num(this,'padding'+torl)+num(this,'padding'+borr);};$.fn['outer'+name]=function(options){if(!this[0])return;var torl=name=='Height'?'Top':'Left',borr=name=='Height'?'Bottom':'Right';options=$.extend({margin:false},options||{});var val=this.is(':visible')?this[0]['offset'+name]:num(this,name.toLowerCase())+num(this,'border'+torl+'Width')+num(this,'border'+borr+'Width')+num(this,'padding'+torl)+num(this,'padding'+borr);return val+(options.margin?(num(this,'margin'+torl)+num(this,'margin'+borr)):0);};});$.each(['Left','Top'],function(i,name){$.fn['scroll'+name]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(name=='Left'?val:$(window)['scrollLeft'](),name=='Top'?val:$(window)['scrollTop']()):this['scroll'+name]=val;}):this[0]==window||this[0]==document?self[(name=='Left'?'pageXOffset':'pageYOffset')]||$.boxModel&&document.documentElement['scroll'+name]||document.body['scroll'+name]:this[0]['scroll'+name];};});$.fn.extend({position:function(){var left=0,top=0,elem=this[0],offset,parentOffset,offsetParent,results;if(elem){offsetParent=this.offsetParent();offset=this.offset();parentOffset=offsetParent.offset();offset.top-=num(elem,'marginTop');offset.left-=num(elem,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return $(offsetParent);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};})(jQuery);
|
||||
|
||||
/*
|
||||
* jQuery Tooltip plugin 1.3
|
||||
*
|
||||
* http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/
|
||||
* http://docs.jquery.com/Plugins/Tooltip
|
||||
*
|
||||
* Copyright (c) 2006 - 2008 Jörn Zaefferer
|
||||
*
|
||||
* $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
;(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')
|
||||
$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)
|
||||
return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)
|
||||
helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}
|
||||
function settings(element){return $.data(element,"tooltip");}
|
||||
function handle(event){if(settings(this).delay)
|
||||
tID=setTimeout(show,settings(this).delay);else
|
||||
show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}
|
||||
function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))
|
||||
return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}
|
||||
helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)
|
||||
helper.body.append("<br/>");helper.body.append(part);}
|
||||
helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}
|
||||
if(settings(this).showURL&&$(this).url())
|
||||
helper.url.html($(this).url().replace('http://','')).show();else
|
||||
helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)
|
||||
helper.parent.fixPNG();handle.apply(this,arguments);}
|
||||
function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))
|
||||
helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
|
||||
helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}
|
||||
update();}
|
||||
function update(event){if($.tooltip.blocked)
|
||||
return;if(event&&event.target.tagName=="OPTION"){return;}
|
||||
if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}
|
||||
if(current==null){$(document.body).unbind('mousemove',update);return;}
|
||||
helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}
|
||||
helper.parent.css({left:left,right:right,top:top});}
|
||||
var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}
|
||||
if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}
|
||||
function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}
|
||||
function hide(event){if($.tooltip.blocked)
|
||||
return;if(tID)
|
||||
clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}
|
||||
if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))
|
||||
helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
|
||||
helper.parent.stop().fadeOut(tsettings.fade,complete);}else
|
||||
complete();if(settings(this).fixPNG)
|
||||
helper.parent.unfixPNG();}})(jQuery);
|
||||
|
||||
/*
|
||||
* Superfish v1.4.8 - jQuery menu widget
|
||||
* Copyright (c) 2008 Joel Birch
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
|
||||
*/
|
||||
;(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> »</span>'].join('')),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl();},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}},o.delay);},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu;},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone());};return this.each(function(){var s=this.serial=sf.o.length;var o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass);});sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow($('>a:first-child',this));}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});});o.onInit.call(this);}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '));});};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)
|
||||
this.toggleClass(sf.c.shadowClass+'-off');};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show',height:'show'},speed:'normal',autoArrows:false,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');o.onHide.call($ul);return this;},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul);});return this;}});})(jQuery);
|
||||
|
||||
/*
|
||||
* Supersubs v0.2b - jQuery plugin
|
||||
* Copyright (c) 2008 Joel Birch
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
*
|
||||
* This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
|
||||
* their longest list item children. If you use this, please expect bugs and report them
|
||||
* to the jQuery Google Group with the word 'Superfish' in the subject line.
|
||||
*
|
||||
*/
|
||||
;(function($){$.fn.supersubs=function(options){var opts=$.extend({},$.fn.supersubs.defaults,options);return this.each(function(){var $$=$(this);var o=$.meta?$.extend({},opts,$$.data()):opts;var fontsize=$('<li id="menu-fontsize">—</li>').css({'padding':0,'position':'absolute','top':'-999em','width':'auto'}).appendTo($$).width();$('#menu-fontsize').remove();$ULs=$$.find('ul');$ULs.each(function(i){var $ul=$ULs.eq(i);var $LIs=$ul.children();var $As=$LIs.children('a');var liFloat=$LIs.css('white-space','nowrap').css('float');var emWidth=$ul.add($LIs).add($As).css({'float':'none','width':'auto'}).end().end()[0].clientWidth/fontsize;emWidth+=o.extraWidth;if(emWidth>o.maxWidth){emWidth=o.maxWidth;}
|
||||
else if(emWidth<o.minWidth){emWidth=o.minWidth;}
|
||||
emWidth+='em';$ul.css('width',emWidth);$LIs.css({'float':liFloat,'width':'100%','white-space':'normal'}).each(function(){var $childUl=$('>ul',this);var offsetDirection=$childUl.css('left')!==undefined?'left':'right';$childUl.css(offsetDirection,emWidth);});});});};$.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0};})(jQuery);
|
||||
|
||||
/*
|
||||
* HoverIntent
|
||||
*/
|
||||
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}
|
||||
if(p==this){return false;}
|
||||
var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}
|
||||
if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
|
20
doxygen/scripts/ql.js
Normal file
@ -0,0 +1,20 @@
|
||||
// tooltips ----------------------------------------------------------------
|
||||
$(function() {
|
||||
$('.questionmark_help').tooltip({
|
||||
delay: 0,
|
||||
showURL: false,
|
||||
track: true,
|
||||
showBody: " - ",
|
||||
fade: 250
|
||||
});
|
||||
});
|
||||
$(function() {
|
||||
$('.preview_board').tooltip({
|
||||
delay: 0,
|
||||
fade: 250,
|
||||
showURL: false,
|
||||
bodyHandler: function() {
|
||||
return $("<img/>").attr("src", this.href);
|
||||
}
|
||||
});
|
||||
});
|
@ -1,206 +0,0 @@
|
||||
//****************************************************************************
|
||||
// Product: Time Bomb Example with with "Nested Switch Statement"
|
||||
// Last Updated for Version: 4.1.01
|
||||
// Date of the Last Update: Nov 04, 2009
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
//
|
||||
// Copyright (C) 2002-2009 Quantum Leaps, LLC. All rights reserved.
|
||||
//
|
||||
// This software may be distributed and modified under the terms of the GNU
|
||||
// General Public License version 2 (GPL) as published by the Free Software
|
||||
// Foundation and appearing in the file GPL.TXT included in the packaging of
|
||||
// this file. Please note that GPL Section 2[b] requires that all works based
|
||||
// on this software must also be made publicly available under the terms of
|
||||
// the GPL ("Copyleft").
|
||||
//
|
||||
// Alternatively, this software may be distributed and modified under the
|
||||
// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
// the GPL and are specifically designed for licensees interested in
|
||||
// retaining the proprietary status of their code.
|
||||
//
|
||||
// Contact information:
|
||||
// Quantum Leaps Web site: http://www.quantum-leaps.com
|
||||
// e-mail: info@quantum-leaps.com
|
||||
//****************************************************************************
|
||||
#include "bsp.h"
|
||||
|
||||
enum BombSignals { // all signals for the Bomb FSM
|
||||
UP_SIG,
|
||||
DOWN_SIG,
|
||||
ARM_SIG,
|
||||
TICK_SIG
|
||||
};
|
||||
|
||||
enum BombStates { // all states for the Bomb FSM
|
||||
SETTING_STATE,
|
||||
TIMING_STATE
|
||||
};
|
||||
|
||||
struct Event {
|
||||
uint16_t sig; // signal of the event
|
||||
// add event parameters by subclassing the Event structure...
|
||||
};
|
||||
|
||||
struct TickEvt : public Event {
|
||||
uint8_t fine_time; // the fine 1/10 s counter
|
||||
};
|
||||
|
||||
class Bomb1 { // the Bomb FSM
|
||||
public:
|
||||
Bomb1(uint8_t defuse) : m_defuse(defuse) {}
|
||||
void init(void); // the init() FSM interface
|
||||
void dispatch(Event const *e); // the dispatch() FSM interface
|
||||
|
||||
private:
|
||||
void tran(uint8_t target) { m_state = target; }
|
||||
|
||||
private:
|
||||
uint8_t m_state; // the scalar state-variable
|
||||
uint8_t m_timeout; // number of seconds till explosion
|
||||
uint8_t m_code; // currently entered code to disarm the bomb
|
||||
uint8_t m_defuse; // secret defuse code to disarm the bomb
|
||||
};
|
||||
|
||||
//............................................................................
|
||||
// the initial value of the timeout
|
||||
#define INIT_TIMEOUT 10
|
||||
|
||||
//............................................................................
|
||||
void Bomb1::init(void) {
|
||||
m_timeout = INIT_TIMEOUT; // timeout is initialized in initial tran.
|
||||
tran(SETTING_STATE);
|
||||
}
|
||||
//............................................................................
|
||||
void Bomb1::dispatch(Event const *e) {
|
||||
switch (m_state) {
|
||||
case SETTING_STATE: {
|
||||
switch (e->sig) {
|
||||
case UP_SIG: {
|
||||
if (m_timeout < 60) {
|
||||
++m_timeout;
|
||||
BSP_display(m_timeout);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DOWN_SIG: {
|
||||
if (m_timeout > 1) {
|
||||
--m_timeout;
|
||||
BSP_display(m_timeout);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ARM_SIG: {
|
||||
m_code = 0;
|
||||
tran(TIMING_STATE); // transition to "timing"
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TIMING_STATE: {
|
||||
switch (e->sig) {
|
||||
case UP_SIG: {
|
||||
m_code <<= 1;
|
||||
m_code |= 1;
|
||||
break;
|
||||
}
|
||||
case DOWN_SIG: {
|
||||
m_code <<= 1;
|
||||
break;
|
||||
}
|
||||
case ARM_SIG: {
|
||||
if (m_code == m_defuse) {
|
||||
tran(SETTING_STATE); // transition to "setting"
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TICK_SIG: {
|
||||
if (((TickEvt const *)e)->fine_time == 0) {
|
||||
--m_timeout;
|
||||
BSP_display(m_timeout);
|
||||
if (m_timeout == 0) {
|
||||
BSP_boom(); // destroy the bomb
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test harness --------------------------------------------------------------
|
||||
#include <iostream.h>
|
||||
#include <stdlib.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
|
||||
static Bomb1 l_bomb(0x0D); // time bomb FSM, the secret defuse code, 1101 bin
|
||||
|
||||
//............................................................................
|
||||
int main() {
|
||||
|
||||
cout << "Time Bomb (Nested switch)" << endl
|
||||
<< "Press 'u' for UP event" << endl
|
||||
<< "Press 'd' for DOWN event" << endl
|
||||
<< "Press 'a' for ARM event" << endl
|
||||
<< "Press <Esc> to quit." << endl;
|
||||
|
||||
l_bomb.init(); // take the initial transition
|
||||
|
||||
static TickEvt tick_evt;
|
||||
tick_evt.sig = TICK_SIG;
|
||||
tick_evt.fine_time = 0;
|
||||
for (;;) { // event loop
|
||||
|
||||
delay(100); // 100 ms delay
|
||||
|
||||
if (++tick_evt.fine_time == 10) {
|
||||
tick_evt.fine_time = 0;
|
||||
}
|
||||
cout.width(1);
|
||||
cout << "T(" << (int)tick_evt.fine_time << ')'
|
||||
<< ((tick_evt.fine_time == 0) ? '\n' : ' ');
|
||||
|
||||
l_bomb.dispatch(&tick_evt); // dispatch TICK event
|
||||
|
||||
if (_kbhit()) {
|
||||
static Event const up_evt = { UP_SIG };
|
||||
static Event const down_evt = { DOWN_SIG };
|
||||
static Event const arm_evt = { ARM_SIG };
|
||||
Event const *e = (Event *)0;
|
||||
|
||||
switch (_getch()) {
|
||||
case 'u': { // UP event
|
||||
cout << endl << "UP : ";
|
||||
e = &up_evt; // generate the UP event
|
||||
break;
|
||||
}
|
||||
case 'd': { // DOWN event
|
||||
cout << endl << "DOWN: ";
|
||||
e = &down_evt; // generate the DOWN event
|
||||
break;
|
||||
}
|
||||
case 'a': { // ARM event
|
||||
cout << endl << "ARM : ";
|
||||
e = &arm_evt; // generate the ARM event
|
||||
break;
|
||||
}
|
||||
case '\33': { // <Esc> key
|
||||
cout << endl << "ESC : Bye! Bye!" << flush << endl;
|
||||
_exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (e != (Event *)0) { // keyboard event available?
|
||||
l_bomb.dispatch(e); // dispatch the event
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -1 +0,0 @@
|
||||
Name dbg\bomb1.exe File dbg\bsp.obj,dbg\bomb1.obj
|
@ -1,209 +0,0 @@
|
||||
//****************************************************************************
|
||||
// Product: Time Bomb Example with "State Table"
|
||||
// Last Updated for Version: 4.5.03
|
||||
// Date of the Last Update: Nov 22, 2009
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
//
|
||||
// Copyright (C) 2002-2009 Quantum Leaps, LLC. All rights reserved.
|
||||
//
|
||||
// This software may be distributed and modified under the terms of the GNU
|
||||
// General Public License version 2 (GPL) as published by the Free Software
|
||||
// Foundation and appearing in the file GPL.TXT included in the packaging of
|
||||
// this file. Please note that GPL Section 2[b] requires that all works based
|
||||
// on this software must also be made publicly available under the terms of
|
||||
// the GPL ("Copyleft").
|
||||
//
|
||||
// Alternatively, this software may be distributed and modified under the
|
||||
// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
// the GPL and are specifically designed for licensees interested in
|
||||
// retaining the proprietary status of their code.
|
||||
//
|
||||
// Contact information:
|
||||
// Quantum Leaps Web site: http://www.quantum-leaps.com
|
||||
// e-mail: info@quantum-leaps.com
|
||||
//****************************************************************************
|
||||
#include "bsp.h"
|
||||
#include "statetbl.h"
|
||||
|
||||
enum BombSignals { // all signals for the Bomb FSM
|
||||
UP_SIG,
|
||||
DOWN_SIG,
|
||||
ARM_SIG,
|
||||
TICK_SIG,
|
||||
|
||||
MAX_SIG // the number of signals
|
||||
};
|
||||
|
||||
enum BombStates { // all states for the Bomb FSM
|
||||
SETTING_STATE,
|
||||
TIMING_STATE,
|
||||
|
||||
MAX_STATE // the number of states
|
||||
};
|
||||
|
||||
struct TickEvt : public Event {
|
||||
uint8_t fine_time; // the fine 1/10 s counter
|
||||
};
|
||||
|
||||
class Bomb2 : public StateTable { // the Bomb FSM
|
||||
public:
|
||||
Bomb2(uint8_t defuse); // public ctor
|
||||
|
||||
static void initial (Bomb2 *me, Event const *e); // initial transition
|
||||
|
||||
static void setting_UP (Bomb2 *me, Event const *e); // transition func.
|
||||
static void setting_DOWN(Bomb2 *me, Event const *e); // transition func.
|
||||
static void setting_ARM (Bomb2 *me, Event const *e); // transition func.
|
||||
static void timing_UP (Bomb2 *me, Event const *e); // transition func.
|
||||
static void timing_DOWN (Bomb2 *me, Event const *e); // transition func.
|
||||
static void timing_ARM (Bomb2 *me, Event const *e); // transition func.
|
||||
static void timing_TICK (Bomb2 *me, Event const *e); // transition func.
|
||||
|
||||
private:
|
||||
static Tran const state_table[MAX_STATE][MAX_SIG];
|
||||
|
||||
uint8_t m_timeout; // number of seconds till explosion
|
||||
uint8_t m_defuse; // secret defuse code to disarm the bomb
|
||||
uint8_t m_code; // currently entered code to disarm the bomb
|
||||
};
|
||||
|
||||
// the initial value of the timeout
|
||||
#define INIT_TIMEOUT 10
|
||||
|
||||
//............................................................................
|
||||
Tran const Bomb2::state_table[MAX_STATE][MAX_SIG] = {
|
||||
{ (Tran)&Bomb2::setting_UP, (Tran)&Bomb2::setting_DOWN,
|
||||
(Tran)&Bomb2::setting_ARM, &StateTable::empty },
|
||||
{ (Tran)&Bomb2::timing_UP, (Tran)&Bomb2::timing_DOWN,
|
||||
(Tran)&Bomb2::timing_ARM, (Tran)&Bomb2::timing_TICK }
|
||||
};
|
||||
//............................................................................
|
||||
Bomb2::Bomb2(uint8_t defuse)
|
||||
: StateTable(&Bomb2::state_table[0][0], MAX_STATE, MAX_SIG,
|
||||
(Tran)&Bomb2::initial),
|
||||
m_defuse(defuse)
|
||||
{}
|
||||
//............................................................................
|
||||
void Bomb2::initial(Bomb2 *me, Event const *) {
|
||||
me->m_timeout = INIT_TIMEOUT;
|
||||
TRAN(SETTING_STATE);
|
||||
}
|
||||
//............................................................................
|
||||
void Bomb2::setting_UP(Bomb2 *me, Event const *) {
|
||||
if (me->m_timeout < 60) {
|
||||
++me->m_timeout;
|
||||
BSP_display(me->m_timeout);
|
||||
}
|
||||
}
|
||||
//............................................................................
|
||||
void Bomb2::setting_DOWN(Bomb2 *me, Event const *) {
|
||||
if (me->m_timeout > 1) {
|
||||
--me->m_timeout;
|
||||
BSP_display(me->m_timeout);
|
||||
}
|
||||
}
|
||||
//............................................................................
|
||||
void Bomb2::setting_ARM(Bomb2 *me, Event const *) {
|
||||
me->m_code = 0;
|
||||
TRAN(TIMING_STATE); // transition to "timing"
|
||||
}
|
||||
//............................................................................
|
||||
void Bomb2::timing_UP(Bomb2 *me, Event const *) {
|
||||
me->m_code <<= 1;
|
||||
me->m_code |= 1;
|
||||
}
|
||||
//............................................................................
|
||||
void Bomb2::timing_DOWN(Bomb2 *me, Event const *) {
|
||||
me->m_code <<= 1;
|
||||
}
|
||||
//............................................................................
|
||||
void Bomb2::timing_ARM(Bomb2 *me, Event const *) {
|
||||
if (me->m_code == me->m_defuse) {
|
||||
TRAN(SETTING_STATE); // transition to "setting"
|
||||
}
|
||||
}
|
||||
//............................................................................
|
||||
void Bomb2::timing_TICK(Bomb2 *me, Event const *e) {
|
||||
if (((TickEvt const *)e)->fine_time == 0) {
|
||||
--me->m_timeout;
|
||||
BSP_display(me->m_timeout);
|
||||
if (me->m_timeout == 0) {
|
||||
BSP_boom(); // destroy the bomb
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test harness --------------------------------------------------------------
|
||||
#include <iostream.h>
|
||||
#include <stdlib.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
|
||||
static Bomb2 l_bomb(0x0D); // time bomb FSM, the secret defuse code, 1101 bin
|
||||
|
||||
//............................................................................
|
||||
int main() {
|
||||
|
||||
cout << "Time Bomb (State-Table)" << endl
|
||||
<< "Press 'u' for UP event" << endl
|
||||
<< "Press 'd' for DOWN event" << endl
|
||||
<< "Press 'a' for ARM event" << endl
|
||||
<< "Press <Esc> to quit." << endl;
|
||||
|
||||
l_bomb.init(); // take the initial transition
|
||||
|
||||
static TickEvt tick_evt;
|
||||
tick_evt.sig = TICK_SIG;
|
||||
tick_evt.fine_time = 0;
|
||||
for (;;) { // event loop
|
||||
|
||||
delay(100); // 100 ms delay
|
||||
|
||||
if (++tick_evt.fine_time == 10) {
|
||||
tick_evt.fine_time = 0;
|
||||
}
|
||||
cout.width(1);
|
||||
cout << "T(" << (int)tick_evt.fine_time << ')'
|
||||
<< ((tick_evt.fine_time == 0) ? '\n' : ' ');
|
||||
|
||||
l_bomb.dispatch(&tick_evt); // dispatch TICK event
|
||||
|
||||
if (kbhit()) {
|
||||
static Event const up_evt = { UP_SIG };
|
||||
static Event const down_evt = { DOWN_SIG };
|
||||
static Event const arm_evt = { ARM_SIG };
|
||||
Event const *e = (Event *)0;
|
||||
|
||||
switch (getch()) {
|
||||
case 'u': { // UP event
|
||||
cout << endl << "UP : ";
|
||||
e = &up_evt; // generate the UP event
|
||||
break;
|
||||
}
|
||||
case 'd': { // DOWN event
|
||||
cout << endl << "DOWN: ";
|
||||
e = &down_evt; // generate the DOWN event
|
||||
break;
|
||||
}
|
||||
case 'a': { // ARM event
|
||||
cout << endl << "ARM : ";
|
||||
e = &arm_evt; // generate the ARM event
|
||||
break;
|
||||
}
|
||||
case '\33': { // <Esc> key
|
||||
cout << endl << "ESC : Bye! Bye!";
|
||||
exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (e != (Event *)0) { // keyboard event available?
|
||||
l_bomb.dispatch(e); // dispatch the event
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -1 +0,0 @@
|
||||
Name dbg\bomb2.exe File dbg\bsp.obj,dbg\statetbl.obj,dbg\bomb2.obj
|
@ -1,194 +0,0 @@
|
||||
//****************************************************************************
|
||||
// Product: Time Bomb Example with the State design pattern (GoF)
|
||||
// Last Updated for Version: 4.1.01
|
||||
// Date of the Last Update: Nov 04, 2009
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
//
|
||||
// Copyright (C) 2002-2009 Quantum Leaps, LLC. All rights reserved.
|
||||
//
|
||||
// This software may be distributed and modified under the terms of the GNU
|
||||
// General Public License version 2 (GPL) as published by the Free Software
|
||||
// Foundation and appearing in the file GPL.TXT included in the packaging of
|
||||
// this file. Please note that GPL Section 2[b] requires that all works based
|
||||
// on this software must also be made publicly available under the terms of
|
||||
// the GPL ("Copyleft").
|
||||
//
|
||||
// Alternatively, this software may be distributed and modified under the
|
||||
// terms of Quantum Leaps commercial licenses, which expressly supersede
|
||||
// the GPL and are specifically designed for licensees interested in
|
||||
// retaining the proprietary status of their code.
|
||||
//
|
||||
// Contact information:
|
||||
// Quantum Leaps Web site: http://www.quantum-leaps.com
|
||||
// e-mail: info@quantum-leaps.com
|
||||
//****************************************************************************
|
||||
#include "bsp.h"
|
||||
|
||||
class Bomb3;
|
||||
class BombState {
|
||||
public:
|
||||
virtual void onUP (Bomb3 *) const {}
|
||||
virtual void onDOWN(Bomb3 *) const {}
|
||||
virtual void onARM (Bomb3 *) const {}
|
||||
virtual void onTICK(Bomb3 *, uint8_t) const {}
|
||||
};
|
||||
|
||||
class SettingState : public BombState {
|
||||
public:
|
||||
virtual void onUP (Bomb3 *context) const;
|
||||
virtual void onDOWN(Bomb3 *context) const;
|
||||
virtual void onARM (Bomb3 *context) const;
|
||||
};
|
||||
|
||||
class TimingState : public BombState {
|
||||
public:
|
||||
virtual void onUP (Bomb3 *context) const;
|
||||
virtual void onDOWN(Bomb3 *context) const;
|
||||
virtual void onARM (Bomb3 *context) const;
|
||||
virtual void onTICK(Bomb3 *context, uint8_t fine_time) const;
|
||||
};
|
||||
|
||||
class Bomb3 {
|
||||
public:
|
||||
Bomb3(uint8_t defuse) : m_defuse(defuse)
|
||||
{}
|
||||
|
||||
void init(); // the init() FSM interface
|
||||
|
||||
void onUP () { m_state->onUP (this); }
|
||||
void onDOWN() { m_state->onDOWN(this); }
|
||||
void onARM () { m_state->onARM (this); }
|
||||
void onTICK(uint8_t fine_time) { m_state->onTICK(this, fine_time); }
|
||||
|
||||
private:
|
||||
void tran(BombState const *target) { m_state = target; }
|
||||
|
||||
private:
|
||||
BombState const *m_state; // the state variable
|
||||
uint8_t m_timeout; // number of seconds till explosion
|
||||
uint8_t m_code; // currently entered code to disarm the bomb
|
||||
uint8_t m_defuse; // secret defuse code to disarm the bomb
|
||||
|
||||
private:
|
||||
static SettingState const setting;
|
||||
static TimingState const timing;
|
||||
|
||||
friend class SettingState;
|
||||
friend class TimingState;
|
||||
};
|
||||
|
||||
//............................................................................
|
||||
// the initial value of the timeout
|
||||
#define INIT_TIMEOUT 10
|
||||
|
||||
SettingState const Bomb3::setting;
|
||||
TimingState const Bomb3::timing;
|
||||
|
||||
void Bomb3::init() {
|
||||
m_timeout = INIT_TIMEOUT;
|
||||
tran(&Bomb3::setting);
|
||||
}
|
||||
//............................................................................
|
||||
void SettingState::onUP(Bomb3 *context) const {
|
||||
if (context->m_timeout < 60) {
|
||||
++context->m_timeout;
|
||||
BSP_display(context->m_timeout);
|
||||
}
|
||||
}
|
||||
void SettingState::onDOWN(Bomb3 *context) const {
|
||||
if (context->m_timeout > 1) {
|
||||
--context->m_timeout;
|
||||
BSP_display(context->m_timeout);
|
||||
}
|
||||
}
|
||||
void SettingState::onARM(Bomb3 *context) const {
|
||||
context->m_code = 0;
|
||||
context->tran(&Bomb3::timing); // transition to "timing"
|
||||
}
|
||||
|
||||
//............................................................................
|
||||
void TimingState::onUP(Bomb3 *context) const {
|
||||
context->m_code <<= 1;
|
||||
context->m_code |= 1;
|
||||
}
|
||||
void TimingState::onDOWN(Bomb3 *context) const {
|
||||
context->m_code <<= 1;
|
||||
}
|
||||
void TimingState::onARM(Bomb3 *context) const {
|
||||
if (context->m_code == context->m_defuse) {
|
||||
context->tran(&Bomb3::setting); // transition to "setting"
|
||||
}
|
||||
}
|
||||
void TimingState::onTICK(Bomb3 *context, uint8_t fine_time) const {
|
||||
if (fine_time == 0) {
|
||||
--context->m_timeout;
|
||||
BSP_display(context->m_timeout);
|
||||
if (context->m_timeout == 0) {
|
||||
BSP_boom(); // destroy the bomb
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test harness --------------------------------------------------------------
|
||||
#include <iostream.h>
|
||||
#include <stdlib.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
|
||||
static Bomb3 bomb(0x0D); // time bomb FSM, the secret defuse code, 1101 bin
|
||||
|
||||
//............................................................................
|
||||
int main() {
|
||||
|
||||
cout << "Time Bomb (GoF State-Pattern)" << endl
|
||||
<< "Press 'u' for UP event" << endl
|
||||
<< "Press 'd' for DOWN event" << endl
|
||||
<< "Press 'a' for ARM event" << endl
|
||||
<< "Press <Esc> to quit." << endl;
|
||||
|
||||
bomb.init(); // take the initial transition
|
||||
|
||||
for (;;) { // event loop
|
||||
static int fine_time = 0;
|
||||
|
||||
delay(100); // 100 ms delay
|
||||
|
||||
if (++fine_time == 10) {
|
||||
fine_time = 0;
|
||||
}
|
||||
cout.width(1);
|
||||
cout << "T(" << fine_time << ')' << ((fine_time == 0) ? '\n' : ' ');
|
||||
|
||||
bomb.onTICK(fine_time); // dispatch TICK event
|
||||
|
||||
if (kbhit()) {
|
||||
switch (getch()) {
|
||||
case 'u': { // UP event
|
||||
cout << endl << "UP : ";
|
||||
bomb.onUP(); // dispatch UP event
|
||||
break;
|
||||
}
|
||||
case 'd': { // DOWN event
|
||||
cout << endl << "DOWN: ";
|
||||
bomb.onDOWN(); // dispatch DOWN event
|
||||
break;
|
||||
}
|
||||
case 'a': { // ARM event
|
||||
cout << endl << "ARM : ";
|
||||
bomb.onARM(); // dispatch ARM event
|
||||
break;
|
||||
}
|
||||
case '\33': { // <Esc> key
|
||||
cout << endl << "ESC : Bye! Bye!";
|
||||
_exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -1 +0,0 @@
|
||||
Name dbg\bomb3.exe File dbg\bsp.obj,dbg\statetbl.obj,dbg\bomb3.obj
|
@ -1,206 +0,0 @@
|
||||
//****************************************************************************
|
||||
// Product: Time Bomb Example with QEP (FSM support)
|
||||
// Last Updated for Version: 4.5.02
|
||||
// Date of the Last Update: Aug 15, 2012
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
//
|
||||
// Copyright (C) 2002-2012 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
|
||||
// by the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Alternatively, this program may be distributed and modified 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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// Contact information:
|
||||
// Quantum Leaps Web sites: http://www.quantum-leaps.com
|
||||
// http://www.state-machine.com
|
||||
// e-mail: info@quantum-leaps.com
|
||||
//****************************************************************************
|
||||
#include "qep_port.h"
|
||||
#include "bsp.h"
|
||||
|
||||
using namespace QP;
|
||||
|
||||
enum Bomb4Signals {
|
||||
UP_SIG = Q_USER_SIG,
|
||||
DOWN_SIG,
|
||||
ARM_SIG,
|
||||
TICK_SIG
|
||||
};
|
||||
|
||||
struct TickEvt : public QEvt {
|
||||
uint8_t fine_time; // the fine 1/10 s counter
|
||||
};
|
||||
|
||||
class Bomb4 : public QFsm {
|
||||
uint8_t m_timeout; // number of seconds till explosion
|
||||
uint8_t m_code; // currently entered code to disarm the bomb
|
||||
uint8_t m_defuse; // secret defuse code to disarm the bomb
|
||||
|
||||
public:
|
||||
Bomb4(uint8_t defuse)
|
||||
: QFsm((QStateHandler)&Bomb4::initial),
|
||||
m_defuse(defuse)
|
||||
{}
|
||||
|
||||
protected:
|
||||
static QState initial(Bomb4 *me, QEvt const *e);
|
||||
static QState setting(Bomb4 *me, QEvt const *e);
|
||||
static QState timing (Bomb4 *me, QEvt const *e);
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// the initial value of the timeout
|
||||
#define INIT_TIMEOUT 10
|
||||
|
||||
//............................................................................
|
||||
QState Bomb4::initial(Bomb4 *me, QEvt const *) {
|
||||
me->m_timeout = INIT_TIMEOUT;
|
||||
return Q_TRAN(&Bomb4::setting);
|
||||
}
|
||||
//............................................................................
|
||||
QState Bomb4::setting(Bomb4 *me, QEvt const *e) {
|
||||
switch (e->sig) {
|
||||
case UP_SIG: {
|
||||
if (me->m_timeout < 60) {
|
||||
++me->m_timeout;
|
||||
BSP_display(me->m_timeout);
|
||||
}
|
||||
return Q_HANDLED();
|
||||
}
|
||||
case DOWN_SIG: {
|
||||
if (me->m_timeout > 1) {
|
||||
--me->m_timeout;
|
||||
BSP_display(me->m_timeout);
|
||||
}
|
||||
return Q_HANDLED();
|
||||
}
|
||||
case ARM_SIG: {
|
||||
return Q_TRAN(&Bomb4::timing); // transition to "timing"
|
||||
}
|
||||
}
|
||||
return Q_IGNORED();
|
||||
}
|
||||
//............................................................................
|
||||
QState Bomb4::timing(Bomb4 *me, QEvt const *e) {
|
||||
switch (e->sig) {
|
||||
case Q_ENTRY_SIG: {
|
||||
me->m_code = 0; // clear the defuse code
|
||||
return Q_HANDLED();
|
||||
}
|
||||
case UP_SIG: {
|
||||
me->m_code <<= 1;
|
||||
me->m_code |= 1;
|
||||
return Q_HANDLED();
|
||||
}
|
||||
case DOWN_SIG: {
|
||||
me->m_code <<= 1;
|
||||
return Q_HANDLED();
|
||||
}
|
||||
case ARM_SIG: {
|
||||
if (me->m_code == me->m_defuse) {
|
||||
return Q_TRAN(&Bomb4::setting); // transition to "setting"
|
||||
}
|
||||
return Q_HANDLED();
|
||||
}
|
||||
case TICK_SIG: {
|
||||
if (((TickEvt const *)e)->fine_time == 0) {
|
||||
--me->m_timeout;
|
||||
BSP_display(me->m_timeout);
|
||||
if (me->m_timeout == 0) {
|
||||
BSP_boom(); // destroy the bomb
|
||||
}
|
||||
}
|
||||
return Q_HANDLED();
|
||||
}
|
||||
}
|
||||
return Q_IGNORED();
|
||||
}
|
||||
|
||||
// Test harness --------------------------------------------------------------
|
||||
#include <iostream.h>
|
||||
#include <stdlib.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
|
||||
static Bomb4 bomb(0x0D); // time bomb FSM, the secret defuse code, 1101 bin
|
||||
|
||||
//............................................................................
|
||||
int main() {
|
||||
|
||||
cout << "Time Bomb (QEP QFsm class)" << endl
|
||||
<< "Press 'u' for UP event" << endl
|
||||
<< "Press 'd' for DOWN event" << endl
|
||||
<< "Press 'a' for ARM event" << endl
|
||||
<< "Press <Esc> to quit." << endl;
|
||||
|
||||
bomb.init(); // take the initial transition
|
||||
|
||||
static TickEvt tick_evt;
|
||||
tick_evt.sig = TICK_SIG;
|
||||
tick_evt.fine_time = 0;
|
||||
for (;;) { // event loop
|
||||
|
||||
delay(100); // 100 ms delay
|
||||
|
||||
if (++tick_evt.fine_time == 10) {
|
||||
tick_evt.fine_time = 0;
|
||||
}
|
||||
cout.width(1);
|
||||
cout << "T(" << (int)tick_evt.fine_time << ')'
|
||||
<< ((tick_evt.fine_time == 0) ? '\n' : ' ');
|
||||
|
||||
bomb.dispatch(&tick_evt); // dispatch TICK event
|
||||
|
||||
if (_kbhit()) {
|
||||
static QEvt const up_evt = { UP_SIG, 0 };
|
||||
static QEvt const down_evt = { DOWN_SIG, 0 };
|
||||
static QEvt const arm_evt = { ARM_SIG, 0 };
|
||||
QEvt const *e = (QEvt *)0;
|
||||
|
||||
switch (_getch()) {
|
||||
case 'u': { // UP event
|
||||
cout << endl << "UP : ";
|
||||
e = &up_evt; // generate the UP event
|
||||
break;
|
||||
}
|
||||
case 'd': { // DOWN event
|
||||
cout << endl << "DOWN: ";
|
||||
e = &down_evt; // generate the DOWN event
|
||||
break;
|
||||
}
|
||||
case 'a': { // ARM event
|
||||
cout << endl << "ARM : ";
|
||||
e = &arm_evt; // generate the ARM event
|
||||
break;
|
||||
}
|
||||
case '\33': { // <Esc> key
|
||||
cout << endl << "ESC : Bye! Bye!";
|
||||
_exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (e != (QEvt *)0) { // keyboard event available?
|
||||
bomb.dispatch(e); // dispatch the event
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -1 +0,0 @@
|
||||
Name dbg\bomb4.exe File dbg\bsp.obj,dbg\bomb4.obj Library ..\..\..\..\..\..\ports\80x86\dos\watcom\l\dbg\qep.lib
|