mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-14 05:42:57 +08:00
6.9.1
This commit is contained in:
parent
8b192d73bb
commit
7ebb142023
402
3rd_party/CMSIS/LICENSE.txt
vendored
402
3rd_party/CMSIS/LICENSE.txt
vendored
@ -1,201 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright {yyyy} {name of copyright owner}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
@ -543,7 +543,7 @@ void OS_CPU_SysTickInit (INT32U cnts)
|
||||
|
||||
/* Enable timer. */
|
||||
OS_CPU_CM0_NVIC_ST_CTRL |= OS_CPU_CM0_NVIC_ST_CTRL_CLK_SRC |
|
||||
OS_CPU_CM0_NVIC_ST_CTRL_ENABLE;
|
||||
OS_CPU_CM0_NVIC_ST_CTRL_ENABLE;
|
||||
/* Enable timer interrupt. */
|
||||
OS_CPU_CM0_NVIC_ST_CTRL |= OS_CPU_CM0_NVIC_ST_CTRL_INTEN;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "QP/C++"
|
||||
PROJECT_NUMBER = "6.9.0"
|
||||
PROJECT_NUMBER = "6.9.1"
|
||||
PROJECT_BRIEF =
|
||||
PROJECT_LOGO = images/header_logo_ql.png
|
||||
OUTPUT_DIRECTORY =
|
||||
|
@ -5,7 +5,7 @@
|
||||
#---------------------------------------------------------------------------
|
||||
DOXYFILE_ENCODING = UTF-8
|
||||
PROJECT_NAME = "QP/C++"
|
||||
PROJECT_NUMBER = "6.9.0"
|
||||
PROJECT_NUMBER = "6.9.1"
|
||||
PROJECT_BRIEF =
|
||||
PROJECT_LOGO = images/header_logo_ql.png
|
||||
OUTPUT_DIRECTORY =
|
||||
|
@ -2,6 +2,83 @@ namespace QP {
|
||||
|
||||
/** @page history Revision History
|
||||
|
||||
@section qpcpp_6_9_1 Version 6.9.1, 2020-09-28
|
||||
The main purpose of this release is a redesign of the [<b>QS Local Filter</b>](https://www.state-machine.com/qtools/qs.html#qs_local) (see also [feature request #127](https://sourceforge.net/p/qpc/feature-requests/127)). This new design supports filtering on __multiple__ active objects (as well as other objects in the Target memory), as opposed to filtering just one such object at a time. The main use case for this redesign of QS Local Filter is an application, where some active objects are very "noisy", and would overwhelm your trace. The new QS Local Filter allows you to selectively silence the "noisy" active objects and let all the others through.
|
||||
|
||||
The new QS Local Filter is based on "QS-IDs" associated with various objects in the Target memory. The QS-IDs are small integer numbers, such as the unique priorities assigned to QP Active Objects, but there are more such QS-IDs, which you can assign to various other objects through the macro QS_BEGIN_ID(). Then, you can setup the QS Local Filter to trace only a specific QS-IDs or whole groups of QS-IDs by means of the macro QS_LOC_FILTER() or remotely via the QS-RX channel.
|
||||
|
||||
|
||||
__Source code changes:__
|
||||
|
||||
The redesign of the QS Local Filter impacts the QS trace instrumentation in QP/C++: both the [<b>pre-defined QS trace records</b>](https://www.state-machine.com/qtools/qs.html#qs_pre) and the [<b>application-specific trace records</b>](https://www.state-machine.com/qtools/qs.html#qs_app). The changes to the pre-defined records are confided to the QP/C++ source code and are transparent to the application developers. However, the changes to the application-specific trace records require adjusting existing applications as follows:
|
||||
|
||||
- use the new macro QS_LOC_FILTER() to set/clear the QS Local Filter
|
||||
- use the new macro QS_BEGIN_ID() to define [<b>application-specific trace records</b>](https://www.state-machine.com/qtools/qs.html#qs_app).
|
||||
|
||||
|
||||
@note
|
||||
The macro QS_BEGIN_ID() assigns the specified QS-ID number to the app-specific record, which can be subsequently filtered by the new QS Local Filter. The old macro QS_BEGIN(), with the old Local Filter interface, is still available, but is @ref deprecated "deprecated" and not recommended.
|
||||
|
||||
|
||||
The following macros are __deprecated__:
|
||||
|
||||
- macro QS_FILTER_SM_OBJ() does nothing in QP/C++ 6.9.1
|
||||
- macro QS_FILTER_AO_OBJ() does nothing in QP/C++ 6.9.1
|
||||
- macro QS_FILTER_MP_OBJ() does nothing in QP/C++ 6.9.1
|
||||
- macro QS_FILTER_EQ_OBJ() does nothing in QP/C++ 6.9.1
|
||||
- macro QS_FILTER_TE_OBJ() does nothing in QP/C++ 6.9.1
|
||||
- macro QS_FILTER_AP_OBJ() still works for QS_BEGIN()
|
||||
- macro QS_FILTER_ON() still works, but uses QS_GLB_FILTER() internally
|
||||
- macro QS_FILTER_OFF() still works, but uses QS_GLB_FILTER() internally
|
||||
- macro QS_BEGIN() still works, but uses the old "AP-OBJ" pointer
|
||||
|
||||
|
||||
The following APIs have been __changed__:
|
||||
|
||||
- QHsm::init() now takes extra `qs_id` parameter
|
||||
- QHSM::dispatch() now takes extra `qs_id` parameter
|
||||
- QMPool::get() now takes extra `qs_id` parameter
|
||||
- QMPool::put() now takes extra `qs_id` parameter
|
||||
- QEQueue::post() now takes extra `qs_id` parameter
|
||||
- QEQueue::postLIFO() now takes extra `qs_id` parameter
|
||||
- QEQueue::get() now takes extra `qs_id` parameter
|
||||
|
||||
@note
|
||||
The API changes are __not backwards-compatible__ and require adjusting existing QP/C++ applications.
|
||||
|
||||
|
||||
Additionally, this release introduces the new pre-defined QS record #QS_QF_NEW_ATTEMPT, which is generated when Q_NEW_X() fails to allocate a dynamic event. Also, this release __reverses the order__ of the pre-defined QS records #QS_QF_NEW and #QS_QF_MPOOL_GET. This was necessary if the dynamic allocation is allowed to fail, because only _after_ attempting to allocate a memory block, the QF::newX_() function can generate either #QS_QF_NEW or #QS_QF_NEW_ATTEMPT.
|
||||
|
||||
@note
|
||||
The reversal of #QS_QF_NEW and #QS_QF_MPOOL_GET trace records has implications for the existing [<b>QUTest test scripts</b>](https://www.state-machine.com/qtools/qutest_script.html), where the order of expectations for "QF-New" and "MP-Get" needs to be reversed as well.
|
||||
|
||||
|
||||
Additionally, this release modifies the @ref qxk "QXK" source code, so that the `QActive.prio` attribute is the fixed priority assigned in QActive_start(), while `QActive.dynPrio` is the "dynamic" priority that can be changed when a @ref qxk_extended "QXK extended thread" acquires a @ref QP::QXMutex "mutex".
|
||||
|
||||
|
||||
__Updated Ports:__
|
||||
|
||||
- all ARM Cortex-M ports (added workaround for the [<b>ARM Erratum 838869</b>](https://www.state-machine.com/doc/Cortex-M4_Software_Developers_Errata_Notice_v3.pdf))
|
||||
- all QK ports (because of the changed QMPool::get() / QMPool::put() interface)
|
||||
- all QXK ports (because of the changed QMPool::get() / QMPool::put() interface)
|
||||
- embOS port (because of the changed QMPool::get() / QMPool::put() interface)
|
||||
- FreeRTOS port (because of the changed QMPool::get() / QMPool::put() interface)
|
||||
- ThreadX port (because of the changed QMPool::get() / QMPool::put() interface)
|
||||
- uC/OS-II port (because of the changed QMPool::get() / QMPool::put() interface)
|
||||
- posix, posix-qv (because of the changed QMPool::get() / QMPool::put() interface)
|
||||
- win32, win32-qv (because of the changed QMPool::get() / QMPool::put() interface)
|
||||
|
||||
|
||||
__Feature Requests:__
|
||||
|
||||
- [feature#181 "Use of QS_U64()) on 32 bit machine"](https://sourceforge.net/p/qpc/feature-requests/181)
|
||||
|
||||
__Bug Fixes:__
|
||||
|
||||
- [bug#279 "Confusing documentation of QF_newX_()"](https://sourceforge.net/p/qpc/bugs/279)
|
||||
- [bug#280 "QXK_onContextSw() not called at the end of QXK_activate_()"](https://sourceforge.net/p/qpc/bugs/280)
|
||||
|
||||
|
||||
@section qpcpp_6_9_0 Version 6.9.0, 2020-08-21
|
||||
The main purpose of this release is to adjust the QP/C++ RTEF to the changes and improvements introduced in [QTools 6.9.0](https://www.state-machine.com/qtools/history.html). Specifically, QP/C++ now includes examples for the new [QView Visualization & Monitoring](https://www.state-machine.com/qtools/qview.html) as well as adjustments for the new version of [QUTest Unit Testing](https://www.state-machine.com/qtools/qutest.html).
|
||||
|
||||
@ -35,7 +112,7 @@ The #QS_QF_RUN record is now generated in [QUTest unit testing](https://www.stat
|
||||
+ ARM Cortex-M examples for STM32 NUCLEO-L053RE (`qpcpp\examples\arm-cm\dpp_nucleo-l053r8`) and NUCLEO-L152RE (`qpcpp\examples\arm-cm\dpp_nucleo-l152re`) have been modified to support bi-directional QSPY communication. These examples now include the QView demos.
|
||||
+ Added examples of new [Sequence Diagram Generation](https://www.state-machine.com/qtools/html/qspy_seq.html) in QSPY 6.9.0
|
||||
|
||||
+ The example projects for MSP430 now contain the `ccs-ti` and `ccs-gnu` directories, for the TI-MSP430 and GNU-MSP430 toolchains, respectively.
|
||||
+ The example projects for MSP430 now contain the `ccs-ti` and `ccs-gnu` directories, for the TI-MSP430 and GNU-MSP430 toolchains, respectively.
|
||||
|
||||
|
||||
__Bug Fixes:__
|
||||
|
@ -131,8 +131,8 @@ namespace QP {
|
||||
/// @note This is a specific implementation for the QK-port of QF.
|
||||
/// In other QF ports you need to define the macro appropriately for
|
||||
/// the underlying kernel/OS you're using.
|
||||
#define QF_EPOOL_GET_(p_, e_, m_) \
|
||||
((e_) = static_cast<QEvt *>((p_).get((m_))))
|
||||
#define QF_EPOOL_GET_(p_, e_, m_, qs_id_) \
|
||||
((e_) = static_cast<QEvt *>((p_).get((m_), (qs_id_))))
|
||||
|
||||
/// Platform-dependent macro defining how QF should return an event
|
||||
/// @a e_ to the event pool @a p_
|
||||
@ -140,7 +140,7 @@ namespace QP {
|
||||
/// @note This is a specific implementation for the QK-port of QF.
|
||||
/// In other QF ports you need to define the macro appropriately for
|
||||
/// the underlying kernel/OS you're using.
|
||||
#define QF_EPOOL_PUT_(p_, e_) ((p_).put(e_))
|
||||
#define QF_EPOOL_PUT_(p_, e_, qs_id_) ((p_).put((e_), (qs_id_)))
|
||||
|
||||
/// Macro that should be defined (typically on the compiler's command line)
|
||||
/// in the Win32-GUI applications that use the @ref win32 or @ref win32-qv
|
||||
|
@ -8,40 +8,40 @@
|
||||
3 1 14 1 4 QP::QEvt::QEvt@159-162@..\include\qep.hpp
|
||||
5 1 26 2 5 QP::QEvt::QEvt@166-170@..\include\qep.hpp
|
||||
1 1 6 0 1 QP::QEvt::~QEvt@174-174@..\include\qep.hpp
|
||||
1 1 13 1 1 QP::QHsm::init@281-281@..\include\qep.hpp
|
||||
3 1 13 1 3 QP::QHsm::state@292-294@..\include\qep.hpp
|
||||
4 1 18 1 4 QP::QHsm::tran@350-353@..\include\qep.hpp
|
||||
4 1 18 1 4 QP::QHsm::tran_hist@356-359@..\include\qep.hpp
|
||||
4 1 18 1 4 QP::QHsm::super@362-365@..\include\qep.hpp
|
||||
4 1 30 1 4 QP::QHsm::qm_tran@376-379@..\include\qep.hpp
|
||||
7 1 42 2 7 QP::QHsm::qm_tran_hist@383-389@..\include\qep.hpp
|
||||
4 1 30 1 4 QP::QHsm::qm_tran_init@393-396@..\include\qep.hpp
|
||||
4 1 30 1 4 QP::QHsm::qm_tran_ep@400-403@..\include\qep.hpp
|
||||
7 1 40 2 7 QP::QHsm::qm_tran_xp@407-413@..\include\qep.hpp
|
||||
4 1 20 1 4 QP::QHsm::qm_entry@417-420@..\include\qep.hpp
|
||||
4 1 20 1 4 QP::QHsm::qm_exit@423-426@..\include\qep.hpp
|
||||
4 1 19 1 4 QP::QHsm::qm_entry@429-432@..\include\qep.hpp
|
||||
4 1 19 1 4 QP::QHsm::qm_exit@435-438@..\include\qep.hpp
|
||||
4 1 20 1 4 QP::QHsm::qm_sm_exit@442-445@..\include\qep.hpp
|
||||
4 1 20 1 4 QP::QHsm::qm_super_sub@449-452@..\include\qep.hpp
|
||||
1 1 13 1 1 QP::QMsm::init@498-498@..\include\qep.hpp
|
||||
3 1 13 1 3 QP::QMsm::stateObj@507-509@..\include\qep.hpp
|
||||
3 1 10 1 3 QP::QEP::getVersion@584-586@..\include\qep.hpp
|
||||
3 1 11 1 3 QP::QEQueue::getNFree@223-225@..\include\qequeue.hpp
|
||||
3 1 11 1 3 QP::QEQueue::getNMin@238-240@..\include\qequeue.hpp
|
||||
3 1 13 1 3 QP::QEQueue::isEmpty@252-254@..\include\qequeue.hpp
|
||||
3 1 19 1 3 QP::QHsm::init@282-284@..\include\qep.hpp
|
||||
3 1 13 1 3 QP::QHsm::state@296-298@..\include\qep.hpp
|
||||
4 1 18 1 4 QP::QHsm::tran@354-357@..\include\qep.hpp
|
||||
4 1 18 1 4 QP::QHsm::tran_hist@360-363@..\include\qep.hpp
|
||||
4 1 18 1 4 QP::QHsm::super@366-369@..\include\qep.hpp
|
||||
4 1 30 1 4 QP::QHsm::qm_tran@380-383@..\include\qep.hpp
|
||||
7 1 42 2 7 QP::QHsm::qm_tran_hist@387-393@..\include\qep.hpp
|
||||
4 1 30 1 4 QP::QHsm::qm_tran_init@397-400@..\include\qep.hpp
|
||||
4 1 30 1 4 QP::QHsm::qm_tran_ep@404-407@..\include\qep.hpp
|
||||
7 1 40 2 7 QP::QHsm::qm_tran_xp@411-417@..\include\qep.hpp
|
||||
4 1 20 1 4 QP::QHsm::qm_entry@421-424@..\include\qep.hpp
|
||||
4 1 20 1 4 QP::QHsm::qm_exit@427-430@..\include\qep.hpp
|
||||
4 1 19 1 4 QP::QHsm::qm_entry@433-436@..\include\qep.hpp
|
||||
4 1 19 1 4 QP::QHsm::qm_exit@439-442@..\include\qep.hpp
|
||||
4 1 20 1 4 QP::QHsm::qm_sm_exit@446-449@..\include\qep.hpp
|
||||
4 1 20 1 4 QP::QHsm::qm_super_sub@453-456@..\include\qep.hpp
|
||||
3 1 19 1 3 QP::QMsm::init@504-506@..\include\qep.hpp
|
||||
3 1 13 1 3 QP::QMsm::stateObj@516-518@..\include\qep.hpp
|
||||
3 1 10 1 3 QP::QEP::getVersion@596-598@..\include\qep.hpp
|
||||
3 1 11 1 3 QP::QEQueue::getNFree@225-227@..\include\qequeue.hpp
|
||||
3 1 11 1 3 QP::QEQueue::getNMin@240-242@..\include\qequeue.hpp
|
||||
3 1 13 1 3 QP::QEQueue::isEmpty@254-256@..\include\qequeue.hpp
|
||||
6 1 51 5 6 QP::QActive::start@200-205@..\include\qf.hpp
|
||||
3 1 19 1 3 QP::QActive::getPrio@251-253@..\include\qf.hpp
|
||||
3 1 22 1 3 QP::QActive::setPrio@256-258@..\include\qf.hpp
|
||||
1 1 10 1 1 QP::QActive::getOsObject@266-266@..\include\qf.hpp
|
||||
1 1 10 1 1 QP::QActive::getThread@272-272@..\include\qf.hpp
|
||||
3 1 13 1 3 QP::QMActive::stateObj@341-343@..\include\qf.hpp
|
||||
3 1 17 1 3 QP::QTimeEvt::toActive@457-459@..\include\qf.hpp
|
||||
3 1 17 1 3 QP::QTimeEvt::toTimeEvt@462-464@..\include\qf.hpp
|
||||
3 1 10 1 3 QP::QF::getVersion@493-495@..\include\qf.hpp
|
||||
1 1 14 1 1 QP::QTicker::init@637-637@..\include\qf.hpp
|
||||
3 1 13 1 3 QP::QMActive::stateObj@343-345@..\include\qf.hpp
|
||||
3 1 17 1 3 QP::QTimeEvt::toActive@459-461@..\include\qf.hpp
|
||||
3 1 17 1 3 QP::QTimeEvt::toTimeEvt@464-466@..\include\qf.hpp
|
||||
3 1 10 1 3 QP::QF::getVersion@495-497@..\include\qf.hpp
|
||||
3 1 18 1 3 QP::QTicker::init@640-642@..\include\qf.hpp
|
||||
3 1 10 1 3 QP::QK::getVersion@155-157@..\include\qk.hpp
|
||||
3 1 11 1 3 QP::QMPool::getBlockSize@149-151@..\include\qmpool.hpp
|
||||
3 1 11 1 3 QP::QMPool::getBlockSize@150-152@..\include\qmpool.hpp
|
||||
3 1 11 1 3 QP::QPSet::setEmpty@81-83@..\include\qpset.hpp
|
||||
3 1 15 1 3 QP::QPSet::isEmpty@86-88@..\include\qpset.hpp
|
||||
3 1 15 1 3 QP::QPSet::notEmpty@91-93@..\include\qpset.hpp
|
||||
@ -56,168 +56,169 @@
|
||||
8 2 70 1 8 QP::QPSet::insert@162-169@..\include\qpset.hpp
|
||||
8 2 74 1 8 QP::QPSet::rmove@175-182@..\include\qpset.hpp
|
||||
5 2 40 1 5 QP::QPSet::findMax@185-189@..\include\qpset.hpp
|
||||
7 1 28 1 7 QP::QS::force_cast@500-506@..\include\qs.hpp
|
||||
14 4 87 1 14 QP::QS::rxPut@564-577@..\include\qs.hpp
|
||||
6 1 51 5 6 QP::QActiveDummy::start@598-603@..\include\qs.hpp
|
||||
1 1 14 1 1 QP::QActiveDummy::init@606-606@..\include\qs.hpp
|
||||
1 1 14 1 1 QP::QXThread::init@86-86@..\include\qxthread.hpp
|
||||
6 1 51 5 6 QP::QXThread::start@99-104@..\include\qxthread.hpp
|
||||
2 1 15 2 3 QP::QEvt@101-103@..\src\qf\qep_hsm.cpp
|
||||
4 1 27 1 4 QP::QHsm::QHsm@119-122@..\src\qf\qep_hsm.cpp
|
||||
2 1 8 0 2 QP::QHsm::~QHsm@128-129@..\src\qf\qep_hsm.cpp
|
||||
48 7 348 1 68 QP::QHsm::init@140-207@..\src\qf\qep_hsm.cpp
|
||||
5 1 37 2 5 QP::QHsm::top@225-229@..\src\qf\qep_hsm.cpp
|
||||
109 15 680 1 156 QP::QHsm::dispatch@242-397@..\src\qf\qep_hsm.cpp
|
||||
96 15 461 1 131 QP::QHsm::hsm_tran@410-540@..\src\qf\qep_hsm.cpp
|
||||
16 3 85 1 23 QP::QHsm::isIn@555-577@..\src\qf\qep_hsm.cpp
|
||||
20 4 108 1 29 QP::QHsm::childState@598-626@..\src\qf\qep_hsm.cpp
|
||||
7 1 28 1 7 QP::QS::force_cast@518-524@..\include\qs.hpp
|
||||
14 4 87 1 14 QP::QS::rxPut@583-596@..\include\qs.hpp
|
||||
6 1 51 5 6 QP::QActiveDummy::start@617-622@..\include\qs.hpp
|
||||
3 1 18 1 3 QP::QActiveDummy::init@626-628@..\include\qs.hpp
|
||||
3 1 20 1 3 QP::QXThread::init@87-89@..\include\qxthread.hpp
|
||||
6 1 51 5 6 QP::QXThread::start@103-108@..\include\qxthread.hpp
|
||||
2 1 15 2 3 QP::QEvt@99-101@..\src\qf\qep_hsm.cpp
|
||||
4 1 27 1 4 QP::QHsm::QHsm@117-120@..\src\qf\qep_hsm.cpp
|
||||
2 1 8 0 2 QP::QHsm::~QHsm@126-127@..\src\qf\qep_hsm.cpp
|
||||
48 7 329 2 68 QP::QHsm::init@139-206@..\src\qf\qep_hsm.cpp
|
||||
5 1 37 2 5 QP::QHsm::top@224-228@..\src\qf\qep_hsm.cpp
|
||||
102 15 608 2 149 QP::QHsm::dispatch@242-390@..\src\qf\qep_hsm.cpp
|
||||
97 15 464 2 132 QP::QHsm::hsm_tran@404-535@..\src\qf\qep_hsm.cpp
|
||||
16 3 85 1 23 QP::QHsm::isIn@550-572@..\src\qf\qep_hsm.cpp
|
||||
20 4 108 1 29 QP::QHsm::childState@593-621@..\src\qf\qep_hsm.cpp
|
||||
6 1 29 1 6 QP::QMsm::QMsm@83-88@..\src\qf\qep_msm.cpp
|
||||
23 3 174 1 36 QP::QMsm::init@100-135@..\src\qf\qep_msm.cpp
|
||||
117 21 684 1 169 QP::QMsm::dispatch@147-315@..\src\qf\qep_msm.cpp
|
||||
53 9 342 1 65 QP::QMsm::execTatbl_@330-394@..\src\qf\qep_msm.cpp
|
||||
20 4 113 2 27 QP::QMsm::exitToTranSource_@405-431@..\src\qf\qep_msm.cpp
|
||||
42 6 255 1 51 QP::QMsm::enterHistory_@444-494@..\src\qf\qep_msm.cpp
|
||||
13 3 59 1 14 QP::QMsm::isInState@509-522@..\src\qf\qep_msm.cpp
|
||||
21 4 90 1 28 QP::QMsm::childStateObj@539-566@..\src\qf\qep_msm.cpp
|
||||
22 3 168 2 36 QP::QMsm::init@101-136@..\src\qf\qep_msm.cpp
|
||||
113 21 661 2 166 QP::QMsm::dispatch@149-314@..\src\qf\qep_msm.cpp
|
||||
51 9 301 2 64 QP::QMsm::execTatbl_@330-393@..\src\qf\qep_msm.cpp
|
||||
21 4 116 3 28 QP::QMsm::exitToTranSource_@405-432@..\src\qf\qep_msm.cpp
|
||||
44 6 247 2 54 QP::QMsm::enterHistory_@446-499@..\src\qf\qep_msm.cpp
|
||||
13 3 59 1 14 QP::QMsm::isInState@514-527@..\src\qf\qep_msm.cpp
|
||||
21 4 90 1 28 QP::QMsm::childStateObj@544-571@..\src\qf\qep_msm.cpp
|
||||
9 3 69 1 10 QP::QF::add_@79-88@..\src\qf\qf_act.cpp
|
||||
10 3 80 1 12 QP::QF::remove_@103-114@..\src\qf\qf_act.cpp
|
||||
7 2 63 2 7 QP::QF::bzero@129-135@..\src\qf\qf_act.cpp
|
||||
24 6 155 1 29 QF_LOG2@151-179@..\src\qf\qf_act.cpp
|
||||
85 15 461 2 123 QP::QActive::post_@94-216@..\src\qf\qf_actq.cpp
|
||||
45 8 268 1 67 QP::QActive::postLIFO@232-298@..\src\qf\qf_actq.cpp
|
||||
36 3 223 1 48 QP::QActive::get_@319-366@..\src\qf\qf_actq.cpp
|
||||
10 2 68 1 13 QP::QF::getQueueMin@386-398@..\src\qf\qf_actq.cpp
|
||||
5 1 30 1 6 QP::QTicker::QTicker@401-406@..\src\qf\qf_actq.cpp
|
||||
4 1 27 1 4 QP::QTicker::init@408-411@..\src\qf\qf_actq.cpp
|
||||
11 2 74 1 13 QP::QTicker::dispatch@413-425@..\src\qf\qf_actq.cpp
|
||||
28 3 157 2 40 QP::QTicker::post_@435-474@..\src\qf\qf_actq.cpp
|
||||
4 1 26 1 4 QP::QTicker::postLIFO@477-480@..\src\qf\qf_actq.cpp
|
||||
12 1 85 2 14 QP::QActive::defer@77-90@..\src\qf\qf_defer.cpp
|
||||
34 3 178 1 51 QP::QActive::recall@113-163@..\src\qf\qf_defer.cpp
|
||||
8 2 60 1 8 QP::QActive::flushDeferred@180-187@..\src\qf\qf_defer.cpp
|
||||
21 4 159 3 29 QP::QF::poolInit@84-112@..\src\qf\qf_dyn.cpp
|
||||
28 5 177 3 37 QP::QF::newX_@140-176@..\src\qf\qf_dyn.cpp
|
||||
28 4 171 1 46 QP::QF::gc@201-246@..\src\qf\qf_dyn.cpp
|
||||
16 2 88 2 23 QP::QF::newRef_@262-284@..\src\qf\qf_dyn.cpp
|
||||
9 1 52 1 11 QP::QF::deleteRef_@296-306@..\src\qf\qf_dyn.cpp
|
||||
3 1 20 1 3 QP::QF::poolGetMaxBlockSize@312-314@..\src\qf\qf_dyn.cpp
|
||||
83 13 445 2 119 QP::QActive::post_@94-212@..\src\qf\qf_actq.cpp
|
||||
44 7 260 1 65 QP::QActive::postLIFO@228-292@..\src\qf\qf_actq.cpp
|
||||
34 3 201 1 46 QP::QActive::get_@313-358@..\src\qf\qf_actq.cpp
|
||||
10 2 68 1 13 QP::QF::getQueueMin@378-390@..\src\qf\qf_actq.cpp
|
||||
5 1 30 1 6 QP::QTicker::QTicker@393-398@..\src\qf\qf_actq.cpp
|
||||
7 1 41 2 7 QP::QTicker::init@400-406@..\src\qf\qf_actq.cpp
|
||||
14 2 88 2 16 QP::QTicker::dispatch@408-423@..\src\qf\qf_actq.cpp
|
||||
27 3 146 2 39 QP::QTicker::post_@433-471@..\src\qf\qf_actq.cpp
|
||||
4 1 26 1 4 QP::QTicker::postLIFO@474-477@..\src\qf\qf_actq.cpp
|
||||
12 1 76 2 14 QP::QActive::defer@77-90@..\src\qf\qf_defer.cpp
|
||||
32 3 157 1 49 QP::QActive::recall@113-161@..\src\qf\qf_defer.cpp
|
||||
11 2 62 1 11 QP::QActive::flushDeferred@178-188@..\src\qf\qf_defer.cpp
|
||||
19 4 159 3 29 QP::QF::poolInit@84-112@..\src\qf\qf_dyn.cpp
|
||||
39 7 268 3 53 QP::QF::newX_@140-192@..\src\qf\qf_dyn.cpp
|
||||
35 5 244 1 57 QP::QF::gc@217-273@..\src\qf\qf_dyn.cpp
|
||||
18 2 106 2 25 QP::QF::newRef_@289-313@..\src\qf\qf_dyn.cpp
|
||||
11 1 70 1 13 QP::QF::deleteRef_@325-337@..\src\qf\qf_dyn.cpp
|
||||
3 1 20 1 3 QP::QF::poolGetMaxBlockSize@343-345@..\src\qf\qf_dyn.cpp
|
||||
9 1 40 1 9 QP::QMPool::QMPool@63-71@..\src\qf\qf_mem.cpp
|
||||
31 5 228 3 53 QP::QMPool::init@103-155@..\src\qf\qf_mem.cpp
|
||||
17 2 102 1 24 QP::QMPool::put@173-196@..\src\qf\qf_mem.cpp
|
||||
41 4 214 1 63 QP::QMPool::get@222-284@..\src\qf\qf_mem.cpp
|
||||
11 3 74 1 14 QP::QF::getPoolMin@299-312@..\src\qf\qf_mem.cpp
|
||||
17 2 105 2 24 QP::QMPool::put@174-197@..\src\qf\qf_mem.cpp
|
||||
42 4 206 2 65 QP::QMPool::get@224-288@..\src\qf\qf_mem.cpp
|
||||
11 3 74 1 14 QP::QF::getPoolMin@303-316@..\src\qf\qf_mem.cpp
|
||||
7 1 39 2 11 QP::QF::psInit@89-99@..\src\qf\qf_ps.cpp
|
||||
90 17 626 1 201 QP::QF::publish_@119-319@..\src\qf\qf_ps.cpp
|
||||
87 17 591 1 198 QP::QF::publish_@119-316@..\src\qf\qf_ps.cpp
|
||||
8 3 59 1 14 QP::QActive::QActive@44-57@..\src\qf\qf_qact.cpp
|
||||
9 1 41 1 9 QP::QEQueue::QEQueue@58-66@..\src\qf\qf_qeq.cpp
|
||||
13 2 74 2 13 QP::QEQueue::init@84-96@..\src\qf\qf_qeq.cpp
|
||||
56 8 285 2 75 QP::QEQueue::post@120-194@..\src\qf\qf_qeq.cpp
|
||||
33 5 171 1 44 QP::QEQueue::postLIFO@217-260@..\src\qf\qf_qeq.cpp
|
||||
39 4 201 1 48 QP::QEQueue::get@278-325@..\src\qf\qf_qeq.cpp
|
||||
56 8 277 3 76 QP::QEQueue::post@122-197@..\src\qf\qf_qeq.cpp
|
||||
35 5 174 2 47 QP::QEQueue::postLIFO@221-267@..\src\qf\qf_qeq.cpp
|
||||
37 4 191 1 48 QP::QEQueue::get@287-334@..\src\qf\qf_qeq.cpp
|
||||
5 1 22 1 5 QP::QMActive::QMActive@61-65@..\src\qf\qf_qmact.cpp
|
||||
4 1 33 1 4 QP::QMActive::init@68-71@..\src\qf\qf_qmact.cpp
|
||||
3 1 19 1 3 QP::QMActive::init@73-75@..\src\qf\qf_qmact.cpp
|
||||
3 1 24 1 3 QP::QMActive::dispatch@77-79@..\src\qf\qf_qmact.cpp
|
||||
4 1 41 2 4 QP::QMActive::init@68-71@..\src\qf\qf_qmact.cpp
|
||||
3 1 24 1 3 QP::QMActive::init@73-75@..\src\qf\qf_qmact.cpp
|
||||
3 1 32 2 3 QP::QMActive::dispatch@77-79@..\src\qf\qf_qmact.cpp
|
||||
3 1 27 1 3 QP::QMActive::isInState@81-83@..\src\qf\qf_qmact.cpp
|
||||
5 1 27 1 5 QP::QMActive::childStateObj@85-89@..\src\qf\qf_qmact.cpp
|
||||
68 7 372 1 100 QP::QF::tickX_@81-180@..\src\qf\qf_time.cpp
|
||||
13 3 61 1 13 QP::QF::noTimeEvtsActiveX@207-219@..\src\qf\qf_time.cpp
|
||||
16 2 104 3 32 QP::QTimeEvt::QTimeEvt@232-263@..\src\qf\qf_time.cpp
|
||||
13 1 53 0 29 QP::QTimeEvt::QTimeEvt@269-297@..\src\qf\qf_time.cpp
|
||||
33 7 205 2 57 QP::QTimeEvt::armX@325-381@..\src\qf\qf_time.cpp
|
||||
32 2 155 1 38 QP::QTimeEvt::disarm@399-436@..\src\qf\qf_time.cpp
|
||||
33 7 199 1 58 QP::QTimeEvt::rearm@458-515@..\src\qf\qf_time.cpp
|
||||
5 1 28 1 5 QP::QTimeEvt::wasDisarmed@537-541@..\src\qf\qf_time.cpp
|
||||
7 1 28 1 9 QP::QTimeEvt::currCtr@556-564@..\src\qf\qf_time.cpp
|
||||
67 7 352 1 99 QP::QF::tickX_@81-179@..\src\qf\qf_time.cpp
|
||||
13 3 61 1 13 QP::QF::noTimeEvtsActiveX@206-218@..\src\qf\qf_time.cpp
|
||||
16 2 104 3 32 QP::QTimeEvt::QTimeEvt@231-262@..\src\qf\qf_time.cpp
|
||||
13 1 53 0 29 QP::QTimeEvt::QTimeEvt@268-296@..\src\qf\qf_time.cpp
|
||||
33 8 211 2 59 QP::QTimeEvt::armX@324-382@..\src\qf\qf_time.cpp
|
||||
31 3 150 1 39 QP::QTimeEvt::disarm@400-438@..\src\qf\qf_time.cpp
|
||||
33 8 205 1 60 QP::QTimeEvt::rearm@460-519@..\src\qf\qf_time.cpp
|
||||
5 1 28 1 5 QP::QTimeEvt::wasDisarmed@541-545@..\src\qf\qf_time.cpp
|
||||
7 1 28 1 9 QP::QTimeEvt::currCtr@560-568@..\src\qf\qf_time.cpp
|
||||
11 2 79 1 16 QP::QF::init@78-93@..\src\qk\qk.cpp
|
||||
3 1 14 1 4 QP::QF::stop@111-114@..\src\qk\qk.cpp
|
||||
6 2 26 1 8 QP::initial_events@119-126@..\src\qk\qk.cpp
|
||||
12 3 51 1 19 QP::QF::run@137-155@..\src\qk\qk.cpp
|
||||
21 5 142 6 30 QP::QActive::start@173-202@..\src\qk\qk.cpp
|
||||
21 2 138 1 32 QP::QK::schedLock@227-258@..\src\qk\qk.cpp
|
||||
22 4 149 1 33 QP::QK::schedUnlock@277-309@..\src\qk\qk.cpp
|
||||
12 3 49 1 19 QP::QF::run@137-155@..\src\qk\qk.cpp
|
||||
21 5 144 6 30 QP::QActive::start@173-202@..\src\qk\qk.cpp
|
||||
21 2 136 1 32 QP::QK::schedLock@227-258@..\src\qk\qk.cpp
|
||||
22 4 147 1 33 QP::QK::schedUnlock@277-309@..\src\qk\qk.cpp
|
||||
14 3 94 1 17 QK_sched_@329-345@..\src\qk\qk.cpp
|
||||
61 15 421 1 105 QK_activate_@356-460@..\src\qk\qk.cpp
|
||||
59 15 397 1 103 QK_activate_@356-458@..\src\qk\qk.cpp
|
||||
9 2 67 1 13 QP::QF::init@79-91@..\src\qv\qv.cpp
|
||||
3 1 12 1 4 QP::QF::stop@109-112@..\src\qv\qv.cpp
|
||||
39 9 209 1 76 QP::QF::run@130-205@..\src\qv\qv.cpp
|
||||
15 3 112 6 22 QP::QActive::start@223-244@..\src\qv\qv.cpp
|
||||
38 9 200 1 75 QP::QF::run@130-204@..\src\qv\qv.cpp
|
||||
15 3 114 6 22 QP::QActive::start@222-243@..\src\qv\qv.cpp
|
||||
2 1 10 0 2 QP::QXKIdleThread::QXKIdleThread@68-69@..\src\qxk\qxk.cpp
|
||||
14 2 105 1 22 QP::QF::init@85-106@..\src\qxk\qxk.cpp
|
||||
3 1 12 1 4 QP::QF::stop@124-127@..\src\qxk\qxk.cpp
|
||||
6 2 26 1 8 QP::initial_events@132-139@..\src\qxk\qxk.cpp
|
||||
12 3 51 1 20 QP::QF::run@148-167@..\src\qxk\qxk.cpp
|
||||
23 6 156 6 32 QP::QActive::start@184-215@..\src\qxk\qxk.cpp
|
||||
23 3 150 1 33 QP::QXK::schedLock@238-270@..\src\qxk\qxk.cpp
|
||||
22 4 149 1 34 QP::QXK::schedUnlock@293-326@..\src\qxk\qxk.cpp
|
||||
51 7 296 1 69 QXK_sched_@346-414@..\src\qxk\qxk.cpp
|
||||
77 16 547 1 133 QXK_activate_@425-557@..\src\qxk\qxk.cpp
|
||||
13 2 72 1 20 QXK_current@560-579@..\src\qxk\qxk.cpp
|
||||
12 3 49 1 20 QP::QF::run@148-167@..\src\qxk\qxk.cpp
|
||||
23 6 158 6 32 QP::QActive::start@184-215@..\src\qxk\qxk.cpp
|
||||
23 3 148 1 33 QP::QXK::schedLock@238-270@..\src\qxk\qxk.cpp
|
||||
22 4 147 1 34 QP::QXK::schedUnlock@293-326@..\src\qxk\qxk.cpp
|
||||
48 7 279 1 67 QXK_sched_@346-412@..\src\qxk\qxk.cpp
|
||||
74 16 510 1 130 QXK_activate_@423-552@..\src\qxk\qxk.cpp
|
||||
13 2 72 1 20 QXK_current@555-574@..\src\qxk\qxk.cpp
|
||||
16 4 105 1 24 QP::QXMutex::init@84-107@..\src\qxk\qxk_mutex.cpp
|
||||
66 12 459 1 108 QP::QXMutex::lock@129-236@..\src\qxk\qxk_mutex.cpp
|
||||
47 10 301 1 71 QP::QXMutex::tryLock@256-326@..\src\qxk\qxk_mutex.cpp
|
||||
68 16 463 1 115 QP::QXMutex::unlock@345-459@..\src\qxk\qxk_mutex.cpp
|
||||
67 12 473 1 109 QP::QXMutex::lock@129-237@..\src\qxk\qxk_mutex.cpp
|
||||
46 10 285 1 70 QP::QXMutex::tryLock@257-326@..\src\qxk\qxk_mutex.cpp
|
||||
66 16 459 1 113 QP::QXMutex::unlock@345-457@..\src\qxk\qxk_mutex.cpp
|
||||
8 1 55 2 10 QP::QXSemaphore::init@77-86@..\src\qxk\qxk_sema.cpp
|
||||
43 7 277 1 68 QP::QXSemaphore::wait@109-176@..\src\qxk\qxk_sema.cpp
|
||||
15 2 55 1 20 QP::QXSemaphore::tryWait@191-210@..\src\qxk\qxk_sema.cpp
|
||||
27 6 175 1 46 QP::QXSemaphore::signal@230-275@..\src\qxk\qxk_sema.cpp
|
||||
8 1 54 2 8 QP::QXThread::QXThread@81-88@..\src\qxk\qxk_xthr.cpp
|
||||
4 1 26 1 4 QP::QXThread::init@92-95@..\src\qxk\qxk_xthr.cpp
|
||||
4 1 26 1 4 QP::QXThread::dispatch@98-101@..\src\qxk\qxk_xthr.cpp
|
||||
25 6 191 6 44 QP::QXThread::start@124-167@..\src\qxk\qxk_xthr.cpp
|
||||
96 13 486 2 129 QP::QXThread::post_@206-334@..\src\qxk\qxk_xthr.cpp
|
||||
4 1 26 1 4 QP::QXThread::postLIFO@345-348@..\src\qxk\qxk_xthr.cpp
|
||||
60 7 439 1 86 QP::QXThread::queueGet@370-455@..\src\qxk\qxk_xthr.cpp
|
||||
5 1 50 1 6 QP::QXThread::block_@464-469@..\src\qxk\qxk_xthr.cpp
|
||||
8 3 59 1 9 QP::QXThread::unblock_@478-486@..\src\qxk\qxk_xthr.cpp
|
||||
18 3 135 2 33 QP::QXThread::teArm_@496-528@..\src\qxk\qxk_xthr.cpp
|
||||
11 2 42 1 14 QP::QXThread::teDisarm_@537-550@..\src\qxk\qxk_xthr.cpp
|
||||
20 3 169 1 34 QP::QXThread::delay@554-587@..\src\qxk\qxk_xthr.cpp
|
||||
14 2 58 1 16 QP::QXThread::delayCancel@591-606@..\src\qxk\qxk_xthr.cpp
|
||||
14 2 109 1 23 QXK_threadRet_@623-645@..\src\qxk\qxk_xthr.cpp
|
||||
8 1 54 2 8 QP::QXThread::QXThread@73-80@..\src\qxk\qxk_xthr.cpp
|
||||
7 1 40 2 7 QP::QXThread::init@84-90@..\src\qxk\qxk_xthr.cpp
|
||||
7 1 40 2 7 QP::QXThread::dispatch@93-99@..\src\qxk\qxk_xthr.cpp
|
||||
25 6 191 6 44 QP::QXThread::start@122-165@..\src\qxk\qxk_xthr.cpp
|
||||
94 13 464 2 127 QP::QXThread::post_@204-330@..\src\qxk\qxk_xthr.cpp
|
||||
4 1 26 1 4 QP::QXThread::postLIFO@341-344@..\src\qxk\qxk_xthr.cpp
|
||||
59 7 421 1 85 QP::QXThread::queueGet@366-450@..\src\qxk\qxk_xthr.cpp
|
||||
5 1 50 1 6 QP::QXThread::block_@459-464@..\src\qxk\qxk_xthr.cpp
|
||||
8 3 59 1 9 QP::QXThread::unblock_@473-481@..\src\qxk\qxk_xthr.cpp
|
||||
18 3 135 2 33 QP::QXThread::teArm_@491-523@..\src\qxk\qxk_xthr.cpp
|
||||
11 2 42 1 14 QP::QXThread::teDisarm_@532-545@..\src\qxk\qxk_xthr.cpp
|
||||
20 3 169 1 34 QP::QXThread::delay@549-582@..\src\qxk\qxk_xthr.cpp
|
||||
14 2 58 1 16 QP::QXThread::delayCancel@586-601@..\src\qxk\qxk_xthr.cpp
|
||||
14 2 109 1 23 QXK_threadRet_@618-640@..\src\qxk\qxk_xthr.cpp
|
||||
3 1 16 1 3 QP::QF_EVT_POOL_ID_@140-142@..\src\qf_pkg.hpp
|
||||
3 1 16 1 3 QP::QF_EVT_REF_CTR_@145-147@..\src\qf_pkg.hpp
|
||||
3 1 21 1 3 QP::QF_EVT_REF_CTR_INC_@150-152@..\src\qf_pkg.hpp
|
||||
3 1 21 1 3 QP::QF_EVT_REF_CTR_DEC_@155-157@..\src\qf_pkg.hpp
|
||||
36 file analyzed.
|
||||
37 file analyzed.
|
||||
==============================================================
|
||||
NLOC Avg.NLOC AvgCCN Avg.token function_cnt file
|
||||
--------------------------------------------------------------
|
||||
5 0.0 0.0 0.0 0 ..\include\qassert.h
|
||||
214 3.7 1.0 20.5 22 ..\include\qep.hpp
|
||||
38 3.0 1.0 11.7 3 ..\include\qequeue.hpp
|
||||
188 2.7 1.0 18.3 10 ..\include\qf.hpp
|
||||
226 3.9 1.0 21.1 22 ..\include\qep.hpp
|
||||
40 3.0 1.0 11.7 3 ..\include\qequeue.hpp
|
||||
194 2.9 1.0 18.7 10 ..\include\qf.hpp
|
||||
32 3.0 1.0 10.0 1 ..\include\qk.hpp
|
||||
34 3.0 1.0 11.0 1 ..\include\qmpool.hpp
|
||||
37 3.0 1.0 11.0 1 ..\include\qmpool.hpp
|
||||
1 0.0 0.0 0.0 0 ..\include\qpcpp.h
|
||||
4 0.0 0.0 0.0 0 ..\include\qpcpp.hpp
|
||||
72 4.3 1.4 34.8 14 ..\include\qpset.hpp
|
||||
319 7.0 1.8 45.0 4 ..\include\qs.hpp
|
||||
6 0.0 0.0 0.0 0 ..\include\qstamp.cpp
|
||||
338 7.5 1.8 46.0 4 ..\include\qs.hpp
|
||||
5 0.0 0.0 0.0 0 ..\include\qstamp.cpp
|
||||
4 0.0 0.0 0.0 0 ..\include\qstamp.hpp
|
||||
0 0.0 0.0 0.0 0 ..\include\qs_dummy.hpp
|
||||
12 0.0 0.0 0.0 0 ..\include\qv.hpp
|
||||
32 0.0 0.0 0.0 0 ..\include\qxk.hpp
|
||||
62 3.5 1.0 32.5 2 ..\include\qxthread.hpp
|
||||
321 33.6 5.3 196.6 9 ..\src\qf\qep_hsm.cpp
|
||||
310 36.9 6.4 218.2 8 ..\src\qf\qep_msm.cpp
|
||||
66 4.5 1.0 35.5 2 ..\include\qxthread.hpp
|
||||
315 32.9 5.3 186.8 9 ..\src\qf\qep_hsm.cpp
|
||||
306 36.4 6.4 208.9 8 ..\src\qf\qep_msm.cpp
|
||||
62 12.5 3.5 91.8 4 ..\src\qf\qf_act.cpp
|
||||
242 25.3 4.0 148.2 9 ..\src\qf\qf_actq.cpp
|
||||
63 18.0 2.0 107.7 3 ..\src\qf\qf_defer.cpp
|
||||
116 17.5 2.8 111.2 6 ..\src\qf\qf_dyn.cpp
|
||||
118 21.8 3.0 131.6 5 ..\src\qf\qf_mem.cpp
|
||||
107 48.5 9.0 332.5 2 ..\src\qf\qf_ps.cpp
|
||||
242 25.3 3.7 145.0 9 ..\src\qf\qf_actq.cpp
|
||||
64 18.3 2.0 98.3 3 ..\src\qf\qf_defer.cpp
|
||||
136 20.8 3.3 144.5 6 ..\src\qf\qf_dyn.cpp
|
||||
119 22.0 3.0 130.6 5 ..\src\qf\qf_mem.cpp
|
||||
104 47.0 9.0 315.0 2 ..\src\qf\qf_ps.cpp
|
||||
11 8.0 3.0 59.0 1 ..\src\qf\qf_qact.cpp
|
||||
159 30.0 4.0 154.4 5 ..\src\qf\qf_qeq.cpp
|
||||
27 3.8 1.0 25.3 6 ..\src\qf\qf_qmact.cpp
|
||||
232 24.4 3.4 133.9 9 ..\src\qf\qf_time.cpp
|
||||
186 19.0 4.1 123.8 9 ..\src\qk\qk.cpp
|
||||
78 16.5 3.8 100.0 4 ..\src\qv\qv.cpp
|
||||
265 22.4 4.3 143.1 11 ..\src\qxk\qxk.cpp
|
||||
206 49.2 10.5 332.0 4 ..\src\qxk\qxk_mutex.cpp
|
||||
159 30.0 4.0 151.4 5 ..\src\qf\qf_qeq.cpp
|
||||
27 3.8 1.0 28.8 6 ..\src\qf\qf_qmact.cpp
|
||||
230 24.2 3.8 132.4 9 ..\src\qf\qf_time.cpp
|
||||
184 18.8 4.1 120.7 9 ..\src\qk\qk.cpp
|
||||
77 16.2 3.8 98.2 4 ..\src\qv\qv.cpp
|
||||
259 21.8 4.3 137.8 11 ..\src\qxk\qxk.cpp
|
||||
204 48.8 10.5 330.5 4 ..\src\qxk\qxk_mutex.cpp
|
||||
102 23.2 4.0 140.5 4 ..\src\qxk\qxk_sema.cpp
|
||||
305 20.8 3.3 133.6 14 ..\src\qxk\qxk_xthr.cpp
|
||||
308 21.0 3.3 132.7 14 ..\src\qxk\qxk_xthr.cpp
|
||||
24 3.0 1.0 18.5 4 ..\src\qf_pkg.hpp
|
||||
9 0.0 0.0 0.0 0 ..\src\qs_pkg.hpp
|
||||
7 0.0 0.0 0.0 0 ..\src\qs_pkg.hpp
|
||||
13 0.0 0.0 0.0 0 ..\src\qxk_pkg.hpp
|
||||
|
||||
=========================================================================================================
|
||||
@ -225,10 +226,10 @@ NLOC Avg.NLOC AvgCCN Avg.token function_cnt file
|
||||
================================================
|
||||
NLOC CCN token PARAM length location
|
||||
------------------------------------------------
|
||||
117 21 684 1 169 QP::QMsm::dispatch@147-315@..\src\qf\qep_msm.cpp
|
||||
113 21 661 2 166 QP::QMsm::dispatch@149-314@..\src\qf\qep_msm.cpp
|
||||
==========================================================================================
|
||||
Total nloc Avg.NLOC AvgCCN Avg.token Fun Cnt Warning cnt Fun Rt nloc Rt
|
||||
------------------------------------------------------------------------------------------
|
||||
3975 16.9 3.1 103.8 174 1 0.01 0.04
|
||||
4021 16.9 3.1 102.9 174 1 0.01 0.04
|
||||
@endcode
|
||||
*/
|
||||
|
@ -1,18 +1,18 @@
|
||||
#include "qep.hpp" // QEP public interface
|
||||
#include "qep.hpp" // QEP public interface
|
||||
#include "calc.h" // Calc HSM derived from QHsm
|
||||
|
||||
static Calc l_calc; // an instance of Calc HSM
|
||||
|
||||
int main() {
|
||||
|
||||
l_calc.init(); // trigger initial transition
|
||||
l_calc.init(0U); // trigger initial transition
|
||||
|
||||
for (;;) { // event loop
|
||||
QEvt e;
|
||||
. . .
|
||||
// wait for the next event and assign it to the event object e
|
||||
. . .
|
||||
l_calc.dispatch(&e); // dispatch the event
|
||||
l_calc.dispatch(&e, 0U); // dispatch the event
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,9 +1,8 @@
|
||||
void QActive::run(void) {
|
||||
m_running = true;
|
||||
while (m_running) {
|
||||
QEvt const *e;
|
||||
get_(e); // wait for an event
|
||||
dispatch(e); // dispatch event to the active object's state machine
|
||||
QEvt const *e = get_(e); // wait for an event
|
||||
dispatch(e, m_prio); // dispatch e to the AO's state machine
|
||||
QF::gc(e); // check if the event is garbage, and collect it if so
|
||||
}
|
||||
|
||||
|
@ -9,11 +9,11 @@ void QK_onContextSw(QActive *prev, QActive *next) {
|
||||
}
|
||||
|
||||
// If you use QS software tracing, use the _NOCRIT() begin/end
|
||||
QS_BEGIN_NOCRIT(ON_CONTEXT_SW, (void *)1)
|
||||
QS_BEGIN_NOCRIT(ON_CONTEXT_SW, 0U)
|
||||
QS_OBJ(prev);
|
||||
QS_OBJ(next);
|
||||
QS_END_NOCRIT()
|
||||
}
|
||||
#endif // QK_ON_CONTEXT_SW
|
||||
|
||||
} // extern "C"
|
||||
} // extern "C"
|
||||
|
@ -4,18 +4,21 @@ int main(int arc, char *argv[]) {
|
||||
if (!QS_INIT(argv)) { // Initialize QS target component
|
||||
return -1; // Unable to initialize QSpy
|
||||
}
|
||||
QS_FILTER_ON(QS_ALL_RECORDS); // start with enabling all QS records
|
||||
|
||||
// apply the QS global filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS); // all state machine records
|
||||
QS_FILTER_ON(QS_AO_RECORDS); // all active object records
|
||||
QS_FILTER_ON(QS_UA_RECORDS); // all user records
|
||||
// apply the global QS filters...
|
||||
// NOTE: global filters start as being all OFF
|
||||
QS_GLB_FILTER(QS_QF_RECORDS); // turn QF-group ON
|
||||
QS_GLB_FILTER(-QS_QF_TICK); // turn #QS_QF_TICK OFF
|
||||
|
||||
// apply the QS local filters...
|
||||
QS_FILTER_SM_OBJ(&philo[3]); // trace only this state machine object
|
||||
QS_FILTER_AO_OBJ(&philo[3]); // trace only this active object
|
||||
QS_FILTER_MP_OBJ(regSizePoolSto); // trace only this event pool
|
||||
QS_FILTER_EQ_OBJ(&rawQueue); // trace only this event queue
|
||||
QS_FILTER_TE_OBJ(&philo[3].m_timeEvt); // trace only this time event
|
||||
// apply the local QS filters...
|
||||
// NOTE: local filters start as being all ON
|
||||
QS_LOC_FILTER(-QS_EP_IDS); // turn EP (Event-Pool) group OFF
|
||||
QS_LOC_FILTER(3); // turn AO with prioity 3 ON
|
||||
|
||||
// start the active objects...
|
||||
. . .
|
||||
}
|
||||
|
||||
// NOTE: the following will work only after AO_Table has been started
|
||||
QS_LOC_FILTER(-AO_Table->prio); // turn AO_Table OFF
|
||||
. . .
|
||||
}
|
||||
|
@ -8,8 +8,9 @@
|
||||
void BSP_displayPhilStat(uint8_t n, char const *stat) {
|
||||
. . .
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
// application-specific record
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio)
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
}
|
||||
|
@ -9,11 +9,11 @@ void QXK_onContextSw(QActive *prev, QActive *next) {
|
||||
}
|
||||
|
||||
// If you use QS software tracing, use the _NOCRIT() begin/end
|
||||
QS_BEGIN_NOCRIT(ON_CONTEXT_SW, (void *)1)
|
||||
QS_BEGIN_NOCRIT(ON_CONTEXT_SW, 0U)
|
||||
QS_OBJ(prev);
|
||||
QS_OBJ(next);
|
||||
QS_END_NOCRIT()
|
||||
}
|
||||
#endif // QXK_ON_CONTEXT_SW
|
||||
|
||||
} // extern "C"
|
||||
} // extern "C"
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: "Blinky" example, EK-TM4C123GXL board, preemptive QK kernel
|
||||
// Last updated for version 5.5.0
|
||||
// Last updated on 2015-09-23
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -47,25 +47,6 @@
|
||||
|
||||
//Q_DEFINE_THIS_FILE
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
SYSTICK_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_RED (1U << 1)
|
||||
#define LED_GREEN (1U << 3)
|
||||
@ -156,13 +137,13 @@ void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(SysTick_IRQn, SYSTICK_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -201,7 +182,7 @@ extern "C" Q_NORETURN Q_onAssert(char const * const module, int_t const loc) {
|
||||
}
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -218,7 +199,7 @@ extern "C" Q_NORETURN Q_onAssert(char const * const module, int_t const loc) {
|
||||
// by which a "QF-unaware" ISR can communicate with the QF framework is by
|
||||
// triggering a "QF-aware" ISR, which can post/publish events.
|
||||
//
|
||||
// NOTE01:
|
||||
// NOTE2:
|
||||
// One of the LEDs is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: "Blinky" example, EK-TM4C123GXL board, cooperative Vanilla kernel
|
||||
// Last updated for version 5.5.0
|
||||
// Last updated on 2015-09-23
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -47,25 +47,6 @@
|
||||
|
||||
//Q_DEFINE_THIS_FILE
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
SYSTICK_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_RED (1U << 1)
|
||||
#define LED_GREEN (1U << 3)
|
||||
@ -147,7 +128,7 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(SysTick_IRQn, SYSTICK_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EFM32-SLSTK3401A board, preemptive QK kernel
|
||||
// Last Updated for Version: 5.9.7
|
||||
// Date of the Last Update: 2017-08-18
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -46,27 +46,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART0_RX_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_PORT gpioPortF
|
||||
#define LED0_PIN 4
|
||||
@ -234,6 +213,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -244,7 +228,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIO->P[LED_PORT].DOUT &= ~(1U << LED0_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -304,9 +288,9 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART0_RX_IRQn, DPP::USART0_RX_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, DPP::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART0_RX_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -432,20 +416,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -493,7 +463,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EFM32-SLSTK3401A board, cooperative QV kernel
|
||||
// Last Updated for Version: 5.9.5
|
||||
// Date of the Last Update: 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -46,27 +46,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART0_RX_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_PORT gpioPortF
|
||||
#define LED0_PIN 4
|
||||
@ -116,7 +95,7 @@ void SysTick_Handler(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
//QP::QF::TICK_X(0U, &l_SysTick_Handler); // process time events for rate 0
|
||||
//QP::QF::TICK_X(0U, &l_SysTick_Handler); // process time evts for rate 0
|
||||
the_Ticker0->POST(0, &l_SysTick_Handler); // post to Ticker0 active object
|
||||
|
||||
// Perform the debouncing of buttons. The algorithm for debouncing
|
||||
@ -210,6 +189,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -220,7 +204,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIO->P[LED_PORT].DOUT &= ~(1U << LED0_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -278,9 +262,9 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART0_RX_IRQn, DPP::USART0_RX_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, DPP::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART0_RX_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -407,20 +391,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -468,7 +438,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EFM32-SLSTK3401A board, preemptive QXK kernel
|
||||
// Last Updated for Version: 6.0.3
|
||||
// Date of the Last Update: 2017-12-11
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -46,27 +46,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART0_RX_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_PORT gpioPortF
|
||||
#define LED0_PIN 4
|
||||
@ -220,6 +199,11 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(PAUSED_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -230,7 +214,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIO->P[LED_PORT].DOUT &= ~(1U << LED0_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -249,7 +233,7 @@ void BSP::displayPaused(uint8_t paused) {
|
||||
GPIO->P[LED_PORT].DOUT &= ~(1U << LED0_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PAUSED_STAT, nullptr) // application-specific record begin
|
||||
QS_BEGIN_ID(PAUSED_STAT, AO_Table->m_prio) // app-specific record begin
|
||||
QS_U8(1, paused); // Paused status
|
||||
QS_END()
|
||||
}
|
||||
@ -306,9 +290,9 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART0_RX_IRQn, DPP::USART0_RX_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, DPP::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART0_RX_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -438,12 +422,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS); // state machine records
|
||||
QS_FILTER_ON(QS_UA_RECORDS); // all usedr records
|
||||
//QS_FILTER_ON(QS_MUTEX_LOCK);
|
||||
//QS_FILTER_ON(QS_MUTEX_UNLOCK);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -491,7 +469,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,7 +1,7 @@
|
||||
//****************************************************************************
|
||||
// Product: DPP example, Win32-GUI
|
||||
// Last Updated for Version: 6.9.0
|
||||
// Date of the Last Update: 2020-08-06
|
||||
// Last Updated for Version: 6.9.1
|
||||
// Date of the Last Update: 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
@ -228,8 +228,9 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QP::QS_ALL_RECORDS);
|
||||
QS_FILTER_OFF(QP::QS_QF_TICK);
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::terminate(int16_t result) {
|
||||
@ -263,7 +264,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
// set the "segment" # n to the bitmap # 'bitmapNum'
|
||||
SegmentDisplay_setSegment(&l_philos, (UINT)n, bitmapNum);
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -336,7 +337,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EK-TM4C123GXL board, preemptive QK kernel
|
||||
// Last updated for version 5.9.7
|
||||
// Last updated on 2017-08-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -46,27 +46,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
UART0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIOA_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_RED (1U << 1)
|
||||
#define LED_GREEN (1U << 3)
|
||||
@ -235,13 +214,18 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIOPortA_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOF->DATA_Bits[LED_RED] = ((stat[0] == 'h') ? 0xFFU : 0U);
|
||||
GPIOF->DATA_Bits[LED_GREEN] = ((stat[0] == 'e') ? 0xFFU : 0U);
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -304,9 +288,9 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(UART0_IRQn, DPP::UART0_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIOA_IRQn, DPP::GPIOA_PRIO);
|
||||
NVIC_SetPriority(UART0_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIOA_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -416,20 +400,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -481,7 +451,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EK-TM4C123GXL board, preemptive QK kernel
|
||||
// Last Updated for Version: 6.3.3
|
||||
// Date of the Last Update: 2018-06-21
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -46,27 +46,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
UART0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIOA_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_RED (1U << 1)
|
||||
#define LED_GREEN (1U << 3)
|
||||
@ -235,13 +214,18 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIOPortA_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOF->DATA_Bits[LED_RED] = ((stat[0] == 'h') ? 0xFFU : 0U);
|
||||
GPIOF->DATA_Bits[LED_GREEN] = ((stat[0] == 'e') ? 0xFFU : 0U);
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -304,9 +288,9 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(UART0_IRQn, DPP::UART0_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIOA_IRQn, DPP::GPIOA_PRIO);
|
||||
NVIC_SetPriority(UART0_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIOA_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -427,20 +411,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -492,7 +462,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EK-TM4C123GXL board, cooperative QV kernel
|
||||
// Last updated for version 5.9.5
|
||||
// Last updated on 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -46,27 +46,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
UART0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIOA_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_RED (1U << 1)
|
||||
#define LED_GREEN (1U << 3)
|
||||
@ -212,13 +191,18 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIOPortA_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOF->DATA_Bits[LED_RED] = ((stat[0] == 'h') ? 0xFFU : 0U);
|
||||
GPIOF->DATA_Bits[LED_GREEN] = ((stat[0] == 'e') ? 0xFFU : 0U);
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -278,9 +262,9 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(UART0_IRQn, DPP::UART0_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIOA_IRQn, DPP::GPIOA_PRIO);
|
||||
NVIC_SetPriority(UART0_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIOA_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -383,20 +367,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -448,7 +418,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EK-TM4C123GXL board, preemptive QXK kernel
|
||||
// Last Updated for Version: 6.0.4
|
||||
// Date of the Last Update: 2018-01-13
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -46,27 +46,6 @@ Q_DEFINE_THIS_FILE // define the name of this file for assertions
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE1
|
||||
UART0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIOA_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE1
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_RED (1U << 1)
|
||||
#define LED_GREEN (1U << 3)
|
||||
@ -84,7 +63,6 @@ static uint32_t l_rnd; // random seed
|
||||
QP::QSTimeCtr QS_tickPeriod_;
|
||||
static uint8_t const l_SysTick_Handler = static_cast<uint8_t>(0);
|
||||
static uint8_t const l_GPIOPortA_IRQHandler = static_cast<uint8_t>(0);
|
||||
static uint8_t const l_dummy_AP_obj = static_cast<uint8_t>(0);
|
||||
|
||||
#define UART_BAUD_RATE 115200U
|
||||
#define UART_FR_TXFE (1U << 7)
|
||||
@ -218,6 +196,11 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(PAUSED_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -226,7 +209,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOF->DATA_Bits[LED_RED] = ((stat[0] == 'h') ? 0xFFU : 0U);
|
||||
GPIOF->DATA_Bits[LED_GREEN] = ((stat[0] == 'e') ? 0xFFU : 0U);
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -239,7 +222,7 @@ void BSP::displayPaused(uint8_t const paused) {
|
||||
XT_Test2->POST_X(&pauseEvt, 1U, nullptr);
|
||||
|
||||
// application-specific trace record
|
||||
QS_BEGIN(PAUSED_STAT, AO_Table)
|
||||
QS_BEGIN_ID(PAUSED_STAT, AO_Table->m_prio)
|
||||
QS_U8(1, paused); // Paused status
|
||||
QS_END()
|
||||
}
|
||||
@ -296,9 +279,9 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(UART0_IRQn, DPP::UART0_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIOA_IRQn, DPP::GPIOA_PRIO);
|
||||
NVIC_SetPriority(UART0_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIOA_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -408,12 +391,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS); // state machine records */
|
||||
QS_FILTER_ON(QS_UA_RECORDS); // all usedr records */
|
||||
//QS_FILTER_ON(QS_MUTEX_LOCK);
|
||||
//QS_FILTER_ON(QS_MUTEX_UNLOCK);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -463,7 +440,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, &DPP::l_dummy_AP_obj)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, NXP mbed-LPC1768 board, preemptive QK kernel
|
||||
// Last updated for version 5.9.5
|
||||
// Last updated on 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -43,26 +43,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
EINT0_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
// LEDs available on the board
|
||||
#define LED_1 (1U << 18) // P1.18
|
||||
@ -190,6 +170,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
|
||||
QS_OBJ_DICTIONARY(&l_EINT0_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -206,7 +191,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
LPC_GPIO1->FIOCLR = LED_2; // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -258,8 +243,8 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(EINT0_IRQn, DPP::EINT0_PRIO);
|
||||
NVIC_SetPriority(EINT0_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -363,19 +348,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, NXP mbed-LPC1768 board, coopearative QV kernel
|
||||
// Last updated for version 5.9.5
|
||||
// Last updated on 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -43,26 +43,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
EINT0_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
// LEDs available on the board
|
||||
#define LED_1 (1U << 18) // P1.18
|
||||
@ -182,6 +162,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
|
||||
QS_OBJ_DICTIONARY(&l_EINT0_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -198,7 +183,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
LPC_GPIO1->FIOCLR = LED_2; // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -250,8 +235,8 @@ void QF::onStartup(void) {
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(EINT0_IRQn, DPP::EINT0_PRIO);
|
||||
NVIC_SetPriority(EINT0_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -356,19 +341,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, NUCLEO-H743ZI board, premptive QK kernel
|
||||
// Last Updated for Version: 6.1.1
|
||||
// Date of the Last Update: 2018-02-17
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -45,27 +45,6 @@ Q_DEFINE_THIS_FILE // define the name of this file for assertions
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE1
|
||||
USART3_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
SYSTICK_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
EXTI0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
static uint32_t l_rnd; // random seed
|
||||
|
||||
@ -218,6 +197,11 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PAUSED_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
QS_USR_DICTIONARY(ON_CONTEXT_SW);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP::ledOn(void) {
|
||||
@ -236,7 +220,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
BSP_LED_Off(LED1);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END() // application-specific record end
|
||||
@ -284,23 +268,20 @@ namespace QP {
|
||||
|
||||
// QF callbacks ==============================================================
|
||||
void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set up the SysTick timer to fire at BSP::TICKS_PER_SEC rate
|
||||
SysTick_Config(SystemCoreClock / DPP::BSP::TICKS_PER_SEC);
|
||||
|
||||
// assign all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART3_IRQn, DPP::USART3_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(USART3_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -322,7 +303,7 @@ void QK_onContextSw(QActive *prev, QActive *next) {
|
||||
if (next != (QActive *)0) {
|
||||
//_impure_ptr = next->thread; // switch to next TLS
|
||||
}
|
||||
QS_BEGIN_NOCRIT(DPP::ON_CONTEXT_SW, (void *)1) // no critical section!
|
||||
QS_BEGIN_NOCRIT(DPP::ON_CONTEXT_SW, 0U) // no critical section!
|
||||
QS_OBJ(prev);
|
||||
QS_OBJ(next);
|
||||
QS_END_NOCRIT()
|
||||
@ -417,10 +398,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -467,8 +444,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, reinterpret_cast<void *>(1))
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, NUCLEO-H743ZI board, cooperative QV kernel
|
||||
// Last Updated for Version: 6.1.1
|
||||
// Date of the Last Update: 2018-02-17
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -45,27 +45,6 @@ Q_DEFINE_THIS_FILE // define the name of this file for assertions
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE1
|
||||
USART3_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
SYSTICK_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
EXTI0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
static uint32_t l_rnd; // random seed
|
||||
|
||||
@ -211,6 +190,11 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(PAUSED_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP::ledOn(void) {
|
||||
@ -229,7 +213,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
BSP_LED_Off(LED1);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END() // application-specific record end
|
||||
@ -275,23 +259,20 @@ namespace QP {
|
||||
|
||||
// QF callbacks ==============================================================
|
||||
void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set up the SysTick timer to fire at BSP::TICKS_PER_SEC rate
|
||||
SysTick_Config(SystemCoreClock / DPP::BSP::TICKS_PER_SEC);
|
||||
|
||||
// assign all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART3_IRQn, DPP::USART3_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(USART3_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -394,10 +375,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -444,8 +421,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, reinterpret_cast<void *>(1))
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, NUCLEO-H743ZI board, dual-mode QXK kernel
|
||||
// Last Updated for Version: 6.1.1
|
||||
// Date of the Last Update: 2018-02-17
|
||||
// Last Updated for Version: 6.9.1
|
||||
// Date of the Last Update: 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 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
|
||||
@ -45,27 +45,6 @@ Q_DEFINE_THIS_FILE // define the name of this file for assertions
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE1
|
||||
USART3_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
SYSTICK_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
EXTI0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
static uint32_t l_rnd; // random seed
|
||||
|
||||
@ -218,6 +197,11 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PAUSED_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
QS_USR_DICTIONARY(ON_CONTEXT_SW);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP::ledOn(void) {
|
||||
@ -236,7 +220,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
BSP_LED_Off(LED1);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END() // application-specific record end
|
||||
@ -284,23 +268,20 @@ namespace QP {
|
||||
|
||||
// QF callbacks ==============================================================
|
||||
void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set up the SysTick timer to fire at BSP::TICKS_PER_SEC rate
|
||||
SysTick_Config(SystemCoreClock / DPP::BSP::TICKS_PER_SEC);
|
||||
|
||||
// assign all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART3_IRQn, DPP::USART3_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(USART3_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -322,7 +303,7 @@ void QXK_onContextSw(QActive *prev, QActive *next) {
|
||||
if (next != (QActive *)0) {
|
||||
//_impure_ptr = next->thread; // switch to next TLS
|
||||
}
|
||||
QS_BEGIN_NOCRIT(DPP::ON_CONTEXT_SW, (void *)1) // no critical section!
|
||||
QS_BEGIN_NOCRIT(DPP::ON_CONTEXT_SW, 0U) // no critical section!
|
||||
QS_OBJ(prev);
|
||||
QS_OBJ(next);
|
||||
QS_END_NOCRIT()
|
||||
@ -417,10 +398,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -468,7 +445,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, reinterpret_cast<void *>(1))
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32 NUCLEO-L053R8 board, preemptive QK kernel
|
||||
// Last Updated for Version: 6.9.0
|
||||
// Date of the Last Update: 2020-08-14
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -176,6 +176,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
|
||||
QS_OBJ_DICTIONARY(&l_EXTI0_1_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -186,7 +191,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOA->BSRR |= (LED_LD2 << 16); // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -348,19 +353,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32 NUCLEO-L053R8 board, preemptive QK kernel
|
||||
// Last Updated for Version: 6.3.3
|
||||
// Date of the Last Update: 2018-06-21
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -43,26 +43,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
EXTI0_1_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
// LED pins available on the board (just one user LED LD2--Green on PA.5)
|
||||
#define LED_LD2 (1U << 5)
|
||||
@ -184,6 +164,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
|
||||
QS_OBJ_DICTIONARY(&l_EXTI0_1_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -194,7 +179,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOA->BSRR |= (LED_LD2 << 16); // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -242,14 +227,14 @@ void QF::onStartup(void) {
|
||||
// set up the SysTick timer to fire at BSP::TICKS_PER_SEC rate
|
||||
SysTick_Config(SystemCoreClock / DPP::BSP::TICKS_PER_SEC);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(EXTI0_1_IRQn, DPP::EXTI0_1_PRIO);
|
||||
NVIC_SetPriority(EXTI0_1_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -356,19 +341,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32 NUCLEO-L053R8 board, cooperative QV kernel
|
||||
// Last Updated for Version: 6.9.0
|
||||
// Date of the Last Update: 2020-08-14
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -168,6 +168,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
|
||||
QS_OBJ_DICTIONARY(&l_EXTI0_1_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -178,7 +183,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOA->BSRR |= (LED_LD2 << 16); // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -339,19 +344,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32 NUCLEO-L053R8 board, preemptive QXK kernel
|
||||
// Last Updated for Version: 6.9.0
|
||||
// Date of the Last Update: 2020-08-14
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -183,6 +183,11 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PAUSED_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
QS_USR_DICTIONARY(ON_CONTEXT_SW);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -193,7 +198,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOA->BSRR |= (LED_LD2 << 16); // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -285,7 +290,7 @@ void QXK_onContextSw(QActive *prev, QActive *next) {
|
||||
if (next != (QActive *)0) {
|
||||
//_impure_ptr = next->thread; // switch to next TLS
|
||||
}
|
||||
QS_BEGIN_NOCRIT(DPP::ON_CONTEXT_SW, (void *)1) // no critical section!
|
||||
QS_BEGIN_NOCRIT(DPP::ON_CONTEXT_SW, 0U) // no critical section!
|
||||
QS_OBJ(prev);
|
||||
QS_OBJ(next);
|
||||
QS_END_NOCRIT()
|
||||
@ -389,10 +394,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32 NUCLEO-L152RE board, preemptive QK kernel
|
||||
// Last Updated for Version: 6.9.0
|
||||
// Date of the Last Update: 2020-08-14
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-30
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -176,8 +176,9 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_ALL_RECORDS);
|
||||
QS_FILTER_OFF(QS_QF_TICK);
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -188,7 +189,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOA->BSRRH |= LED_LD2; // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
##############################################################################
|
||||
# Product: Makefile for QP/C++ on STM32 NUCLEO-L152RE, QK kernel, GNU-ARM
|
||||
# Last Updated for Version: 6.5.0
|
||||
# Date of the Last Update: 2019-04-15
|
||||
# Last Updated for Version: 6.9.1
|
||||
# Date of the Last Update: 2020-09-30
|
||||
#
|
||||
# Q u a n t u m L e a P s
|
||||
# ------------------------
|
||||
# Modern Embedded Software
|
||||
#
|
||||
# Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
# Copyright (C) 2005-2020 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
|
||||
@ -128,6 +128,7 @@ QP_ASMS :=
|
||||
QS_SRCS := \
|
||||
qs.cpp \
|
||||
qs_rx.cpp \
|
||||
qs_64bit.cpp \
|
||||
qs_fp.cpp
|
||||
|
||||
LIB_DIRS :=
|
||||
|
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0"?>
|
||||
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ConfigurationName>Debug</ConfigurationName>
|
||||
<Project xsi:type="com.visualgdb.project.embedded">
|
||||
<CustomSourceDirectories>
|
||||
<Directories />
|
||||
<PathStyle>MinGWUnixSlash</PathStyle>
|
||||
<LocalDirForAbsolutePaths>$(ToolchainDir)</LocalDirForAbsolutePaths>
|
||||
</CustomSourceDirectories>
|
||||
<MainSourceDirectory>$(ProjectDir)</MainSourceDirectory>
|
||||
<ExportAdvancedBuildVariables>false</ExportAdvancedBuildVariables>
|
||||
<EmbeddedProfileFile>stm32.xml</EmbeddedProfileFile>
|
||||
</Project>
|
||||
<Build xsi:type="com.visualgdb.build.msbuild">
|
||||
<ToolchainID>
|
||||
<Version>
|
||||
<Revision>0</Revision>
|
||||
</Version>
|
||||
</ToolchainID>
|
||||
<ProjectFile>dpp-qk.vcxproj</ProjectFile>
|
||||
<RemoteBuildEnvironment>
|
||||
<Records />
|
||||
</RemoteBuildEnvironment>
|
||||
<ParallelJobCount>1</ParallelJobCount>
|
||||
<SuppressDirectoryChangeMessages>true</SuppressDirectoryChangeMessages>
|
||||
</Build>
|
||||
<CustomBuild>
|
||||
<PreSyncActions />
|
||||
<PreBuildActions />
|
||||
<PostBuildActions />
|
||||
<PreCleanActions />
|
||||
<PostCleanActions />
|
||||
</CustomBuild>
|
||||
<CustomDebug>
|
||||
<PreDebugActions />
|
||||
<PostDebugActions />
|
||||
<DebugStopActions />
|
||||
<BreakMode>Default</BreakMode>
|
||||
</CustomDebug>
|
||||
<CustomShortcuts>
|
||||
<Shortcuts />
|
||||
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
|
||||
</CustomShortcuts>
|
||||
<UserDefinedVariables />
|
||||
<ImportedPropertySheets />
|
||||
<CodeSense>
|
||||
<Enabled>Unknown</Enabled>
|
||||
<ExtraSettings>
|
||||
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
|
||||
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
|
||||
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
|
||||
<FormattingEngine xsi:nil="true" />
|
||||
</ExtraSettings>
|
||||
<CodeAnalyzerSettings>
|
||||
<Enabled>false</Enabled>
|
||||
</CodeAnalyzerSettings>
|
||||
</CodeSense>
|
||||
<BuildContextDirectory>VisualGDB\VisualGDBCache</BuildContextDirectory>
|
||||
<Configurations />
|
||||
<ProgramArgumentsSuggestions />
|
||||
<Debug xsi:type="com.visualgdb.debug.embedded">
|
||||
<AdditionalStartupCommands />
|
||||
<AdditionalGDBSettings>
|
||||
<Features>
|
||||
<DisableAutoDetection>false</DisableAutoDetection>
|
||||
<UseFrameParameter>false</UseFrameParameter>
|
||||
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
|
||||
<ListLocalsSupported>false</ListLocalsSupported>
|
||||
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
|
||||
<ThreadInfoSupported>false</ThreadInfoSupported>
|
||||
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
|
||||
<SupportTargetCommand>false</SupportTargetCommand>
|
||||
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
|
||||
</Features>
|
||||
<EnableSmartStepping>false</EnableSmartStepping>
|
||||
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
|
||||
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
|
||||
<UseAppleExtensions>false</UseAppleExtensions>
|
||||
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
|
||||
<MakeLogFile>false</MakeLogFile>
|
||||
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
|
||||
<UseRelativePathsOnly>false</UseRelativePathsOnly>
|
||||
<ExitAction>None</ExitAction>
|
||||
<DisableDisassembly>false</DisableDisassembly>
|
||||
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
|
||||
<StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry>
|
||||
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
|
||||
<DisableSignals>false</DisableSignals>
|
||||
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
|
||||
<EnableNonStopMode>false</EnableNonStopMode>
|
||||
<MaxBreakpointLimit>0</MaxBreakpointLimit>
|
||||
</AdditionalGDBSettings>
|
||||
<DebugMethod>
|
||||
<ID>com.sysprogs.arm.openocd</ID>
|
||||
<InterfaceID>stlink-v2-1</InterfaceID>
|
||||
<InterfaceSerialNumber>066EFF495056805087184715</InterfaceSerialNumber>
|
||||
<Configuration xsi:type="com.visualgdb.edp.openocd.settings">
|
||||
<CommandLine>-f interface/stlink-v2-1.cfg -f target/stm32l1.cfg -c init -c "reset init"</CommandLine>
|
||||
<ExtraParameters>
|
||||
<Frequency xsi:nil="true" />
|
||||
<BoostedFrequency xsi:nil="true" />
|
||||
<ConnectUnderReset>false</ConnectUnderReset>
|
||||
</ExtraParameters>
|
||||
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
|
||||
<ProgramMode>Enabled</ProgramMode>
|
||||
<StartupCommands>
|
||||
<string>set remotetimeout 60</string>
|
||||
<string>target remote :$$SYS:GDB_PORT$$</string>
|
||||
<string>mon halt</string>
|
||||
<string>mon reset init</string>
|
||||
<string>load</string>
|
||||
</StartupCommands>
|
||||
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
|
||||
<PreferredGDBPort>0</PreferredGDBPort>
|
||||
<PreferredTelnetPort>0</PreferredTelnetPort>
|
||||
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
|
||||
<SelectedCoreIndex xsi:nil="true" />
|
||||
</Configuration>
|
||||
</DebugMethod>
|
||||
<AutoDetectRTOS>true</AutoDetectRTOS>
|
||||
<SemihostingSupport>Auto</SemihostingSupport>
|
||||
<SemihostingPollingDelay>0</SemihostingPollingDelay>
|
||||
<StepIntoEntryPoint>false</StepIntoEntryPoint>
|
||||
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
|
||||
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
|
||||
<StopAtEntryPoint>false</StopAtEntryPoint>
|
||||
<EnableVirtualHalts>false</EnableVirtualHalts>
|
||||
<DynamicAnalysisSettings />
|
||||
<EndOfStackSymbol>_estack</EndOfStackSymbol>
|
||||
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
|
||||
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
|
||||
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
|
||||
</Debug>
|
||||
</VisualGDBProjectSettings2>
|
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0"?>
|
||||
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ConfigurationName>Release</ConfigurationName>
|
||||
<Project xsi:type="com.visualgdb.project.embedded">
|
||||
<CustomSourceDirectories>
|
||||
<Directories />
|
||||
<PathStyle>MinGWUnixSlash</PathStyle>
|
||||
<LocalDirForAbsolutePaths>$(ToolchainDir)</LocalDirForAbsolutePaths>
|
||||
</CustomSourceDirectories>
|
||||
<MainSourceDirectory>$(ProjectDir)</MainSourceDirectory>
|
||||
<ExportAdvancedBuildVariables>false</ExportAdvancedBuildVariables>
|
||||
<EmbeddedProfileFile>stm32.xml</EmbeddedProfileFile>
|
||||
</Project>
|
||||
<Build xsi:type="com.visualgdb.build.msbuild">
|
||||
<ToolchainID>
|
||||
<Version>
|
||||
<Revision>0</Revision>
|
||||
</Version>
|
||||
</ToolchainID>
|
||||
<ProjectFile>dpp-qk.vcxproj</ProjectFile>
|
||||
<RemoteBuildEnvironment>
|
||||
<Records />
|
||||
<EnvironmentSetupFiles />
|
||||
</RemoteBuildEnvironment>
|
||||
<ParallelJobCount>1</ParallelJobCount>
|
||||
<SuppressDirectoryChangeMessages>true</SuppressDirectoryChangeMessages>
|
||||
</Build>
|
||||
<CustomBuild>
|
||||
<PreSyncActions />
|
||||
<PreBuildActions />
|
||||
<PostBuildActions />
|
||||
<PreCleanActions />
|
||||
<PostCleanActions />
|
||||
</CustomBuild>
|
||||
<CustomDebug>
|
||||
<PreDebugActions />
|
||||
<PostDebugActions />
|
||||
<DebugStopActions />
|
||||
<BreakMode>Default</BreakMode>
|
||||
</CustomDebug>
|
||||
<CustomShortcuts>
|
||||
<Shortcuts />
|
||||
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
|
||||
</CustomShortcuts>
|
||||
<UserDefinedVariables />
|
||||
<ImportedPropertySheets />
|
||||
<CodeSense>
|
||||
<Enabled>Unknown</Enabled>
|
||||
<ExtraSettings>
|
||||
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
|
||||
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
|
||||
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
|
||||
<FormattingEngine xsi:nil="true" />
|
||||
</ExtraSettings>
|
||||
<CodeAnalyzerSettings>
|
||||
<Enabled>false</Enabled>
|
||||
</CodeAnalyzerSettings>
|
||||
</CodeSense>
|
||||
<BuildContextDirectory>VisualGDB\VisualGDBCache</BuildContextDirectory>
|
||||
<Configurations />
|
||||
<ProgramArgumentsSuggestions />
|
||||
<Debug xsi:type="com.visualgdb.debug.embedded">
|
||||
<AdditionalStartupCommands />
|
||||
<AdditionalGDBSettings>
|
||||
<Features>
|
||||
<DisableAutoDetection>false</DisableAutoDetection>
|
||||
<UseFrameParameter>false</UseFrameParameter>
|
||||
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
|
||||
<ListLocalsSupported>false</ListLocalsSupported>
|
||||
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
|
||||
<ThreadInfoSupported>false</ThreadInfoSupported>
|
||||
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
|
||||
<SupportTargetCommand>false</SupportTargetCommand>
|
||||
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
|
||||
</Features>
|
||||
<EnableSmartStepping>false</EnableSmartStepping>
|
||||
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
|
||||
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
|
||||
<UseAppleExtensions>false</UseAppleExtensions>
|
||||
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
|
||||
<MakeLogFile>false</MakeLogFile>
|
||||
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
|
||||
<UseRelativePathsOnly>false</UseRelativePathsOnly>
|
||||
<ExitAction>None</ExitAction>
|
||||
<DisableDisassembly>false</DisableDisassembly>
|
||||
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
|
||||
<StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry>
|
||||
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
|
||||
<DisableSignals>false</DisableSignals>
|
||||
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
|
||||
<EnableNonStopMode>false</EnableNonStopMode>
|
||||
<MaxBreakpointLimit>0</MaxBreakpointLimit>
|
||||
</AdditionalGDBSettings>
|
||||
<DebugMethod>
|
||||
<ID>com.sysprogs.arm.openocd</ID>
|
||||
<InterfaceID>stlink-v2-1</InterfaceID>
|
||||
<InterfaceSerialNumber>066EFF495056805087184715</InterfaceSerialNumber>
|
||||
<Configuration xsi:type="com.visualgdb.edp.openocd.settings">
|
||||
<CommandLine>-f interface/stlink-v2-1.cfg -f target/stm32l1.cfg -c init -c "reset init"</CommandLine>
|
||||
<ExtraParameters>
|
||||
<Frequency xsi:nil="true" />
|
||||
<BoostedFrequency xsi:nil="true" />
|
||||
<ConnectUnderReset>false</ConnectUnderReset>
|
||||
</ExtraParameters>
|
||||
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
|
||||
<ProgramMode>Enabled</ProgramMode>
|
||||
<StartupCommands>
|
||||
<string>set remotetimeout 60</string>
|
||||
<string>target remote :$$SYS:GDB_PORT$$</string>
|
||||
<string>mon halt</string>
|
||||
<string>mon reset init</string>
|
||||
<string>load</string>
|
||||
</StartupCommands>
|
||||
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
|
||||
<PreferredGDBPort>0</PreferredGDBPort>
|
||||
<PreferredTelnetPort>0</PreferredTelnetPort>
|
||||
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
|
||||
<SelectedCoreIndex xsi:nil="true" />
|
||||
</Configuration>
|
||||
</DebugMethod>
|
||||
<AutoDetectRTOS>true</AutoDetectRTOS>
|
||||
<SemihostingSupport>Auto</SemihostingSupport>
|
||||
<SemihostingPollingDelay>0</SemihostingPollingDelay>
|
||||
<StepIntoEntryPoint>false</StepIntoEntryPoint>
|
||||
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
|
||||
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
|
||||
<StopAtEntryPoint>false</StopAtEntryPoint>
|
||||
<EnableVirtualHalts>false</EnableVirtualHalts>
|
||||
<DynamicAnalysisSettings />
|
||||
<EndOfStackSymbol>_estack</EndOfStackSymbol>
|
||||
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
|
||||
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
|
||||
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
|
||||
</Debug>
|
||||
</VisualGDBProjectSettings2>
|
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0"?>
|
||||
<VisualGDBProjectSettings2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ConfigurationName>Spy</ConfigurationName>
|
||||
<Project xsi:type="com.visualgdb.project.embedded">
|
||||
<CustomSourceDirectories>
|
||||
<Directories />
|
||||
<PathStyle>MinGWUnixSlash</PathStyle>
|
||||
<LocalDirForAbsolutePaths>$(ToolchainDir)</LocalDirForAbsolutePaths>
|
||||
</CustomSourceDirectories>
|
||||
<MainSourceDirectory>$(ProjectDir)</MainSourceDirectory>
|
||||
<ExportAdvancedBuildVariables>false</ExportAdvancedBuildVariables>
|
||||
<EmbeddedProfileFile>stm32.xml</EmbeddedProfileFile>
|
||||
</Project>
|
||||
<Build xsi:type="com.visualgdb.build.msbuild">
|
||||
<ToolchainID>
|
||||
<Version>
|
||||
<Revision>0</Revision>
|
||||
</Version>
|
||||
</ToolchainID>
|
||||
<ProjectFile>dpp-qk.vcxproj</ProjectFile>
|
||||
<RemoteBuildEnvironment>
|
||||
<Records />
|
||||
</RemoteBuildEnvironment>
|
||||
<ParallelJobCount>1</ParallelJobCount>
|
||||
<SuppressDirectoryChangeMessages>true</SuppressDirectoryChangeMessages>
|
||||
</Build>
|
||||
<CustomBuild>
|
||||
<PreSyncActions />
|
||||
<PreBuildActions />
|
||||
<PostBuildActions />
|
||||
<PreCleanActions />
|
||||
<PostCleanActions />
|
||||
</CustomBuild>
|
||||
<CustomDebug>
|
||||
<PreDebugActions />
|
||||
<PostDebugActions />
|
||||
<DebugStopActions />
|
||||
<BreakMode>Default</BreakMode>
|
||||
</CustomDebug>
|
||||
<CustomShortcuts>
|
||||
<Shortcuts />
|
||||
<ShowMessageAfterExecuting>true</ShowMessageAfterExecuting>
|
||||
</CustomShortcuts>
|
||||
<UserDefinedVariables />
|
||||
<ImportedPropertySheets />
|
||||
<CodeSense>
|
||||
<Enabled>Unknown</Enabled>
|
||||
<ExtraSettings>
|
||||
<HideErrorsInSystemHeaders>true</HideErrorsInSystemHeaders>
|
||||
<SupportLightweightReferenceAnalysis>true</SupportLightweightReferenceAnalysis>
|
||||
<CheckForClangFormatFiles>true</CheckForClangFormatFiles>
|
||||
<FormattingEngine xsi:nil="true" />
|
||||
</ExtraSettings>
|
||||
<CodeAnalyzerSettings>
|
||||
<Enabled>false</Enabled>
|
||||
</CodeAnalyzerSettings>
|
||||
</CodeSense>
|
||||
<BuildContextDirectory>VisualGDB\VisualGDBCache</BuildContextDirectory>
|
||||
<Configurations />
|
||||
<ProgramArgumentsSuggestions />
|
||||
<Debug xsi:type="com.visualgdb.debug.embedded">
|
||||
<AdditionalStartupCommands />
|
||||
<AdditionalGDBSettings>
|
||||
<Features>
|
||||
<DisableAutoDetection>false</DisableAutoDetection>
|
||||
<UseFrameParameter>false</UseFrameParameter>
|
||||
<SimpleValuesFlagSupported>false</SimpleValuesFlagSupported>
|
||||
<ListLocalsSupported>false</ListLocalsSupported>
|
||||
<ByteLevelMemoryCommandsAvailable>false</ByteLevelMemoryCommandsAvailable>
|
||||
<ThreadInfoSupported>false</ThreadInfoSupported>
|
||||
<PendingBreakpointsSupported>false</PendingBreakpointsSupported>
|
||||
<SupportTargetCommand>false</SupportTargetCommand>
|
||||
<ReliableBreakpointNotifications>false</ReliableBreakpointNotifications>
|
||||
</Features>
|
||||
<EnableSmartStepping>false</EnableSmartStepping>
|
||||
<FilterSpuriousStoppedNotifications>false</FilterSpuriousStoppedNotifications>
|
||||
<ForceSingleThreadedMode>false</ForceSingleThreadedMode>
|
||||
<UseAppleExtensions>false</UseAppleExtensions>
|
||||
<CanAcceptCommandsWhileRunning>false</CanAcceptCommandsWhileRunning>
|
||||
<MakeLogFile>false</MakeLogFile>
|
||||
<IgnoreModuleEventsWhileStepping>true</IgnoreModuleEventsWhileStepping>
|
||||
<UseRelativePathsOnly>false</UseRelativePathsOnly>
|
||||
<ExitAction>None</ExitAction>
|
||||
<DisableDisassembly>false</DisableDisassembly>
|
||||
<ExamineMemoryWithXCommand>false</ExamineMemoryWithXCommand>
|
||||
<StepIntoNewInstanceEntry>main</StepIntoNewInstanceEntry>
|
||||
<ExamineRegistersInRawFormat>true</ExamineRegistersInRawFormat>
|
||||
<DisableSignals>false</DisableSignals>
|
||||
<EnableAsyncExecutionMode>false</EnableAsyncExecutionMode>
|
||||
<EnableNonStopMode>false</EnableNonStopMode>
|
||||
<MaxBreakpointLimit>0</MaxBreakpointLimit>
|
||||
</AdditionalGDBSettings>
|
||||
<DebugMethod>
|
||||
<ID>com.sysprogs.arm.openocd</ID>
|
||||
<InterfaceID>stlink-v2-1</InterfaceID>
|
||||
<InterfaceSerialNumber>066EFF495056805087184715</InterfaceSerialNumber>
|
||||
<Configuration xsi:type="com.visualgdb.edp.openocd.settings">
|
||||
<CommandLine>-f interface/stlink-v2-1.cfg -f target/stm32l1.cfg -c init -c "reset init"</CommandLine>
|
||||
<ExtraParameters>
|
||||
<Frequency xsi:nil="true" />
|
||||
<BoostedFrequency xsi:nil="true" />
|
||||
<ConnectUnderReset>false</ConnectUnderReset>
|
||||
</ExtraParameters>
|
||||
<LoadProgressGUIThreshold>131072</LoadProgressGUIThreshold>
|
||||
<ProgramMode>Enabled</ProgramMode>
|
||||
<StartupCommands>
|
||||
<string>set remotetimeout 60</string>
|
||||
<string>target remote :$$SYS:GDB_PORT$$</string>
|
||||
<string>mon halt</string>
|
||||
<string>mon reset init</string>
|
||||
<string>load</string>
|
||||
</StartupCommands>
|
||||
<ProgramFLASHUsingExternalTool>false</ProgramFLASHUsingExternalTool>
|
||||
<PreferredGDBPort>0</PreferredGDBPort>
|
||||
<PreferredTelnetPort>0</PreferredTelnetPort>
|
||||
<AlwaysPassSerialNumber>false</AlwaysPassSerialNumber>
|
||||
<SelectedCoreIndex xsi:nil="true" />
|
||||
</Configuration>
|
||||
</DebugMethod>
|
||||
<AutoDetectRTOS>true</AutoDetectRTOS>
|
||||
<SemihostingSupport>Auto</SemihostingSupport>
|
||||
<SemihostingPollingDelay>0</SemihostingPollingDelay>
|
||||
<StepIntoEntryPoint>false</StepIntoEntryPoint>
|
||||
<ReloadFirmwareOnReset>false</ReloadFirmwareOnReset>
|
||||
<ValidateEndOfStackAddress>true</ValidateEndOfStackAddress>
|
||||
<StopAtEntryPoint>false</StopAtEntryPoint>
|
||||
<EnableVirtualHalts>false</EnableVirtualHalts>
|
||||
<DynamicAnalysisSettings />
|
||||
<EndOfStackSymbol>_estack</EndOfStackSymbol>
|
||||
<TimestampProviderTicksPerSecond>0</TimestampProviderTicksPerSecond>
|
||||
<KeepConsoleAfterExit>false</KeepConsoleAfterExit>
|
||||
<CheckInterfaceDrivers>true</CheckInterfaceDrivers>
|
||||
</Debug>
|
||||
</VisualGDBProjectSettings2>
|
139
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/dpp-qk.ld
Normal file
139
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/dpp-qk.ld
Normal file
@ -0,0 +1,139 @@
|
||||
/*****************************************************************************
|
||||
* Product: Linker script for for STM32L152RET6, GNU-ARM linker
|
||||
* Last Updated for Version: 5.9.8
|
||||
* Date of the Last Update: 2017-09-13
|
||||
*
|
||||
* Q u a n t u m L e a P s
|
||||
* ---------------------------
|
||||
* innovating embedded systems
|
||||
*
|
||||
* 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
|
||||
* 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:
|
||||
* https://state-machine.com
|
||||
* mailto:info@state-machine.com
|
||||
*****************************************************************************/
|
||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
|
||||
OUTPUT_ARCH(arm)
|
||||
ENTRY(Reset_Handler) /* entry Point */
|
||||
|
||||
MEMORY { /* memory map of STM32L152RET6 */
|
||||
ROM (rx) : ORIGIN = 0x08000000, LENGTH = 512K
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 80K
|
||||
}
|
||||
|
||||
/* The size of the stack used by the application. NOTE: you need to adjust */
|
||||
STACK_SIZE = 1024;
|
||||
|
||||
/* The size of the heap used by the application. NOTE: you need to adjust */
|
||||
HEAP_SIZE = 0;
|
||||
|
||||
SECTIONS {
|
||||
|
||||
.isr_vector : { /* the vector table goes FIRST into ROM */
|
||||
KEEP(*(.isr_vector)) /* vector table */
|
||||
. = ALIGN(4);
|
||||
} >ROM
|
||||
|
||||
.text : { /* code and constants */
|
||||
. = ALIGN(4);
|
||||
*(.text) /* .text sections (code) */
|
||||
*(.text*) /* .text* sections (code) */
|
||||
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||
|
||||
KEEP (*(.init))
|
||||
KEEP (*(.fini))
|
||||
|
||||
. = ALIGN(4);
|
||||
} >ROM
|
||||
|
||||
.preinit_array : {
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP (*(.preinit_array*))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
} >ROM
|
||||
|
||||
.init_array : {
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array*))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
} >ROM
|
||||
|
||||
.fini_array : {
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(.fini_array*))
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
} >ROM
|
||||
|
||||
_etext = .; /* global symbols at end of code */
|
||||
|
||||
.stack : {
|
||||
__stack_start__ = .;
|
||||
. = . + STACK_SIZE;
|
||||
. = ALIGN(4);
|
||||
__stack_end__ = .;
|
||||
} >RAM
|
||||
|
||||
.data : AT (_etext) {
|
||||
__data_load = LOADADDR (.data);
|
||||
__data_start = .;
|
||||
*(.data) /* .data sections */
|
||||
*(.data*) /* .data* sections */
|
||||
. = ALIGN(4);
|
||||
__data_end__ = .;
|
||||
_edata = __data_end__;
|
||||
} >RAM
|
||||
|
||||
.bss : {
|
||||
__bss_start__ = .;
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
_ebss = .; /* define a global symbol at bss end */
|
||||
__bss_end__ = .;
|
||||
} >RAM
|
||||
|
||||
__exidx_start = .;
|
||||
.ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } >RAM
|
||||
__exidx_end = .;
|
||||
|
||||
PROVIDE ( end = _ebss );
|
||||
PROVIDE ( _end = _ebss );
|
||||
PROVIDE ( __end__ = _ebss );
|
||||
|
||||
.heap : {
|
||||
__heap_start__ = .;
|
||||
. = . + HEAP_SIZE;
|
||||
. = ALIGN(4);
|
||||
__heap_end__ = .;
|
||||
} >RAM
|
||||
|
||||
/* Remove information from the standard libraries */
|
||||
/DISCARD/ : {
|
||||
libc.a ( * )
|
||||
libm.a ( * )
|
||||
libgcc.a ( * )
|
||||
}
|
||||
}
|
28
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/dpp-qk.sln
Normal file
28
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/dpp-qk.sln
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30517.126
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dpp-qk", "dpp-qk.vcxproj", "{33464F24-9B0F-4276-89FF-8D462C1392EE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|VisualGDB = Debug|VisualGDB
|
||||
Release|VisualGDB = Release|VisualGDB
|
||||
Spy|VisualGDB = Spy|VisualGDB
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{33464F24-9B0F-4276-89FF-8D462C1392EE}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
|
||||
{33464F24-9B0F-4276-89FF-8D462C1392EE}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
|
||||
{33464F24-9B0F-4276-89FF-8D462C1392EE}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
|
||||
{33464F24-9B0F-4276-89FF-8D462C1392EE}.Release|VisualGDB.Build.0 = Release|VisualGDB
|
||||
{33464F24-9B0F-4276-89FF-8D462C1392EE}.Spy|VisualGDB.ActiveCfg = Spy|VisualGDB
|
||||
{33464F24-9B0F-4276-89FF-8D462C1392EE}.Spy|VisualGDB.Build.0 = Spy|VisualGDB
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {35222B4D-B267-427E-8293-873EDD0720C0}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
148
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/dpp-qk.vcxproj
Normal file
148
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/dpp-qk.vcxproj
Normal file
@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|VisualGDB">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>VisualGDB</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|VisualGDB">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>VisualGDB</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Spy|VisualGDB">
|
||||
<Configuration>Spy</Configuration>
|
||||
<Platform>VisualGDB</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{33464F24-9B0F-4276-89FF-8D462C1392EE}</ProjectGuid>
|
||||
<BSP_ID>com.sysprogs.arm.stm32</BSP_ID>
|
||||
<BSP_VERSION>2020.06</BSP_VERSION>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|VisualGDB'">
|
||||
<MCUPropertyListFile>$(ProjectDir)stm32.props</MCUPropertyListFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Spy|VisualGDB'" Label="Configuration">
|
||||
<MCUPropertyListFile>$(ProjectDir)stm32.props</MCUPropertyListFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|VisualGDB'">
|
||||
<MCUPropertyListFile>$(ProjectDir)stm32.props</MCUPropertyListFile>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|VisualGDB'">
|
||||
<GNUConfigurationType>Debug</GNUConfigurationType>
|
||||
<ToolchainID>d883dc4a-545e-4d48-bba0-41645b13fd69</ToolchainID>
|
||||
<ToolchainVersion>9.3.1/(GNU/r0</ToolchainVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Spy|VisualGDB'">
|
||||
<GNUConfigurationType>Debug</GNUConfigurationType>
|
||||
<ToolchainID>d883dc4a-545e-4d48-bba0-41645b13fd69</ToolchainID>
|
||||
<ToolchainVersion>9.3.1/(GNU/r0</ToolchainVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|VisualGDB'">
|
||||
<ToolchainID>d883dc4a-545e-4d48-bba0-41645b13fd69</ToolchainID>
|
||||
<ToolchainVersion>9.3.1/(GNU/r0</ToolchainVersion>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|VisualGDB'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..;../..;../../../../../include;../../../../../src;../../../../../ports/arm-cm/qk/gnu;../../../../../3rd_party/CMSIS/Include;../../../../../3rd_party/nucleo-l152re;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DEBUG=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLinkerInputs>;%(Link.AdditionalLinkerInputs)</AdditionalLinkerInputs>
|
||||
<LibrarySearchDirectories>;%(Link.LibrarySearchDirectories)</LibrarySearchDirectories>
|
||||
<AdditionalLibraryNames>;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<LinkerScript>dpp-qk.ld</LinkerScript>
|
||||
<AdditionalOptions>-specs=nosys.specs -specs=nano.specs %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Spy|VisualGDB'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..;../..;../../../../../include;../../../../../src;../../../../../ports/arm-cm/qk/gnu;../../../../../3rd_party/CMSIS/Include;../../../../../3rd_party/nucleo-l152re;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DEBUG=1;Q_SPY;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization>O3</Optimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLinkerInputs>;%(Link.AdditionalLinkerInputs)</AdditionalLinkerInputs>
|
||||
<LibrarySearchDirectories>;%(Link.LibrarySearchDirectories)</LibrarySearchDirectories>
|
||||
<AdditionalLibraryNames>;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<LinkerScript>dpp-qk.ld</LinkerScript>
|
||||
<AdditionalOptions>-specs=nosys.specs -specs=nano.specs %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|VisualGDB'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..;../..;../../../../../include;../../../../../src;../../../../../ports/arm-cm/qk/gnu;../../../../../3rd_party/CMSIS/Include;../../../../../3rd_party/nucleo-l152re;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLinkerInputs>;%(Link.AdditionalLinkerInputs)</AdditionalLinkerInputs>
|
||||
<LibrarySearchDirectories>;%(Link.LibrarySearchDirectories)</LibrarySearchDirectories>
|
||||
<AdditionalLibraryNames>;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<LinkerScript>dpp-qk.ld</LinkerScript>
|
||||
<AdditionalOptions>-specs=nosys.specs -specs=nano.specs %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\..\..\3rd_party\nucleo-l152re\gnu\startup_stm32l1xx.c" />
|
||||
<ClCompile Include="..\..\..\..\..\3rd_party\nucleo-l152re\system_stm32l1xx.c" />
|
||||
<ClCompile Include="..\..\..\..\..\include\qstamp.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qk_port.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qep_hsm.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qep_msm.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_act.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_actq.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_defer.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_dyn.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_mem.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_ps.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_qact.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_qeq.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_qmact.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_time.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qk\qk.cpp" />
|
||||
<ClCompile Include="..\..\..\..\..\src\qs\qs.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|VisualGDB'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|VisualGDB'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qs\qs_fp.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|VisualGDB'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|VisualGDB'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qs\qs_rx.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|VisualGDB'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|VisualGDB'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\philo.cpp" />
|
||||
<ClCompile Include="..\..\table.cpp" />
|
||||
<ClCompile Include="..\bsp.cpp" />
|
||||
<ClCompile Include="..\main.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="stm32.props" />
|
||||
<None Include="dpp-qk-Debug.vgdbsettings" />
|
||||
<None Include="dpp-qk-Release.vgdbsettings" />
|
||||
<None Include="stm32.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qep_port.hpp" />
|
||||
<ClInclude Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qf_port.hpp" />
|
||||
<ClInclude Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qk_port.hpp" />
|
||||
<ClInclude Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qs_port.hpp" />
|
||||
<ClInclude Include="..\..\bsp.hpp" />
|
||||
<ClInclude Include="..\..\dpp.hpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\README.txt" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source files">
|
||||
<UniqueIdentifier>{c6017ab7-6299-4b81-acee-c1763a48750d}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="VisualGDB settings">
|
||||
<UniqueIdentifier>{c919b77d-bd4e-42dd-90aa-1ccb1597d180}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="nucleo-l152re">
|
||||
<UniqueIdentifier>{d32a0836-a71c-48cd-a0dc-003d1237eae2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="QS">
|
||||
<UniqueIdentifier>{546cf9df-d280-46a0-8461-b51c82a3baa5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="QP-port">
|
||||
<UniqueIdentifier>{0d86c7f6-a92e-4327-835c-5bbf87534465}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="QP">
|
||||
<UniqueIdentifier>{3c579ef5-dace-45b5-8c74-75413c8bb3b6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="stm32.props">
|
||||
<Filter>nucleo-l152re</Filter>
|
||||
</None>
|
||||
<None Include="dpp-qk-Debug.vgdbsettings">
|
||||
<Filter>VisualGDB settings</Filter>
|
||||
</None>
|
||||
<None Include="dpp-qk-Release.vgdbsettings">
|
||||
<Filter>VisualGDB settings</Filter>
|
||||
</None>
|
||||
<None Include="stm32.xml">
|
||||
<Filter>VisualGDB settings</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\..\..\3rd_party\nucleo-l152re\system_stm32l1xx.c">
|
||||
<Filter>nucleo-l152re</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\3rd_party\nucleo-l152re\gnu\startup_stm32l1xx.c">
|
||||
<Filter>nucleo-l152re</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qep_hsm.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qep_msm.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_act.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_actq.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_defer.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_dyn.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_mem.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_ps.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_qact.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_qeq.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_qmact.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qf\qf_time.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qk_port.cpp">
|
||||
<Filter>QP-port</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qs\qs.cpp">
|
||||
<Filter>QS</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qs\qs_fp.cpp">
|
||||
<Filter>QS</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qs\qs_rx.cpp">
|
||||
<Filter>QS</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\philo.cpp">
|
||||
<Filter>Source files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\table.cpp">
|
||||
<Filter>Source files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\bsp.cpp">
|
||||
<Filter>Source files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<Filter>Source files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\include\qstamp.cpp">
|
||||
<Filter>Source files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\src\qk\qk.cpp">
|
||||
<Filter>QP</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qep_port.hpp">
|
||||
<Filter>QP-port</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qf_port.hpp">
|
||||
<Filter>QP-port</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qk_port.hpp">
|
||||
<Filter>QP-port</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\..\ports\arm-cm\qk\gnu\qs_port.hpp">
|
||||
<Filter>QP-port</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\bsp.hpp">
|
||||
<Filter>Source files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\dpp.hpp">
|
||||
<Filter>Source files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\README.txt">
|
||||
<Filter>Source files</Filter>
|
||||
</Text>
|
||||
</ItemGroup>
|
||||
</Project>
|
31
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/stm32.props
Normal file
31
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/stm32.props
Normal file
@ -0,0 +1,31 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!--
|
||||
This file is generated by VisualGDB.
|
||||
It contains GCC settings automatically derived from the board support package (BSP).
|
||||
DO NOT EDIT MANUALLY. THE FILE WILL BE OVERWRITTEN.
|
||||
Use VisualGDB Project Properties dialog or modify Makefile or per-configuration .mak files instead.
|
||||
-->
|
||||
|
||||
<!-- In order to build this project manually (outside VisualGDB), please provide TOOLCHAIN_ROOT, BSP_ROOT, EFP_BASE and TESTFW_BASE variables via Environment or Make command line -->
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>ARM_MATH_CM3;flash_layout;STM32L152RE;STM32L152xE;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>%(ClCompile.AdditionalIncludeDirectories);$(ProjectDir);$(BSP_ROOT)/STM32L1xxxx/STM32L1xx_HAL_Driver/Inc;$(BSP_ROOT)/STM32L1xxxx/STM32L1xx_HAL_Driver/Inc/Legacy;$(BSP_ROOT)/STM32L1xxxx/CMSIS_HAL/Device/ST/STM32L1xx/Include;$(BSP_ROOT)/STM32L1xxxx/CMSIS_HAL/Core/Include;$(BSP_ROOT)/STM32L1xxxx/CMSIS_HAL/Include</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<Link>
|
||||
<LinkerScript Condition="'%(Link.LinkerScript)' == ''">$(BSP_ROOT)/STM32L1xxxx/LinkerScripts/STM32L152RE_flash.lds</LinkerScript>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<PropertyGroup>
|
||||
<DefaultLinkerScript>$(BSP_ROOT)/STM32L1xxxx/LinkerScripts/STM32L152RE_flash.lds</DefaultLinkerScript>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<ToolchainSettingsContainer>
|
||||
<ARMCPU Condition="'%(ToolchainSettingsContainer.ARMCPU)' == ''">cortex-m3</ARMCPU>
|
||||
<InstructionSet Condition="'%(ToolchainSettingsContainer.InstructionSet)' == ''">THUMB</InstructionSet>
|
||||
</ToolchainSettingsContainer>
|
||||
</ItemDefinitionGroup>
|
||||
</Project>
|
39
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/stm32.xml
Normal file
39
examples/arm-cm/dpp_nucleo-l152re/qk/visualgdb/stm32.xml
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0"?>
|
||||
<EmbeddedProfile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<ToolchainID>d883dc4a-545e-4d48-bba0-41645b13fd69</ToolchainID>
|
||||
<ToolchainVersion>
|
||||
<GCC>9.3.1</GCC>
|
||||
<GDB>(GNU</GDB>
|
||||
<Revision>0</Revision>
|
||||
</ToolchainVersion>
|
||||
<BspID>com.sysprogs.arm.stm32</BspID>
|
||||
<BspVersion>2020.06</BspVersion>
|
||||
<McuID>STM32L152RE</McuID>
|
||||
<MCUDefinitionFile>STM32L1xxxx/DeviceDefinitions/stm32l152xe.xml</MCUDefinitionFile>
|
||||
<MCUProperties>
|
||||
<Entries>
|
||||
<KeyValue>
|
||||
<Key>com.sysprogs.bspoptions.primary_memory</Key>
|
||||
<Value>flash</Value>
|
||||
</KeyValue>
|
||||
<KeyValue>
|
||||
<Key>com.sysprogs.mcuoptions.ignore_startup_file</Key>
|
||||
</KeyValue>
|
||||
</Entries>
|
||||
</MCUProperties>
|
||||
<BSPSourceFolderName>Device-specific files</BSPSourceFolderName>
|
||||
<MCUMakFile>stm32.mak</MCUMakFile>
|
||||
<ReferencedFrameworks>
|
||||
<string>com.sysprogs.arm.stm32.ll</string>
|
||||
</ReferencedFrameworks>
|
||||
<FrameworkProperties>
|
||||
<Entries>
|
||||
<KeyValue>
|
||||
<Key>com.sysprogs.bspoptions.stm32.ll_driver</Key>
|
||||
</KeyValue>
|
||||
</Entries>
|
||||
</FrameworkProperties>
|
||||
<TestFrameworkProperties>
|
||||
<Entries />
|
||||
</TestFrameworkProperties>
|
||||
</EmbeddedProfile>
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32 NUCLEO-L152RE board, cooperative QV kernel
|
||||
// Last Updated for Version: 6.9.0
|
||||
// Date of the Last Update: 2020-08-14
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -168,8 +168,9 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_ALL_RECORDS);
|
||||
QS_FILTER_OFF(QS_QF_TICK);
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -180,7 +181,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOA->BSRRH |= LED_LD2; // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32 NUCLEO-L152RE board, preemptive QXK kernel
|
||||
// Last Updated for Version: 6.9.0
|
||||
// Date of the Last Update: 2020-08-14
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -178,8 +178,9 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_ALL_RECORDS);
|
||||
QS_FILTER_OFF(QS_QF_TICK);
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -190,7 +191,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIOA->BSRRH |= LED_LD2; // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32F4-Discovery board, preemptive QK kernel
|
||||
// Last Updated for Version: 6.5.0
|
||||
// Date of the Last Update: 2019-05-09
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -225,6 +225,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_SysTick);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -243,7 +248,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
LED_GPIO_PORT->BSRRH = LED5_PIN; // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -419,11 +424,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS); // state machine records
|
||||
QS_FILTER_ON(QS_AO_RECORDS); // active object records
|
||||
QS_FILTER_ON(QS_UA_RECORDS); // all user records
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -470,8 +470,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32F4-Discovery board, cooperative QV kernel
|
||||
// Last Updated for Version: 6.5.0
|
||||
// Date of the Last Update: 2019-05-09
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -221,6 +221,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_SysTick);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -239,7 +244,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
LED_GPIO_PORT->BSRRH = LED5_PIN; // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -414,11 +419,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS); // state machine records
|
||||
QS_FILTER_ON(QS_AO_RECORDS); // active object records
|
||||
QS_FILTER_ON(QS_UA_RECORDS); // all user records
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -465,8 +465,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32F4-Discovery board, dual-mode QXK kernel
|
||||
// Last Updated for Version: 6.5.0
|
||||
// Date of the Last Update: 2019-05-09
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -225,6 +225,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_SysTick);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -243,7 +248,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
LED_GPIO_PORT->BSRRH = LED5_PIN; // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -426,11 +431,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS); // state machine records
|
||||
QS_FILTER_ON(QS_AO_RECORDS); // active object records
|
||||
QS_FILTER_ON(QS_UA_RECORDS); // all user records
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -477,8 +477,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -1,4 +1,4 @@
|
||||
SET PATH=C:\tools\Keil_v5\ARM\ARMCLANG\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Java\jre1.8.0_241\bin;C:\utils;C:\tools\python38-32\Scripts;C:\tools\Git\cmd;C:\tools\LLVM\bin;C:\qp\qtools\bin;C:\qp\qtools\mingw32\bin
|
||||
SET PATH=C:\tools\Keil_v5\ARM\ARMCLANG\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Java\jre1.8.0_241\bin;C:\utils;C:\tools\python38-32\Scripts;C:\tools\Git\cmd;C:\tools\LLVM\bin;C:\qp\qtools\bin;C:\qp\qtools\mingw32\bin
|
||||
SET CPU_TYPE=STM32F746NGHx
|
||||
SET CPU_VENDOR=STMicroelectronics
|
||||
SET UV2_TARGET=dpp-spy
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32746G-Discovery board, preemptive QK kernel
|
||||
// Last Updated for Version: 6.0.4
|
||||
// Date of the Last Update: 2018-01-09
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -45,27 +45,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART1_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
static uint32_t l_rnd; // random seed
|
||||
|
||||
@ -219,6 +198,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP::ledOn(void) {
|
||||
@ -237,7 +221,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
BSP_LED_Off(LED1);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -286,24 +270,21 @@ namespace QP {
|
||||
|
||||
// QF callbacks ==============================================================
|
||||
void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set up the SysTick timer to fire at BSP::TICKS_PER_SEC rate
|
||||
SysTick_Config(SystemCoreClock / DPP::BSP::TICKS_PER_SEC);
|
||||
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART1_IRQn, DPP::USART1_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
//NVIC_SetPriority(GPIO_EVEN_IRQn, DPP::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART1_IRQn, 0U); // kerel unaware interrupt
|
||||
//NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -402,10 +383,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -452,8 +429,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32746G-Discovery board, cooperative QV kernel
|
||||
// Last Updated for Version: 6.0.4
|
||||
// Date of the Last Update: 2018-01-09
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -45,27 +45,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART1_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
static uint32_t l_rnd; // random seed
|
||||
|
||||
@ -197,6 +176,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP::ledOn(void) {
|
||||
@ -215,7 +199,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
BSP_LED_Off(LED1);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -261,24 +245,21 @@ namespace QP {
|
||||
|
||||
// QF callbacks ==============================================================
|
||||
void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set up the SysTick timer to fire at BSP::TICKS_PER_SEC rate
|
||||
SysTick_Config(SystemCoreClock / DPP::BSP::TICKS_PER_SEC);
|
||||
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART1_IRQn, DPP::USART1_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
//NVIC_SetPriority(GPIO_EVEN_IRQn, DPP::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART1_IRQn, 0U); // kernel unaware interrupt
|
||||
//NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -379,10 +360,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -429,8 +406,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
@ -446,7 +422,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
} // namespace QP
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -464,7 +440,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// by which a "QF-unaware" ISR can communicate with the QF framework is by
|
||||
// triggering a "QF-aware" ISR, which can post/publish events.
|
||||
//
|
||||
// NOTE01:
|
||||
// NOTE2:
|
||||
// The User LED is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32746G-Discovery board, dual-mode QXK kernel
|
||||
// Last Updated for Version: 6.0.4
|
||||
// Date of the Last Update: 2018-01-09
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -45,27 +45,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART1_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
static uint32_t l_rnd; // random seed
|
||||
|
||||
@ -219,6 +198,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP::ledOn(void) {
|
||||
@ -237,7 +221,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
BSP_LED_Off(LED1);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -285,24 +269,21 @@ namespace QP {
|
||||
|
||||
// QF callbacks ==============================================================
|
||||
void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set up the SysTick timer to fire at BSP::TICKS_PER_SEC rate
|
||||
SysTick_Config(SystemCoreClock / DPP::BSP::TICKS_PER_SEC);
|
||||
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART1_IRQn, DPP::USART1_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
//NVIC_SetPriority(GPIO_EVEN_IRQn, DPP::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART1_IRQn, 0U); // kernel unaware interrupt
|
||||
//NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -401,10 +382,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -451,8 +428,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, reinterpret_cast<void *>(1))
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
@ -468,7 +444,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
} // namespace QP
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -486,7 +462,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// by which a "QF-unaware" ISR can communicate with the QF framework is by
|
||||
// triggering a "QF-aware" ISR, which can post/publish events.
|
||||
//
|
||||
// NOTE01:
|
||||
// NOTE2:
|
||||
// The User LED is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::game.hpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.0 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<model version="5.0.0" links="1">
|
||||
<model version="5.0.4" links="1">
|
||||
<documentation>"Fly 'n' Shoot" game model from Chapters 1 & 9 of PSiCC2
|
||||
|
||||
NOTE: Requries QP6.</documentation>
|
||||
@ -177,7 +177,7 @@ if ((m_last_mine_x + GAME_MINES_DIST_MIN < GAME_TUNNEL_WIDTH)
|
||||
ope.sig = MINE_PLANT_SIG;
|
||||
ope.x = m_last_mine_x;
|
||||
ope.y = m_last_mine_y;
|
||||
m_mines[n]->dispatch(&ope); // direct dispatch
|
||||
m_mines[n]->dispatch(&ope, m_prio); // direct dispatch
|
||||
}
|
||||
}</code>
|
||||
</operation>
|
||||
@ -187,7 +187,7 @@ if ((m_last_mine_x + GAME_MINES_DIST_MIN < GAME_TUNNEL_WIDTH)
|
||||
<parameter name="e" type="QP::QEvt const *"/>
|
||||
<code>for (uint8_t n = 0U; n < GAME_MINES_MAX; ++n) {
|
||||
if (m_mines[n] != nullptr) { // is the mine used?
|
||||
m_mines[n]->dispatch(e);
|
||||
m_mines[n]->dispatch(e, m_prio);
|
||||
}
|
||||
}</code>
|
||||
</operation>
|
||||
@ -196,8 +196,8 @@ if ((m_last_mine_x + GAME_MINES_DIST_MIN < GAME_TUNNEL_WIDTH)
|
||||
<!--${AOs::Tunnel::SM::initial}-->
|
||||
<initial target="../1/2">
|
||||
<action>for (uint8_t n = 0; n < GAME_MINES_MAX; ++n) {
|
||||
m_mine1_pool[n]->init(); // take the initial tran. for Mine1
|
||||
m_mine2_pool[n]->init(); // take the initial tran. for Mine2
|
||||
m_mine1_pool[n]->init(m_prio); // take the initial tran. for Mine1
|
||||
m_mine2_pool[n]->init(m_prio); // take the initial tran. for Mine2
|
||||
}
|
||||
|
||||
BSP_randomSeed(1234U); // seed the pseudo-random generator
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::mine1.cpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.0 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
@ -70,8 +70,8 @@ static inline uint8_t MINE_ID(Mine1 const * const me) {
|
||||
// Mine1 class definition ----------------------------------------------------
|
||||
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
//. Check for the minimum required QP version
|
||||
#if (QP_VERSION < 670U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.7.0 or higher required
|
||||
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.8.0 or higher required
|
||||
#endif
|
||||
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
//.$define${AOs::Mine1} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
@ -108,10 +108,10 @@ Q_STATE_DEF(Mine1, initial) {
|
||||
|
||||
(void)e; // unused parameter
|
||||
|
||||
QS_FUN_DICTIONARY(&unused);
|
||||
QS_FUN_DICTIONARY(&used);
|
||||
QS_FUN_DICTIONARY(&exploding);
|
||||
QS_FUN_DICTIONARY(&planted);
|
||||
QS_FUN_DICTIONARY(&Mine1::unused);
|
||||
QS_FUN_DICTIONARY(&Mine1::used);
|
||||
QS_FUN_DICTIONARY(&Mine1::exploding);
|
||||
QS_FUN_DICTIONARY(&Mine1::planted);
|
||||
|
||||
return tran(&unused);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::mine2.cpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.0 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
@ -70,8 +70,8 @@ static inline uint8_t MINE_ID(Mine2 const * const me) {
|
||||
// Mine1 class definition ----------------------------------------------------
|
||||
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
//. Check for the minimum required QP version
|
||||
#if (QP_VERSION < 670U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.7.0 or higher required
|
||||
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.8.0 or higher required
|
||||
#endif
|
||||
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
//.$define${AOs::Mine2} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
@ -107,10 +107,10 @@ Q_STATE_DEF(Mine2, initial) {
|
||||
|
||||
(void)e; // unused parameter
|
||||
|
||||
QS_FUN_DICTIONARY(&unused);
|
||||
QS_FUN_DICTIONARY(&used);
|
||||
QS_FUN_DICTIONARY(&exploding);
|
||||
QS_FUN_DICTIONARY(&planted);
|
||||
QS_FUN_DICTIONARY(&Mine2::unused);
|
||||
QS_FUN_DICTIONARY(&Mine2::used);
|
||||
QS_FUN_DICTIONARY(&Mine2::exploding);
|
||||
QS_FUN_DICTIONARY(&Mine2::planted);
|
||||
|
||||
return tran(&unused);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::missile.cpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.0 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
@ -55,8 +55,8 @@ static Missile l_missile; // the sole instance of the Missile active object
|
||||
// Public-scope objects ------------------------------------------------------
|
||||
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
//. Check for the minimum required QP version
|
||||
#if (QP_VERSION < 670U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.7.0 or higher required
|
||||
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.8.0 or higher required
|
||||
#endif
|
||||
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
//.$define${AOs::AO_Missile} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
@ -92,9 +92,9 @@ Q_STATE_DEF(Missile, initial) {
|
||||
|
||||
(void)e; // unused parameter
|
||||
|
||||
QS_FUN_DICTIONARY(&armed);
|
||||
QS_FUN_DICTIONARY(&flying);
|
||||
QS_FUN_DICTIONARY(&exploding);
|
||||
QS_FUN_DICTIONARY(&Missile::armed);
|
||||
QS_FUN_DICTIONARY(&Missile::flying);
|
||||
QS_FUN_DICTIONARY(&Missile::exploding);
|
||||
|
||||
return tran(&armed);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
<TargetName>game-dbg</TargetName>
|
||||
<ToolsetNumber>0x4</ToolsetNumber>
|
||||
<ToolsetName>ARM-ADS</ToolsetName>
|
||||
<pCCUsed>5060528::V5.06 update 5 (build 528)::ARMCC</pCCUsed>
|
||||
<pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
|
||||
<uAC6>1</uAC6>
|
||||
<TargetOption>
|
||||
<TargetCommonOption>
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: "Fly 'n' Shoot" game example, EFM32-SLSTK3401A board, QK kernel
|
||||
// Last Updated for Version: 5.9.7
|
||||
// Date of the Last Update: 2017-08-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -47,27 +47,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace GAME ************************************************************
|
||||
namespace GAME {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART0_RX_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_PORT gpioPortF
|
||||
#define LED0_PIN 4
|
||||
@ -246,6 +225,11 @@ void BSP_init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//..........................................................................*/
|
||||
void BSP_updateScreen(void) {
|
||||
@ -713,15 +697,15 @@ void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART0_RX_IRQn, GAME::USART0_RX_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, GAME::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, GAME::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART0_RX_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -847,20 +831,6 @@ bool QS::onStartup(void const *arg) {
|
||||
GAME::QS_tickPeriod_ = SystemCoreClock / GAME::BSP_TICKS_PER_SEC;
|
||||
GAME::QS_tickTime_ = GAME::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(GAME::PHILO_STAT);
|
||||
QS_FILTER_ON(GAME::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -907,8 +877,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(GAME::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(GAME::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
@ -924,7 +893,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
} // namespace QP
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -942,7 +911,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// by which a "QF-unaware" ISR can communicate with the QF framework is by
|
||||
// triggering a "QF-aware" ISR, which can post/publish events.
|
||||
//
|
||||
// NOTE01:
|
||||
// NOTE2:
|
||||
// The User LED is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: "Fly 'n' Shoot" game example, EFM32-SLSTK3401A board, QV kernel
|
||||
// Last Updated for Version: 5.9.5
|
||||
// Date of the Last Update: 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -47,27 +47,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace GAME ************************************************************
|
||||
namespace GAME {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART0_RX_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_PORT gpioPortF
|
||||
#define LED0_PIN 4
|
||||
@ -223,6 +202,11 @@ void BSP_init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//..........................................................................*/
|
||||
void BSP_updateScreen(void) {
|
||||
@ -687,15 +671,15 @@ void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART0_RX_IRQn, GAME::USART0_RX_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, GAME::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, GAME::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART0_RX_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -822,20 +806,6 @@ bool QS::onStartup(void const *arg) {
|
||||
GAME::QS_tickPeriod_ = SystemCoreClock / GAME::BSP_TICKS_PER_SEC;
|
||||
GAME::QS_tickTime_ = GAME::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(GAME::PHILO_STAT);
|
||||
QS_FILTER_ON(GAME::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -882,8 +852,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(GAME::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(GAME::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
@ -899,7 +868,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
} // namespace QP
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -923,7 +892,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// an event. QV::onIdle() must internally enable interrupts, ideally
|
||||
// atomically with putting the CPU to the power-saving mode.
|
||||
//
|
||||
// NOTE02:
|
||||
// NOTE2:
|
||||
// The User LED is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::ship.cpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.0 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
@ -61,8 +61,8 @@ static Ship l_ship; // the sole instance of the Ship active object
|
||||
// Public-scope objects ------------------------------------------------------
|
||||
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
//. Check for the minimum required QP version
|
||||
#if (QP_VERSION < 670U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.7.0 or higher required
|
||||
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.8.0 or higher required
|
||||
#endif
|
||||
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
//.$define${AOs::AO_Ship} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
@ -103,10 +103,10 @@ Q_STATE_DEF(Ship, initial) {
|
||||
|
||||
(void)e; // unused parameter
|
||||
|
||||
QS_FUN_DICTIONARY(&active);
|
||||
QS_FUN_DICTIONARY(&parked);
|
||||
QS_FUN_DICTIONARY(&flying);
|
||||
QS_FUN_DICTIONARY(&exploding);
|
||||
QS_FUN_DICTIONARY(&Ship::active);
|
||||
QS_FUN_DICTIONARY(&Ship::parked);
|
||||
QS_FUN_DICTIONARY(&Ship::flying);
|
||||
QS_FUN_DICTIONARY(&Ship::exploding);
|
||||
|
||||
return tran(&active);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::tunnel.cpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.0 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
@ -76,8 +76,8 @@ static Tunnel l_tunnel; // the sole instance of the Tunnel active object
|
||||
// Public-scope objects ------------------------------------------------------
|
||||
//.$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
//. Check for the minimum required QP version
|
||||
#if (QP_VERSION < 670U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.7.0 or higher required
|
||||
#if (QP_VERSION < 680U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
|
||||
#error qpcpp version 6.8.0 or higher required
|
||||
#endif
|
||||
//.$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
//.$define${AOs::AO_Tunnel} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
|
||||
@ -190,7 +190,7 @@ void Tunnel::plantMine() {
|
||||
ope.sig = MINE_PLANT_SIG;
|
||||
ope.x = m_last_mine_x;
|
||||
ope.y = m_last_mine_y;
|
||||
m_mines[n]->dispatch(&ope); // direct dispatch
|
||||
m_mines[n]->dispatch(&ope, m_prio); // direct dispatch
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -199,7 +199,7 @@ void Tunnel::plantMine() {
|
||||
void Tunnel::dispatchToAllMines(QP::QEvt const * e) {
|
||||
for (uint8_t n = 0U; n < GAME_MINES_MAX; ++n) {
|
||||
if (m_mines[n] != nullptr) { // is the mine used?
|
||||
m_mines[n]->dispatch(e);
|
||||
m_mines[n]->dispatch(e, m_prio);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -208,8 +208,8 @@ void Tunnel::dispatchToAllMines(QP::QEvt const * e) {
|
||||
Q_STATE_DEF(Tunnel, initial) {
|
||||
//.${AOs::Tunnel::SM::initial}
|
||||
for (uint8_t n = 0; n < GAME_MINES_MAX; ++n) {
|
||||
m_mine1_pool[n]->init(); // take the initial tran. for Mine1
|
||||
m_mine2_pool[n]->init(); // take the initial tran. for Mine2
|
||||
m_mine1_pool[n]->init(m_prio); // take the initial tran. for Mine1
|
||||
m_mine2_pool[n]->init(m_prio); // take the initial tran. for Mine2
|
||||
}
|
||||
|
||||
BSP_randomSeed(1234U); // seed the pseudo-random generator
|
||||
@ -234,15 +234,15 @@ Q_STATE_DEF(Tunnel, initial) {
|
||||
|
||||
(void)e; // unused parameter
|
||||
|
||||
QS_FUN_DICTIONARY(&active);
|
||||
QS_FUN_DICTIONARY(&show_logo);
|
||||
QS_FUN_DICTIONARY(&demo);
|
||||
QS_FUN_DICTIONARY(&playing);
|
||||
QS_FUN_DICTIONARY(&game_over);
|
||||
QS_FUN_DICTIONARY(&screen_saver);
|
||||
QS_FUN_DICTIONARY(&screen_saver_hide);
|
||||
QS_FUN_DICTIONARY(&screen_saver_show);
|
||||
QS_FUN_DICTIONARY(&final);
|
||||
QS_FUN_DICTIONARY(&Tunnel::active);
|
||||
QS_FUN_DICTIONARY(&Tunnel::show_logo);
|
||||
QS_FUN_DICTIONARY(&Tunnel::demo);
|
||||
QS_FUN_DICTIONARY(&Tunnel::playing);
|
||||
QS_FUN_DICTIONARY(&Tunnel::game_over);
|
||||
QS_FUN_DICTIONARY(&Tunnel::screen_saver);
|
||||
QS_FUN_DICTIONARY(&Tunnel::screen_saver_hide);
|
||||
QS_FUN_DICTIONARY(&Tunnel::screen_saver_show);
|
||||
QS_FUN_DICTIONARY(&Tunnel::final);
|
||||
|
||||
return tran(&show_logo);
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: "Fly 'n' Shoot" game example for Win32-GUI
|
||||
// Last Updated for Version: 6.9.0
|
||||
// Date of the Last Update: 2020-08-06
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2020 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,12 +25,12 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
///***************************************************************************
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
#include "game.hpp"
|
||||
#include "bsp.hpp"
|
||||
@ -116,8 +116,8 @@ void BSP_init(void) {
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QP::QS_ALL_RECORDS);
|
||||
QS_FILTER_OFF(QP::QS_QF_TICK);
|
||||
QS_GLB_FILTER(QP::QS_ALL_RECORDS);
|
||||
QS_GLB_FILTER(-QP::QS_QF_TICK);
|
||||
}
|
||||
//..........................................................................*/
|
||||
void BSP_terminate(int16_t result) {
|
||||
@ -860,13 +860,6 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param1;
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(GAME::COMMAND_STAT, nullptr)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
||||
if (cmdId == 10U) {
|
||||
Q_onAssert("QS::onCommand", 10);
|
||||
}
|
||||
|
24
examples/arm-cm/game_efm32-slstk3401a/win32-gui/make.bat
Normal file
24
examples/arm-cm/game_efm32-slstk3401a/win32-gui/make.bat
Normal file
@ -0,0 +1,24 @@
|
||||
:: Batch file for building the specified PROJ (solution) prepared for
|
||||
:: Microsoft Visual Studio
|
||||
::
|
||||
:: usage:
|
||||
:: make
|
||||
::
|
||||
@setlocal
|
||||
|
||||
:: specifiy project and build configuration (Debug|Release|Spy)
|
||||
@set PROJ=game-gui
|
||||
@set CONF=Debug
|
||||
|
||||
:: adjust the MSBuild location for your system
|
||||
@set MSBuild="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"
|
||||
|
||||
:: execute the build...
|
||||
%MSBuild% %PROJ%.sln -t:Build -p:Configuration=%CONF% -p:Platform=Win32
|
||||
|
||||
:: cleanup after the build...
|
||||
::rmdir /S /Q %CONF%\%PROJ%.tlog
|
||||
::del %CONF%\%PROJ%.vcxproj* %CONF%\%PROJ%.log %CONF%\*.obj %CONF%\*.pdb
|
||||
|
||||
@endlocal
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: DPP example
|
||||
// Last Updated for Version: 5.6.0
|
||||
// Date of the Last Update: 2015-12-28
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-22
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#ifndef BSP_HPP
|
||||
|
@ -1,7 +1,7 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, LAUCHXL2-TMS570LS12 board, preemptive QK kernel
|
||||
// Last updated for version 6.8.0
|
||||
// Last updated on 2020-01-23
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-22
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
@ -178,6 +178,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_ssiTest);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -188,7 +193,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
LED2_PORT->DCLR = (1U << LED2_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -326,20 +331,6 @@ bool QS::onStartup(void const *arg) {
|
||||
vimREG->FIRQPR0 |= (1U << 13); // designate interrupt as FIQ
|
||||
vimREG->REQMASKSET0 = (1U << 13); // enable interrupt
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,7 +1,7 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, LAUCHXL2-TMS570LS12 board, cooperative QV kernel
|
||||
// Last updated for version 6.8.0
|
||||
// Last updated on 2020-01-23
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-22
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
@ -180,6 +180,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_ssiTest);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -190,7 +195,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
LED2_PORT->DCLR = (1U << LED2_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -326,20 +331,6 @@ bool QS::onStartup(void const *arg) {
|
||||
vimREG->FIRQPR0 |= (1U << 13); // designate interrupt as FIQ
|
||||
vimREG->REQMASKSET0 = (1U << 13); // enable interrupt
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -381,15 +372,14 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
||||
if ((cmdId == 10U) || (cmdId == 11U)) {
|
||||
// report error
|
||||
QS_BEGIN(QS_RX_STATUS, nullptr)
|
||||
QS_BEGIN_ID(QS_RX_STATUS, 0U)
|
||||
QP::QS::u8_raw_(0x80U | cmdId); // error
|
||||
QS_END()
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: DPP on AT91SAM7S-EK, preemptive QK kernel, IAR-ARM toolset
|
||||
// Last Updated for Version: 5.9.5
|
||||
// Date of the Last Update: 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -179,6 +179,11 @@ void BSP::init(void) {
|
||||
Q_ERROR();
|
||||
}
|
||||
QS_OBJ_DICTIONARY(&l_ISR_tick);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::terminate(int16_t result) {
|
||||
@ -199,7 +204,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
LED_OFF(1); // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -342,19 +347,6 @@ bool QS::onStartup(void const *arg) {
|
||||
pTC0->TC_CCR = AT91C_TC_CLKEN; // TC_CCR: enable Clock Counter
|
||||
pTC0->TC_CCR = AT91C_TC_SWTRG; // TC_CCR: start counting
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
|
||||
return true; // indicate successfull QS initialization
|
||||
}
|
||||
//............................................................................
|
||||
@ -415,4 +407,4 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
// execution time contributes to the brightness of the User LED.
|
||||
//
|
||||
//
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: DPP on AT91SAM7S-EK, cooperative QV kernel, IAR-ARM toolset
|
||||
// Last Updated for Version: 5.9.5
|
||||
// Date of the Last Update: 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -179,6 +179,11 @@ void BSP::init(void) {
|
||||
Q_ERROR();
|
||||
}
|
||||
QS_OBJ_DICTIONARY(&l_ISR_tick);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::terminate(int16_t result) {
|
||||
@ -199,7 +204,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
LED_OFF(1); // turn LED off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -343,19 +348,6 @@ bool QS::onStartup(void const *arg) {
|
||||
pTC0->TC_CCR = AT91C_TC_CLKEN; // TC_CCR: enable Clock Counter
|
||||
pTC0->TC_CCR = AT91C_TC_SWTRG; // TC_CCR: start counting
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
|
||||
return true; // indicate successfull QS initialization
|
||||
}
|
||||
//............................................................................
|
||||
@ -416,4 +408,4 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
// execution time contributes to the brightness of the User LED.
|
||||
//
|
||||
//
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: DPP example, STM32F4-Discovery board, embOS kernel
|
||||
// Last updated for version 5.9.5
|
||||
// Last updated on 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -254,6 +254,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_embos_ticker);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -276,7 +281,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
}
|
||||
(void)n; // unused parameter (in all but Spy build configuration)
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -384,11 +389,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS); // state machine records */
|
||||
QS_FILTER_ON(QS_AO_RECORDS); // active object records */
|
||||
QS_FILTER_ON(QS_UA_RECORDS); // all user records */
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -430,7 +430,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param1;
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
QS_BEGIN(DPP::COMMAND_STAT, (void *)1) //application-specific record begin
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) //app-specific record begin
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -109,7 +109,7 @@ static void displyPhilStat(uint8_t n, char const *stat) {
|
||||
l_philoStat[n] = stat;
|
||||
GUI_DispStringAt(stat, l_xOrg + STATE_X, l_yOrg + l_philoY[n]);
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -123,7 +123,7 @@ static void displyTableStat(char const *stat) {
|
||||
l_tableState = stat;
|
||||
GUI_DispStringAt(stat, l_xOrg + STATE_X, l_yOrg + l_tableY);
|
||||
|
||||
QS_BEGIN(TABLE_STAT, AO_Table) // application-specific record begin
|
||||
QS_BEGIN_ID(TABLE_STAT, AO_Table->m_prio) // app-specific record begin
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Product: DPP example with emWin/uC/GUI, NO Window Manager
|
||||
// Last updated for version 6.8.0
|
||||
// Last updated on 2020-01-22
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2020 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -108,7 +108,7 @@ static const GUI_WIDGET_CREATE_INFO l_dialog[] = {
|
||||
GUI_ID_BUTTON0, 160, 130, 80, 30 }
|
||||
};
|
||||
|
||||
//..........................................................................*/
|
||||
//............................................................................
|
||||
static void onMainWndGUI(WM_MESSAGE* pMsg) {
|
||||
switch (pMsg->MsgId) {
|
||||
case WM_PAINT: {
|
||||
@ -125,7 +125,7 @@ static void onMainWndGUI(WM_MESSAGE* pMsg) {
|
||||
}
|
||||
}
|
||||
}
|
||||
//..........................................................................*/
|
||||
//............................................................................
|
||||
static void onDialogGUI(WM_MESSAGE * pMsg) {
|
||||
switch (pMsg->MsgId) {
|
||||
case WM_INIT_DIALOG: {
|
||||
@ -133,10 +133,10 @@ static void onDialogGUI(WM_MESSAGE * pMsg) {
|
||||
}
|
||||
case WM_NOTIFY_PARENT: {
|
||||
switch (pMsg->Data.v) {
|
||||
case WM_NOTIFICATION_RELEASED: { // react only if released */
|
||||
case WM_NOTIFICATION_RELEASED: { // react only if released
|
||||
switch (WM_GetId(pMsg->hWinSrc)) {
|
||||
case GUI_ID_BUTTON0: {
|
||||
// static PAUSE event for the Table AO */
|
||||
// static PAUSE event for the Table AO
|
||||
static QEvt const pauseEvt = { PAUSE_SIG, 0 };
|
||||
AO_Table->POST(&pauseEvt, &l_onDialogGUI);
|
||||
break;
|
||||
@ -153,23 +153,23 @@ static void onDialogGUI(WM_MESSAGE * pMsg) {
|
||||
}
|
||||
}
|
||||
}
|
||||
//..........................................................................*/
|
||||
//............................................................................
|
||||
static void displyPhilStat(uint8_t n, char const *stat) {
|
||||
TEXT_SetText(WM_GetDialogItem(l_hDlg, GUI_ID_TEXT0 + n), stat);
|
||||
WM_Exec(); // update the screen and invoke WM callbacks */
|
||||
WM_Exec(); // update the screen and invoke WM callbacks
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin */
|
||||
QS_U8(1, n); // Philosopher number */
|
||||
QS_STR(stat); // Philosopher status */
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
}
|
||||
//..........................................................................*/
|
||||
//............................................................................
|
||||
static void displyTableStat(char const *stat) {
|
||||
TEXT_SetText(WM_GetDialogItem(l_hDlg, GUI_ID_TEXT5), stat);
|
||||
WM_Exec(); // update the screen and invoke WM callbacks */
|
||||
WM_Exec(); // update the screen and invoke WM callbacks
|
||||
|
||||
QS_BEGIN(TABLE_STAT, AO_Table) // application-specific record begin */
|
||||
QS_STR(stat); // Philosopher status */
|
||||
QS_BEGIN_ID(TABLE_STAT, AO_Table->m_prio) // app-specific record begin
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ Q_STATE_DEF(Table, ready) {
|
||||
mouse.Layer = Q_EVT_CAST(MouseEvt)->Layer;
|
||||
GUI_PID_StoreState(&mouse); // update the state of the Mouse PID
|
||||
|
||||
WM_Exec(); // update the screen and invoke WM callbacks
|
||||
WM_Exec(); // update the screen and invoke WM callbacks
|
||||
return Q_RET_HANDLED;
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EK-TM4C123GXL board, FreeRTOS kernel
|
||||
// Last Updated for Version: 6.5.0
|
||||
// Date of the Last Update: 2019-03-22
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -46,29 +46,6 @@ Q_DEFINE_THIS_FILE // define the name of this file for assertions
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE1
|
||||
UART0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI
|
||||
<= (configMAX_SYSCALL_INTERRUPT_PRIORITY >> (8-__NVIC_PRIO_BITS)));
|
||||
|
||||
enum KernelAwareISRs {
|
||||
SYSTICK_PRIO = (configMAX_SYSCALL_INTERRUPT_PRIORITY >> (8-__NVIC_PRIO_BITS)),
|
||||
GPIOA_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// LEDs and Switches of the EK-TM4C123GXL board ..............................
|
||||
#define LED_RED (1U << 1)
|
||||
#define LED_GREEN (1U << 3)
|
||||
@ -295,6 +272,11 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(PAUSED_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -303,7 +285,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
? 0xFFU // turn the LED1 on
|
||||
: 0U); // turn the LED1 off
|
||||
|
||||
QS_BEGIN(DPP::PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -312,8 +294,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
void BSP::displayPaused(uint8_t const paused) {
|
||||
GPIOF->DATA_Bits[LED_GREEN] = ((paused != 0U) ? 0xFFU : 0U);
|
||||
|
||||
// application-specific trace record
|
||||
QS_BEGIN(PAUSED_STAT, AO_Table)
|
||||
QS_BEGIN_ID(PAUSED_STAT, AO_Table->m_prio) // app-specific record begin
|
||||
QS_U8(1, paused); // Paused status
|
||||
QS_END()
|
||||
}
|
||||
@ -364,15 +345,15 @@ void QF::onStartup(void) {
|
||||
// assign all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(UART0_IRQn, DPP::UART0_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIOA_IRQn, DPP::GPIOA_PRIO);
|
||||
NVIC_SetPriority(UART0_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIOA_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -451,12 +432,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters... */
|
||||
QS_FILTER_ON(QS_SM_RECORDS); // state machine records */
|
||||
QS_FILTER_ON(QS_UA_RECORDS); // all usedr records */
|
||||
//QS_FILTER_ON(QS_MUTEX_LOCK);
|
||||
//QS_FILTER_ON(QS_MUTEX_UNLOCK);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -503,8 +478,7 @@ void QS::onCommand(uint8_t cmdId,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, reinterpret_cast<void *>(1))
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // application-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, NUCLEO-H743ZI board, FreeRTOS kernel
|
||||
// Last Updated for Version: 6.1.0
|
||||
// Date of the Last Update: 2018-02-03
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -45,29 +45,6 @@ Q_DEFINE_THIS_FILE // define the name of this file for assertions
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE1
|
||||
USART3_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI
|
||||
<= (configMAX_SYSCALL_INTERRUPT_PRIORITY >> (8-__NVIC_PRIO_BITS)));
|
||||
|
||||
enum KernelAwareISRs {
|
||||
SYSTICK_PRIO = (configMAX_SYSCALL_INTERRUPT_PRIORITY >> (8-__NVIC_PRIO_BITS)),
|
||||
EXTI0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
static uint32_t l_rnd; // random seed
|
||||
|
||||
@ -292,6 +269,11 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(PAUSED_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
/*..........................................................................*/
|
||||
void BSP::ledOn(void) {
|
||||
@ -310,7 +292,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
BSP_LED_Off(LED1);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END() // application-specific record end
|
||||
@ -364,15 +346,15 @@ void QF::onStartup(void) {
|
||||
// assign all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART3_IRQn, DPP::USART3_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(EXTI0_IRQn, DPP::EXTI0_PRIO);
|
||||
NVIC_SetPriority(USART3_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(EXTI0_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -434,10 +416,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -484,8 +462,7 @@ void QS::onCommand(uint8_t cmdId,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, reinterpret_cast<void *>(1))
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, STM32746G-Discovery board, FreeRTOS kernel
|
||||
// Last Updated for Version: 6.1.0
|
||||
// Date of the Last Update: 2018-02-03
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -45,29 +45,6 @@ Q_DEFINE_THIS_FILE // define the name of this file for assertions
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE1
|
||||
USART1_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI
|
||||
<= (configMAX_SYSCALL_INTERRUPT_PRIORITY >> (8-__NVIC_PRIO_BITS)));
|
||||
|
||||
enum KernelAwareISRs {
|
||||
SYSTICK_PRIO = (configMAX_SYSCALL_INTERRUPT_PRIORITY >> (8-__NVIC_PRIO_BITS)),
|
||||
EXTI0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
static uint32_t l_rnd; // random seed
|
||||
|
||||
@ -289,6 +266,11 @@ void BSP::init(void) {
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(PAUSED_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -299,7 +281,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
BSP_LED_Off(LED1);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END() // application-specific record end
|
||||
@ -357,22 +339,18 @@ void QF::onStartup(void) {
|
||||
// set up the SysTick timer to fire at BSP::TICKS_PER_SEC rate
|
||||
//SysTick_Config(SystemCoreClock / BSP_TICKS_PER_SEC); // done in FreeRTOS
|
||||
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
|
||||
// assingn all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART1_IRQn, DPP::USART1_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(EXTI0_IRQn, DPP::EXTI0_PRIO);
|
||||
NVIC_SetPriority(USART1_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(EXTI0_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -434,10 +412,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -480,8 +454,7 @@ void QS::onCommand(uint8_t cmdId,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, reinterpret_cast<void *>(1))
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: BSP for "start-stop" app with FreeRTOS
|
||||
// Last Updated for Version: 6.5.0
|
||||
// Date of the Last Update: 2019-03-22
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -41,29 +41,6 @@
|
||||
|
||||
Q_DEFINE_THIS_FILE // define the name of this file for assertions
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE1
|
||||
USART3_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI
|
||||
<= (configMAX_SYSCALL_INTERRUPT_PRIORITY >> (8-__NVIC_PRIO_BITS)));
|
||||
|
||||
enum KernelAwareISRs {
|
||||
SYSTICK_PRIO = (configMAX_SYSCALL_INTERRUPT_PRIORITY >> (8-__NVIC_PRIO_BITS)),
|
||||
EXTI0_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#ifdef Q_SPY
|
||||
|
||||
@ -266,6 +243,11 @@ void BSP::init(void) {
|
||||
}
|
||||
QS_OBJ_DICTIONARY(&l_TickHook);
|
||||
QS_OBJ_DICTIONARY(&l_EXTI0_IRQHandler);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::ledOn(void) {
|
||||
@ -295,15 +277,15 @@ void QF::onStartup(void) {
|
||||
// assign all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART3_IRQn, USART3_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, SYSTICK_PRIO);
|
||||
NVIC_SetPriority(EXTI0_IRQn, EXTI0_PRIO);
|
||||
NVIC_SetPriority(USART3_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(EXTI0_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -365,10 +347,6 @@ bool QS::onStartup(void const *arg) {
|
||||
QS_tickPeriod_ = SystemCoreClock / BSP::TICKS_PER_SEC;
|
||||
QS_tickTime_ = QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: BSP for DPP with lwIP on EK-LM3S9665 board, QK kernel
|
||||
// Last updated for version 5.9.0
|
||||
// Last updated on 2017-05-09
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp" // QP port header file
|
||||
@ -39,26 +39,6 @@
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
ETHERNET_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// ISRs defined in this BSP --------------------------------------------------
|
||||
extern "C" void SysTick_Handler(void);
|
||||
|
||||
@ -176,6 +156,11 @@ void BSP_init(void) {
|
||||
Q_ERROR();
|
||||
}
|
||||
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void QF::onStartup(void) {
|
||||
@ -185,14 +170,14 @@ void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority()
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(SysTick_IRQn, SYSTICK_PRIO);
|
||||
NVIC_SetPriority(Ethernet_IRQn, ETHERNET_PRIO);
|
||||
NVIC_SetPriority(Ethernet_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
NVIC_EnableIRQ(Ethernet_IRQn); // enable the Ethernet Interrupt
|
||||
@ -287,17 +272,6 @@ bool QS::onStartup(void const *arg) {
|
||||
QS_tickPeriod_ = SystemCoreClock / BSP_TICKS_PER_SEC;
|
||||
QS_tickTime_ = QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -347,7 +321,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -365,7 +339,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// by which a "QF-unaware" ISR can communicate with the QF framework is by
|
||||
// triggering a "QF-aware" ISR, which can post/publish events.
|
||||
//
|
||||
// NOTE01:
|
||||
// NOTE2:
|
||||
// The User LED is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: BSP for DPP with lwIP on EK-LM3S9665 board, QV kernel
|
||||
// Last updated for version 5.9.0
|
||||
// Last updated on 2017-05-09
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp" // QP port header file
|
||||
@ -39,26 +39,6 @@
|
||||
|
||||
Q_DEFINE_THIS_FILE
|
||||
|
||||
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
ETHERNET_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// ISRs defined in this BSP --------------------------------------------------
|
||||
extern "C" void SysTick_Handler(void);
|
||||
|
||||
@ -172,6 +152,11 @@ void BSP_init(void) {
|
||||
Q_ERROR();
|
||||
}
|
||||
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void QF::onStartup(void) {
|
||||
@ -181,14 +166,14 @@ void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority()
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(SysTick_IRQn, SYSTICK_PRIO);
|
||||
NVIC_SetPriority(Ethernet_IRQn, ETHERNET_PRIO);
|
||||
NVIC_SetPriority(Ethernet_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
NVIC_EnableIRQ(Ethernet_IRQn); // enable the Ethernet Interrupt
|
||||
@ -284,17 +269,6 @@ bool QS::onStartup(void const *arg) {
|
||||
QS_tickPeriod_ = SystemCoreClock / BSP_TICKS_PER_SEC;
|
||||
QS_tickTime_ = QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -344,7 +318,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -368,7 +342,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// an event. QV_onIdle() must internally enable interrupts, ideally
|
||||
// atomically with putting the CPU to the power-saving mode.
|
||||
//
|
||||
// NOTE02:
|
||||
// NOTE2:
|
||||
// The User LED is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: DPP example with lwIP and direct screen output
|
||||
// Last Updated for Version: 6.8.0
|
||||
// Date of the Last Update: 2020-01-24
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -270,7 +270,7 @@ void Table::displayPhilStat(uint8_t n, char const *stat) {
|
||||
str[1] = '\0';
|
||||
RIT128x96x4StringDraw(str, (6*6 + 3*6*n), 4*8, 15);
|
||||
}
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -287,7 +287,7 @@ void Table::displyCgiText(char const *text) {
|
||||
RIT128x96x4StringDraw(" ", 5*6, 6*8, 15); // wipe clean
|
||||
RIT128x96x4StringDraw(text, 5*6, 6*8, 15);
|
||||
|
||||
QS_BEGIN(CGI_TEXT, 0) // application-specific record begin
|
||||
QS_BEGIN_ID(CGI_TEXT, 0U) // app-specific record begin
|
||||
QS_STR(text); // User text
|
||||
QS_END()
|
||||
}
|
||||
@ -297,7 +297,7 @@ void Table::displyUdpText(char const *text) {
|
||||
RIT128x96x4StringDraw(" ", 5*6, 6*8, 15); // wipe clean
|
||||
RIT128x96x4StringDraw(text, 5*6, 6*8, 15);
|
||||
|
||||
QS_BEGIN(UDP_TEXT, 0) // application-specific record begin
|
||||
QS_BEGIN_ID(UDP_TEXT, 0U) // app-specific record begin
|
||||
QS_STR(text); // User text
|
||||
QS_END()
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ SECTIONS
|
||||
read only but which older linkers treat as read-write.
|
||||
This prevents older linkers from marking the entire .rodata
|
||||
section as read-write. */
|
||||
.rodata2 :
|
||||
.rodata2 :
|
||||
{
|
||||
. = ALIGN(2);
|
||||
PROVIDE (__preinit_array_start = .);
|
||||
@ -327,7 +327,7 @@ SECTIONS
|
||||
. = ALIGN(2);
|
||||
__heap_start__ = .;
|
||||
_end = __heap_start__;
|
||||
PROVIDE (end = .);
|
||||
PROVIDE (end = .);
|
||||
KEEP (*(.heap))
|
||||
_end = .;
|
||||
PROVIDE (end = .);
|
||||
|
@ -207,7 +207,7 @@ SECTIONS
|
||||
read only but which older linkers treat as read-write.
|
||||
This prevents older linkers from marking the entire .rodata
|
||||
section as read-write. */
|
||||
.rodata2 :
|
||||
.rodata2 :
|
||||
{
|
||||
. = ALIGN(2);
|
||||
PROVIDE (__preinit_array_start = .);
|
||||
@ -327,7 +327,7 @@ SECTIONS
|
||||
. = ALIGN(2);
|
||||
__heap_start__ = .;
|
||||
_end = __heap_start__;
|
||||
PROVIDE (end = .);
|
||||
PROVIDE (end = .);
|
||||
KEEP (*(.heap))
|
||||
_end = .;
|
||||
PROVIDE (end = .);
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: DPP example on MSP-EXP430F5529LP board, preemptive QK kernel
|
||||
// Last updated for version 6.3.8
|
||||
// Last updated on 2019-01-24
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -121,6 +121,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_timer0_ISR);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
//QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -131,9 +136,9 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
P1OUT &= ~LED1; // turn LED1 off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
}
|
||||
void BSP::displayPaused(uint8_t paused) {
|
||||
@ -266,11 +271,6 @@ bool QS::onStartup(void const *arg) {
|
||||
UCA1CTL1 &= ~UCSWRST; // initialize USCI state machine
|
||||
UCA1IE |= UCRXIE; // Enable USCI_A1 RX interrupt
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
//QS_FILTER_ON(QS_AO_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -316,7 +316,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param1;
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
QS_BEGIN(DPP::COMMAND_STAT, (void *)1)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -207,7 +207,7 @@ SECTIONS
|
||||
read only but which older linkers treat as read-write.
|
||||
This prevents older linkers from marking the entire .rodata
|
||||
section as read-write. */
|
||||
.rodata2 :
|
||||
.rodata2 :
|
||||
{
|
||||
. = ALIGN(2);
|
||||
PROVIDE (__preinit_array_start = .);
|
||||
@ -327,7 +327,7 @@ SECTIONS
|
||||
. = ALIGN(2);
|
||||
__heap_start__ = .;
|
||||
_end = __heap_start__;
|
||||
PROVIDE (end = .);
|
||||
PROVIDE (end = .);
|
||||
KEEP (*(.heap))
|
||||
_end = .;
|
||||
PROVIDE (end = .);
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: DPP example on MSP-EXP430F5529LP board, cooperative QV kernel
|
||||
// Last updated for version 6.3.8
|
||||
// Last updated on 2019-01-24
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -119,6 +119,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_timer0_ISR);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
//QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -129,7 +134,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
P1OUT &= ~LED1; // turn LED1 off
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -263,11 +268,6 @@ bool QS::onStartup(void const *arg) {
|
||||
UCA1CTL1 &= ~UCSWRST; // initialize USCI state machine
|
||||
UCA1IE |= UCRXIE; // Enable USCI_A1 RX interrupt
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
//QS_FILTER_ON(QS_AO_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -313,7 +313,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param1;
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
QS_BEGIN(DPP::COMMAND_STAT, (void *)1)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U)
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_U32(8, param2);
|
||||
|
@ -207,7 +207,7 @@ SECTIONS
|
||||
read only but which older linkers treat as read-write.
|
||||
This prevents older linkers from marking the entire .rodata
|
||||
section as read-write. */
|
||||
.rodata2 :
|
||||
.rodata2 :
|
||||
{
|
||||
. = ALIGN(2);
|
||||
PROVIDE (__preinit_array_start = .);
|
||||
@ -327,7 +327,7 @@ SECTIONS
|
||||
. = ALIGN(2);
|
||||
__heap_start__ = .;
|
||||
_end = __heap_start__;
|
||||
PROVIDE (end = .);
|
||||
PROVIDE (end = .);
|
||||
KEEP (*(.heap))
|
||||
_end = .;
|
||||
PROVIDE (end = .);
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EFM32-SLSTK3401A board, preemptive QK kernel
|
||||
// Last Updated for Version: 5.9.7
|
||||
// Date of the Last Update: 2017-08-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -46,27 +46,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART0_RX_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_PORT gpioPortF
|
||||
#define LED0_PIN 4
|
||||
@ -233,6 +212,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -243,7 +227,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIO->P[LED_PORT].DOUT &= ~(1U << LED0_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -298,15 +282,15 @@ void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART0_RX_IRQn, DPP::USART0_RX_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, DPP::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART0_RX_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -432,20 +416,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -492,8 +462,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
@ -509,7 +478,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
} // namespace QP
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -527,7 +496,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// by which a "QF-unaware" ISR can communicate with the QF framework is by
|
||||
// triggering a "QF-aware" ISR, which can post/publish events.
|
||||
//
|
||||
// NOTE01:
|
||||
// NOTE2:
|
||||
// The User LED is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts locked, so no interrupt
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EFM32-SLSTK3401A board, cooperative QV kernel
|
||||
// Last Updated for Version: 5.9.5
|
||||
// Date of the Last Update: 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -46,27 +46,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART0_RX_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_PORT gpioPortF
|
||||
#define LED0_PIN 4
|
||||
@ -209,6 +188,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -219,7 +203,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIO->P[LED_PORT].DOUT &= ~(1U << LED0_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -271,15 +255,15 @@ void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART0_RX_IRQn, DPP::USART0_RX_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, DPP::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART0_RX_IRQn, 0U); // kernel unaware interrupt
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -406,20 +390,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -466,8 +436,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
@ -483,7 +452,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
} // namespace QP
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -501,7 +470,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// by which a "QF-unaware" ISR can communicate with the QF framework is by
|
||||
// triggering a "QF-aware" ISR, which can post/publish events.
|
||||
//
|
||||
// NOTE01:
|
||||
// NOTE2:
|
||||
// The QV:onIdle() callback is called with interrupts disabled, because the
|
||||
// determination of the idle condition might change by any interrupt posting
|
||||
// an event. QV::onIdle() must internally enable interrupts, ideally
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EFM32-SLSTK3401A board, preemptive QXK kernel
|
||||
// Last updated for version 6.7.0
|
||||
// Last updated on 2019-12-26
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -47,27 +47,6 @@ Q_DEFINE_THIS_FILE
|
||||
// namespace DPP *************************************************************
|
||||
namespace DPP {
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
enum KernelUnawareISRs { // see NOTE00
|
||||
USART0_RX_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_UNAWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-unaware" interrupts can't overlap "kernel-aware" interrupts
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_UNAWARE_CMSIS_PRI <= QF_AWARE_ISR_CMSIS_PRI);
|
||||
|
||||
enum KernelAwareISRs {
|
||||
GPIO_EVEN_PRIO = QF_AWARE_ISR_CMSIS_PRI, // see NOTE00
|
||||
SYSTICK_PRIO,
|
||||
// ...
|
||||
MAX_KERNEL_AWARE_CMSIS_PRI // keep always last
|
||||
};
|
||||
// "kernel-aware" interrupts should not overlap the PendSV priority
|
||||
Q_ASSERT_COMPILE(MAX_KERNEL_AWARE_CMSIS_PRI <= (0xFF >>(8-__NVIC_PRIO_BITS)));
|
||||
|
||||
// Local-scope objects -------------------------------------------------------
|
||||
#define LED_PORT gpioPortF
|
||||
#define LED0_PIN 4
|
||||
@ -223,6 +202,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -233,7 +217,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIO->P[LED_PORT].DOUT &= ~(1U << LED0_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -293,15 +277,15 @@ void QF::onStartup(void) {
|
||||
// assing all priority bits for preemption-prio. and none to sub-prio.
|
||||
NVIC_SetPriorityGrouping(0U);
|
||||
|
||||
// set priorities of ALL ISRs used in the system, see NOTE00
|
||||
// set priorities of ALL ISRs used in the system, see NOTE1
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
|
||||
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
|
||||
//
|
||||
NVIC_SetPriority(USART0_RX_IRQn, DPP::USART0_RX_PRIO);
|
||||
NVIC_SetPriority(SysTick_IRQn, DPP::SYSTICK_PRIO);
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, DPP::GPIO_EVEN_PRIO);
|
||||
NVIC_SetPriority(USART0_RX_IRQn, 0U); // kerel unaware interrupt
|
||||
NVIC_SetPriority(GPIO_EVEN_IRQn, QF_AWARE_ISR_CMSIS_PRI);
|
||||
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
|
||||
// ...
|
||||
|
||||
// enable IRQs...
|
||||
@ -427,20 +411,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -487,8 +457,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
@ -504,7 +473,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
} // namespace QP
|
||||
|
||||
//****************************************************************************
|
||||
// NOTE00:
|
||||
// NOTE1:
|
||||
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
|
||||
// ISR priority that is disabled by the QF framework. The value is suitable
|
||||
// for the NVIC_SetPriority() CMSIS function.
|
||||
@ -522,7 +491,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
// by which a "QF-unaware" ISR can communicate with the QF framework is by
|
||||
// triggering a "QF-aware" ISR, which can post/publish events.
|
||||
//
|
||||
// NOTE01:
|
||||
// NOTE2:
|
||||
// The User LED is used to visualize the idle loop activity. The brightness
|
||||
// of the LED is proportional to the frequency of invcations of the idle loop.
|
||||
// Please note that the LED is toggled with interrupts disabled, so no
|
||||
|
@ -1,13 +1,13 @@
|
||||
///***************************************************************************
|
||||
// Product: DPP example, EFM32-SLSTK3401A board, uC/OS-II kernel
|
||||
// Last Updated for Version: 5.9.5
|
||||
// Date of the Last Update: 2017-07-20
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ---------------------------
|
||||
// innovating embedded systems
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,10 +25,10 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// https://state-machine.com
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "qpcpp.hpp"
|
||||
@ -247,6 +247,11 @@ void BSP::init(void) {
|
||||
QS_OBJ_DICTIONARY(&l_GPIO_EVEN_IRQHandler);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
QS_USR_DICTIONARY(COMMAND_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
@ -257,7 +262,7 @@ void BSP::displayPhilStat(uint8_t n, char const *stat) {
|
||||
GPIO->P[LED_PORT].DOUT &= ~(1U << LED0_PIN);
|
||||
}
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -419,20 +424,6 @@ bool QS::onStartup(void const *arg) {
|
||||
DPP::QS_tickPeriod_ = SystemCoreClock / DPP::BSP::TICKS_PER_SEC;
|
||||
DPP::QS_tickTime_ = DPP::QS_tickPeriod_; // to start the timestamp at zero
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_QEP_STATE_ENTRY);
|
||||
QS_FILTER_ON(QS_QEP_STATE_EXIT);
|
||||
QS_FILTER_ON(QS_QEP_STATE_INIT);
|
||||
QS_FILTER_ON(QS_QEP_INIT_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_INTERN_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_TRAN);
|
||||
QS_FILTER_ON(QS_QEP_IGNORED);
|
||||
QS_FILTER_ON(QS_QEP_DISPATCH);
|
||||
QS_FILTER_ON(QS_QEP_UNHANDLED);
|
||||
|
||||
QS_FILTER_ON(DPP::PHILO_STAT);
|
||||
QS_FILTER_ON(DPP::COMMAND_STAT);
|
||||
|
||||
return true; // return success
|
||||
}
|
||||
//............................................................................
|
||||
@ -483,8 +474,7 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
|
||||
(void)param2;
|
||||
(void)param3;
|
||||
|
||||
// application-specific record
|
||||
QS_BEGIN(DPP::COMMAND_STAT, nullptr)
|
||||
QS_BEGIN_ID(DPP::COMMAND_STAT, 0U) // app-specific record
|
||||
QS_U8(2, cmdId);
|
||||
QS_U32(8, param1);
|
||||
QS_END()
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// BSP for DPP example, Microstick II board, preemptive QK kernel, XC32
|
||||
// Last updated for version 6.5.1
|
||||
// Last updated on 2019-06-10
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -112,6 +112,11 @@ void BSP::init(void) {
|
||||
Q_ALLEGE(QS_INIT(nullptr)); // initialize the QS software tracing
|
||||
QS_OBJ_DICTIONARY(&l_tickISR);
|
||||
QS_OBJ_DICTIONARY(&l_testISR);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
//QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::terminate(int16_t result) {
|
||||
@ -123,7 +128,7 @@ void BSP::displayPhilStat(uint8_t const n, char const *stat) {
|
||||
(void)stat;
|
||||
LED_TOGGLE();
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -232,10 +237,6 @@ bool QS::onStartup(void const *arg) {
|
||||
U2BRG = (uint16_t)((PER_HZ / (4.0 * QS_BAUD_RATE)) - 1.0 + 0.5);
|
||||
U2MODEbits.UARTEN = 1;
|
||||
U2STAbits.UTXEN = 1;
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
//QS_FILTER_ON(QS_AO_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // indicate successful QS initialization
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// BSP for DPP example, Microstick II board, cooperative QV kernel, XC32
|
||||
// Last updated for version 6.5.1
|
||||
// Last updated on 2019-06-10
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps, LLC. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -25,7 +25,7 @@
|
||||
// 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 <www.gnu.org/licenses/>.
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com/licensing>
|
||||
@ -104,6 +104,11 @@ void BSP::init(void) {
|
||||
Q_ALLEGE(QS_INIT(nullptr)); // initialize the QS software tracing
|
||||
QS_OBJ_DICTIONARY(&l_tickISR);
|
||||
QS_OBJ_DICTIONARY(&l_testISR);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
//QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP::terminate(int16_t result) {
|
||||
@ -115,7 +120,7 @@ void BSP::displayPhilStat(uint8_t const n, char const *stat) {
|
||||
(void)stat;
|
||||
LED_TOGGLE();
|
||||
|
||||
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin
|
||||
QS_BEGIN_ID(PHILO_STAT, AO_Philo[n]->m_prio) // app-specific record begin
|
||||
QS_U8(1, n); // Philosopher number
|
||||
QS_STR(stat); // Philosopher status
|
||||
QS_END()
|
||||
@ -232,10 +237,6 @@ bool QS::onStartup(void const *arg) {
|
||||
U2BRG = (uint16_t)((PER_HZ / (4.0 * QS_BAUD_RATE)) - 1.0 + 0.5);
|
||||
U2MODEbits.UARTEN = 1;
|
||||
U2STAbits.UTXEN = 1;
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS);
|
||||
//QS_FILTER_ON(QS_AO_RECORDS);
|
||||
QS_FILTER_ON(QS_UA_RECORDS);
|
||||
|
||||
return true; // indicate successful QS initialization
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: BSP for DPP-GUI example with Qt5
|
||||
// Last updated for version 6.6.0
|
||||
// Last updated on 2019-07-30
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -28,7 +28,7 @@
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com>
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include <QtWidgets>
|
||||
@ -63,11 +63,14 @@ void QP::QF::onCleanup(void) {
|
||||
}
|
||||
//............................................................................
|
||||
void BSP_init(void) {
|
||||
BSP_randomSeed(1234U);
|
||||
|
||||
Q_ALLEGE(QS_INIT((char *)0));
|
||||
QS_OBJ_DICTIONARY(&l_time_tick);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
BSP_randomSeed(1234U);
|
||||
// set up the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_QF_MPOOL_GET);
|
||||
}
|
||||
//............................................................................
|
||||
void BSP_terminate(int) {
|
||||
@ -185,9 +188,6 @@ bool QP::QS::onStartup(void const *) {
|
||||
|
||||
l_time.start(); // start the time stamp
|
||||
|
||||
// set up the QS filters...
|
||||
QS_FILTER_ON(QS_QF_MPOOL_GET);
|
||||
|
||||
return true; // success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: BSP for DPP-GUI example with Qt5
|
||||
// Last updated for version 6.6.0
|
||||
// Last updated on 2019-07-30
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -28,7 +28,7 @@
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com>
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include "gui.hpp"
|
||||
@ -62,11 +62,14 @@ void QP::QF::onCleanup(void) {
|
||||
}
|
||||
//............................................................................
|
||||
void BSP_init(void) {
|
||||
BSP_randomSeed(1234U);
|
||||
|
||||
Q_ALLEGE(QS_INIT((char *)0));
|
||||
QS_OBJ_DICTIONARY(&l_time_tick);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
BSP_randomSeed(1234U);
|
||||
// set up the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_QF_MPOOL_GET);
|
||||
}
|
||||
//............................................................................
|
||||
void BSP_terminate(int) {
|
||||
@ -170,9 +173,6 @@ bool QP::QS::onStartup(void const *) {
|
||||
|
||||
l_time.start(); // start the time stamp
|
||||
|
||||
// set up the QS filters...
|
||||
QS_FILTER_ON(QS_QF_MPOOL_GET);
|
||||
|
||||
return true; // success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: BSP for DPP-console example with Qt5
|
||||
// Last updated for version 6.6.0
|
||||
// Last updated on 2019-07-30
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -28,7 +28,7 @@
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com>
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include <QCoreApplication>
|
||||
@ -56,14 +56,19 @@ static QTextStream l_stdOutStream(stdout, QIODevice::WriteOnly);
|
||||
|
||||
//............................................................................
|
||||
void BSP_init(void) {
|
||||
Q_ALLEGE(QS_INIT((char *)0));
|
||||
QS_OBJ_DICTIONARY(&l_time_tick);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
l_stdOutStream << "DPP-Qt console example" << endl
|
||||
<< "QP " << QP::QF::getVersion() << endl;
|
||||
|
||||
BSP_randomSeed(1234U);
|
||||
|
||||
Q_ALLEGE(QS_INIT((char *)0));
|
||||
QS_OBJ_DICTIONARY(&l_time_tick);
|
||||
QS_USR_DICTIONARY(PHILO_STAT);
|
||||
|
||||
// setup the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_SM_RECORDS); // state machine records
|
||||
QS_GLB_FILTER(QP::QS_AO_RECORDS); // active object records
|
||||
QS_GLB_FILTER(QP::QS_UA_RECORDS); // all user records
|
||||
}
|
||||
//............................................................................
|
||||
void BSP_terminate(int) {
|
||||
@ -149,11 +154,6 @@ bool QS::onStartup(void const *) {
|
||||
|
||||
l_time.start(); // start the time stamp
|
||||
|
||||
// setup the QS filters...
|
||||
QS_FILTER_ON(QS_SM_RECORDS); // state machine records */
|
||||
QS_FILTER_ON(QS_AO_RECORDS); // active object records */
|
||||
QS_FILTER_ON(QS_UA_RECORDS); // all usedr records */
|
||||
|
||||
return true; // success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -1,13 +1,13 @@
|
||||
//****************************************************************************
|
||||
// Product: "Fly'n'Shoot" game, BSP for Qt5
|
||||
// Last updated for version 6.6.0
|
||||
// Last updated on 2019-07-30
|
||||
// Last updated for version 6.9.1
|
||||
// Last updated on 2020-09-21
|
||||
//
|
||||
// Q u a n t u m L e a P s
|
||||
// ------------------------
|
||||
// Modern Embedded Software
|
||||
//
|
||||
// Copyright (C) 2005-2019 Quantum Leaps. All rights reserved.
|
||||
// Copyright (C) 2005-2020 Quantum Leaps. 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
|
||||
@ -28,7 +28,7 @@
|
||||
// along with this program. If not, see <www.gnu.org/licenses>.
|
||||
//
|
||||
// Contact information:
|
||||
// <www.state-machine.com>
|
||||
// <www.state-machine.com/licensing>
|
||||
// <info@state-machine.com>
|
||||
//****************************************************************************
|
||||
#include <QtWidgets>
|
||||
@ -75,6 +75,9 @@ void BSP_init() {
|
||||
QS_OBJ_DICTIONARY(&l_time_tick);
|
||||
QS_OBJ_DICTIONARY(&l_bsp);
|
||||
QS_USR_DICTIONARY(PLAYER_TRIGGER);
|
||||
|
||||
// set up the QS filters...
|
||||
QS_GLB_FILTER(QP::QS_QF_MPOOL_GET);
|
||||
}
|
||||
//............................................................................
|
||||
void BSP_terminate(int16_t result) {
|
||||
@ -308,9 +311,6 @@ bool QP::QS::onStartup(void const *) {
|
||||
|
||||
l_time.start(); // start the time stamp
|
||||
|
||||
// set up the QS filters...
|
||||
QS_FILTER_ON(QS_QF_MPOOL_GET);
|
||||
|
||||
return true; // success
|
||||
}
|
||||
//............................................................................
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::game.hpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.2 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<model version="5.0.2" links="1">
|
||||
<model version="5.0.4" links="1">
|
||||
<documentation>"Fly 'n' Shoot" game model from Chapters 1 & 9 of PSiCC2 for Qt with GUI
|
||||
NOTE: Adapted for QP-Qt integartion</documentation>
|
||||
<!--${qpcpp}-->
|
||||
@ -76,7 +76,7 @@ extern QActive *AO_Table;
|
||||
pe = Q_NEW(TableEvt, HUNGRY_SIG); // dynamically allocate event
|
||||
pe->philNum = num;
|
||||
|
||||
AO_Table->post(pe); // <==</code>
|
||||
AO_Table->post(pe, m_prio); // <==</code>
|
||||
</operation>
|
||||
<!--${Qt-port::GuiQActive::postLIFO}-->
|
||||
<operation name="postLIFO" type="void" visibility="0x00" properties="0x00">
|
||||
@ -399,7 +399,7 @@ if ((m_last_mine_x + GAME_MINES_DIST_MIN < GAME_SCREEN_WIDTH)
|
||||
// event to dispatch to the Mine
|
||||
ObjectPosEvt ope(MINE_PLANT_SIG,
|
||||
m_last_mine_x, m_last_mine_y);
|
||||
m_mines[n]->dispatch(&ope); // direct dispatch
|
||||
m_mines[n]->dispatch(&ope, m_prio); // direct dispatch
|
||||
}
|
||||
}</code>
|
||||
</operation>
|
||||
@ -435,7 +435,7 @@ for (uint8_t x = 0U; x < w; ++x) {
|
||||
<parameter name="e" type="QP::QEvt const *"/>
|
||||
<code>for (uint8_t n = 0U; n < GAME_MINES_MAX; ++n) {
|
||||
if (m_mines[n] != static_cast<QHsm *>(0)) { // is the mine used?
|
||||
m_mines[n]->dispatch(e);
|
||||
m_mines[n]->dispatch(e, m_prio);
|
||||
}
|
||||
}</code>
|
||||
</operation>
|
||||
@ -469,21 +469,21 @@ return false;</code>
|
||||
<!--${AOs::Tunnel::SM::initial}-->
|
||||
<initial target="../1/2">
|
||||
<action>for (uint8_t n = 0; n < GAME_MINES_MAX; ++n) {
|
||||
m_mine1_pool[n]->init(); // take the initial tran. for Mine1
|
||||
m_mine2_pool[n]->init(); // take the initial tran. for Mine2
|
||||
m_mine1_pool[n]->init(m_prio); // take the initial tran. for Mine1
|
||||
m_mine2_pool[n]->init(m_prio); // take the initial tran. for Mine2
|
||||
}
|
||||
|
||||
randomSeed(1234); // seed the pseudo-random generator
|
||||
randomSeed(1234); // seed the pseudo-random generator
|
||||
|
||||
subscribe(TIME_TICK_SIG);
|
||||
subscribe(PLAYER_TRIGGER_SIG);
|
||||
subscribe(PLAYER_QUIT_SIG);
|
||||
|
||||
QS_OBJ_DICTIONARY(&l_tunnel); // object dictionary for Tunnel object
|
||||
QS_OBJ_DICTIONARY(&l_tunnel); // object dictionary for Tunnel object
|
||||
QS_OBJ_DICTIONARY(&l_tunnel.m_blinkTimeEvt);
|
||||
QS_OBJ_DICTIONARY(&l_tunnel.m_screenTimeEvt);
|
||||
|
||||
QS_FUN_DICTIONARY(&Tunnel::initial); // fun. dictionaries for Tunnel HSM
|
||||
QS_FUN_DICTIONARY(&Tunnel::initial); // fun. dictionaries for Tunnel HSM
|
||||
QS_FUN_DICTIONARY(&Tunnel::final);
|
||||
QS_FUN_DICTIONARY(&Tunnel::active);
|
||||
QS_FUN_DICTIONARY(&Tunnel::playing);
|
||||
@ -493,7 +493,8 @@ QS_FUN_DICTIONARY(&Tunnel::screen_saver);
|
||||
QS_FUN_DICTIONARY(&Tunnel::screen_saver_hide);
|
||||
QS_FUN_DICTIONARY(&Tunnel::screen_saver_show);
|
||||
|
||||
QS_SIG_DICTIONARY(BLINK_TIMEOUT_SIG, &l_tunnel); // local signals
|
||||
// local signals
|
||||
QS_SIG_DICTIONARY(BLINK_TIMEOUT_SIG, &l_tunnel);
|
||||
QS_SIG_DICTIONARY(SCREEN_TIMEOUT_SIG, &l_tunnel);
|
||||
QS_SIG_DICTIONARY(SHIP_IMG_SIG, &l_tunnel);
|
||||
QS_SIG_DICTIONARY(MISSILE_IMG_SIG, &l_tunnel);
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::mine1.cpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.2 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
@ -108,10 +108,10 @@ Q_STATE_DEF(Mine1, initial) {
|
||||
QS_SIG_DICTIONARY(SHIP_IMG_SIG, this);
|
||||
QS_SIG_DICTIONARY(MISSILE_IMG_SIG, this);
|
||||
|
||||
QS_FUN_DICTIONARY(&unused);
|
||||
QS_FUN_DICTIONARY(&used);
|
||||
QS_FUN_DICTIONARY(&exploding);
|
||||
QS_FUN_DICTIONARY(&planted);
|
||||
QS_FUN_DICTIONARY(&Mine1::unused);
|
||||
QS_FUN_DICTIONARY(&Mine1::used);
|
||||
QS_FUN_DICTIONARY(&Mine1::exploding);
|
||||
QS_FUN_DICTIONARY(&Mine1::planted);
|
||||
|
||||
return tran(&unused);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::mine2.cpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.2 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
@ -108,10 +108,10 @@ Q_STATE_DEF(Mine2, initial) {
|
||||
QS_SIG_DICTIONARY(SHIP_IMG_SIG, this);
|
||||
QS_SIG_DICTIONARY(MISSILE_IMG_SIG, this);
|
||||
|
||||
QS_FUN_DICTIONARY(&unused);
|
||||
QS_FUN_DICTIONARY(&used);
|
||||
QS_FUN_DICTIONARY(&exploding);
|
||||
QS_FUN_DICTIONARY(&planted);
|
||||
QS_FUN_DICTIONARY(&Mine2::unused);
|
||||
QS_FUN_DICTIONARY(&Mine2::used);
|
||||
QS_FUN_DICTIONARY(&Mine2::exploding);
|
||||
QS_FUN_DICTIONARY(&Mine2::planted);
|
||||
|
||||
return tran(&unused);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Model: game.qm
|
||||
// File: ${.::missile.cpp}
|
||||
//
|
||||
// This code has been generated by QM 5.0.2 <www.state-machine.com/qm/>.
|
||||
// This code has been generated by QM 5.0.4 <www.state-machine.com/qm/>.
|
||||
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
|
||||
//
|
||||
// This program is open source software: you can redistribute it and/or
|
||||
@ -87,9 +87,9 @@ Q_STATE_DEF(Missile, initial) {
|
||||
QS_SIG_DICTIONARY(HIT_WALL_SIG, &l_missile);
|
||||
QS_SIG_DICTIONARY(DESTROYED_MINE_SIG, &l_missile);
|
||||
|
||||
QS_FUN_DICTIONARY(&armed);
|
||||
QS_FUN_DICTIONARY(&flying);
|
||||
QS_FUN_DICTIONARY(&exploding);
|
||||
QS_FUN_DICTIONARY(&Missile::armed);
|
||||
QS_FUN_DICTIONARY(&Missile::flying);
|
||||
QS_FUN_DICTIONARY(&Missile::exploding);
|
||||
|
||||
return tran(&armed);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user