This commit is contained in:
MMS 2023-01-06 12:56:50 -05:00
parent 264b16f566
commit 532d29c33d
409 changed files with 7025 additions and 3573 deletions

@ -1 +1 @@
Subproject commit cc0333938b9618b5a25394ebd81c8f235f5ff192
Subproject commit fa06969955bfa96cbdb5b9ff8b05b66f49fad890

View File

@ -7,7 +7,7 @@
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = QP/C++
PROJECT_NUMBER = 7.1.3
PROJECT_NUMBER = 7.2.0
PROJECT_BRIEF = "Real-Time Embedded Framework"
PROJECT_LOGO = ../../ql-doxygen/images/logo_ql.png
OUTPUT_DIRECTORY =
@ -131,6 +131,7 @@ INPUT = main.dox \
../../cert-pack/sds_sm-cpp.dox \
../../cert-pack/autosar.dox \
../../cert-pack/metrics.dox \
history.dox \
exa.dox \
exa_native.dox \
exa_rtos.dox \
@ -143,12 +144,12 @@ INPUT = main.dox \
ports_rtos.dox \
ports_os.dox \
api.dox \
history.dox \
../../ql-doxygen/help.dox \
dir.dox \
config.hpp \
../include \
../src \
../ports/sample \
../ports/lint-plus/std.lnt \
../ports/lint-plus/qpcpp.lnt \
../ports/lint-plus/options.lnt
@ -163,8 +164,7 @@ FILE_PATTERNS = *.dox \
*.asm \
*.lnt
RECURSIVE = YES
EXCLUDE = ../include/qs_dummy.hpp \
../include/quit.hpp
EXCLUDE = ../include/qs_dummy.hpp
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS = QP_IMPL
@ -288,8 +288,9 @@ SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = Q_SPY \
QP_IMPL \
Q_UTEST \
QP_IMPL \
Q_EVT_CTOR \
QF_MAX_ACTIVE=32 \
QF_MAX_TICK_RATE=2 \
QF_MAX_EPOOL=3 \
@ -299,11 +300,10 @@ PREDEFINED = Q_SPY \
QF_MPOOL_CTR_SIZE=2 \
QF_TIMEEVT_CTR_SIZE=4 \
QF_ACTIVE_STOP=0 \
QF_ON_CONTEXT_SW \
QS_TIME_SIZE=4 \
QF_EQUEUE_TYPE=QEQueue \
QF_OS_OBJECT_TYPE=void* \
QF_THREAD_TYPE=void* \
QK_ON_CONTEXT_SW \
QXK_ON_CONTEXT_SW
QF_THREAD_TYPE=void*
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
SKIP_FUNCTION_MACROS = NO

View File

@ -15,220 +15,6 @@
//! failures when the switch Q_NASSERT is defined.
#define Q_NASSERT
//! The maximum number of active objects in the application.
//!
//! @description
//! This macro *must* be defined in the QF port and should be in range
//! of 1U..64U, inclusive. The value of this macro determines the maximum
//! priority level of an active object in the system. Not all priority
//! levels must be used, but the maximum priority cannot exceed
//! #QF_MAX_ACTIVE.
//!
//! @note Once you choose a certain value of #QF_MAX_ACTIVE, you must
//! consistently use the same value in building all the QP component libraries
//! and your own application code. The consistency is guaranteed if you define
//! this macro only once in the qf_port.hpp header file and henceforth include
//! this header file in all builds.
#define QF_MAX_ACTIVE 32U
//! The maximum number of clock tick rates in the application.
//!
//! @description
//! This macro can be defined in the QF ports and should be in range
//! of 1U..15U, inclusive. The value of this macro determines the maximum
//! number of clock tick rates for time events (::QTimeEvt).
//!
//! If the macro is not defined, the default value is 1U.
//!
//! @note Once you choose a certain value of #QF_MAX_TICK_RATE, you must
//! consistently use the same value in building all the QP component libraries
//! and your own application code. The consistency is guaranteed if you define
//! this macro only once in the qf_port.h header file and henceforth include
//! this header file in all builds.
#define QF_MAX_TICK_RATE 1U
//! The maximum number of event pools in the application.
//!
//! This macro should be defined in the QF port and should be in range
//! of 1..255, inclusive. The value of this macro determines the maximum
//! number of event pools in the system. Not all all these event pools must
//! actually be used by the applications, but the maximum number of pools
//! cannot exceed #QF_MAX_EPOOL.
//!
//! If the macro is not defined, the default value is 3
//!
//! @note Once you choose a certain value of #QF_MAX_EPOOL, you must
//! consistently use the same value in building all the QP component libraries
//! and your own application code. The consistency is guaranteed if you define
//! this macro only once in the qf_port.hpp header file and henceforth include
//! this header file in all builds.
#define QF_MAX_EPOOL 3U
//! The size (in bytes) of the event-size representation in the QF.
//! Valid values: 1U, 2U, or 4U; default 2U
//!
//! @description
//! This macro can be defined in the QF ports to configure the size
//! of the event-size.
//!
//! @note Once you choose a certain value of #QF_EVENT_SIZ_SIZE, you must
//! consistently use the same value in building all the QP component libraries
//! and your own application code. The consistency is guaranteed if you define
//! this macro only once in the qf_port.hpp header file and henceforth include
//! this header file in all builds.
#define QF_EVENT_SIZ_SIZE 2U
//! The size (in bytes) of the ring-buffer counters used in the native
//! QF event queue implementation. Valid values: 1U, 2U, or 4U; default 1U
//!
//! @description
//! This macro can be defined in the QF ports to configure the QP::QEQueueCtr
//! type. If the macro is not defined, the default of 1 byte will be chosen
//! in qequeue.hpp. The valid #QF_EQUEUE_CTR_SIZE values of 1U, 2U, or 4U,
//! correspond to QP::QEQueueCtr of uint8_t, uint16_t, and uint32_t,
//! respectively. The QP::QEQueueCtr data type determines the dynamic range
//! of numerical values of ring-buffer counters inside event queues, or,
//! in other words, the maximum number of events that the native QF event
//! queue can manage.
//! @sa QP::QEQueue
//!
//! @note Once you choose a certain value of #QF_EQUEUE_CTR_SIZE, you must
//! consistently use the same value in building all the QP component libraries
//! and your own application code. The consistency is guaranteed if you define
//! this macro only once in the qf_port.hpp header file and henceforth include
//! this header file in all builds.
#define QF_EQUEUE_CTR_SIZE 1U
//! The size (in bytes) of the block-size representation in the
//! native QF event pool. Valid values: 1U, 2U, or 4U; default 2U.
//! #QF_EVENT_SIZ_SIZE.
//!
//! @description
//! This macro can be defined in the QF ports to configure the QP::QMPoolSize
//! type. If the macro is not defined, the default of #QF_EVENT_SIZ_SIZE
//! will be chosen in qmpool.hpp, because the memory pool is primarily used for
//! implementing event pools.
//!
//! The valid #QF_MPOOL_SIZ_SIZE values of 1U, 2U, or 4U, correspond to
//! QP::QMPoolSize of uint8_t, uint16_t, and uint32_t, respectively. The
//! QP::QMPoolSize data type determines the dynamic range of block-sizes that
//! the native QP::QMPool can hanle.
//! @sa #QF_EVENT_SIZ_SIZE, QP::QMPool
//!
//! @note Once you choose a certain value of #QF_MPOOL_SIZ_SIZE, you must
//! consistently use the same value in building all the QP component libraries
//! and your own application code. The consistency is guaranteed if you define
//! this macro only once in the qf_port.hpp header file and henceforth include
//! this header file in all builds.
#define QF_MPOOL_SIZ_SIZE 2U
//! The size (in bytes) of the block-counter representation in the
//! native QF event pool. Valid values: 1U, 2U, or 4U; default 2U.
//!
//! @description
//! This macro can be defined in the QF ports to configure the QP::QMPoolCtr
//! type. If the macro is not defined, the default of 2 bytes will be chosen
//! in qmpool.hpp. The valid #QF_MPOOL_CTR_SIZE values of 1, 2, or 4, correspond
//! to QP::QMPoolSize of uint8_t, uint16_t, and uint32_t, respectively. The
//! QP::QMPoolCtr data type determines the dynamic range of block-counters that
//! the native QP::QMPool can handle, or, in other words, the maximum number
//! of blocks that the native QF event pool can manage.
//! @sa QP::QMPool
//!
//! @note Once you choose a certain value of #QF_MPOOL_CTR_SIZE, you must
//! consistently use the same value in building all the QP component libraries
//! and your own application code. The consistency is guaranteed if you define
//! this macro only once in the qf_port.hpp header file and henceforth include
//! this header file in all builds.
#define QF_MPOOL_CTR_SIZE 2U
//! The size (in bytes) of the time event -counter representation
//! in the QP::QTimeEvt class. Valid values: 1U, 2U, or 4U; default 2U.
//!
//! @description
//! This macro can be defined in the QF ports to configure the internal tick
//! counters of Time Events. If the macro is not defined, the default of 4
//! bytes will be chosen in qf.hpp. The valid #QF_TIMEEVT_CTR_SIZE values of
//! 1U, 2U, or 4U, correspond to tick counters of uint8_t, uint16_t, and
//! uint32_t, respectively. The tick counter representation determines the
//! dynamic range of time delays that a Time Event can handle.
//! @sa QP::QTimeEvt
//!
//! @note Once you choose a certain value of #QF_TIMEEVT_CTR_SIZE, you must
//! consistently use the same value in building all the QP component libraries
//! and your own application code. The consistency is guaranteed if you define
//! this macro only once in the qf_port.hpp header file and henceforth include
//! this header file in all builds.
#define QF_TIMEEVT_CTR_SIZE 4U
//! Size (in bytes) of the QS time stamp
//!
//! @description
//! This macro can be defined in the QS port file (qs_port.hpp) to configure
//! the QP::QSTimeCtr type. Valid values 1U, 2U, 4U. Default 4U.
#define QS_TIME_SIZE 4U
//! Define the interrupt disabling policy.
//!
//! @description
//! This macro encapsulates platform-specific way of disabling interrupts
//! from C++ for a given CPU and compiler.
//!
//! @note the #QF_INT_DISABLE macro should always be used in pair with the
//! macro #QF_INT_ENABLE.
//!
#define QF_INT_DISABLE() intDisable()
//! Define the interrupt enabling policy.
//!
//! @description
//! This macro encapsulates platform-specific way of enabling interrupts
//! from "C" for a given CPU and compiler.
//!
//! @note the #QF_INT_DISABLE macro should always be used in pair with the
//! macro #QF_INT_ENABLE.
//!
#define QF_INT_ENABLE() intEnable()
//! Define the type of the critical section status.
//!
//! @description
//! Defining this macro configures the "saving and restoring critical section
//! status" policy. Conversely, if this macro is not defined, the simple
//! "unconditional critical section exit" is used.
//!
#define QF_CRIT_STAT_TYPE unsigned
//! Define the critical section entry policy.
//!
//! This macro enters a critical section (often by means of disabling
//! interrupts). When the "saving and restoring critical section status"
//! policy is used, the macro sets the \a status_ argument to the critical
//! section status just before the entry. When the policy of "unconditional
//! critical section exit" is used, the macro does not use the \a status_
//! argument.
//!
//! @note the #QF_CRIT_ENTRY macro should always be used in pair with the
//! macro #QF_CRIT_EXIT.
//!
#define QF_CRIT_ENTRY(stat_) ((stat_) = critEntry())
//! Define the critical section exit policy.
//!
//! @description
//! This macro enters a critical section (often by means of disabling
//! interrupts). When the "saving and restoring critical section status"
//! policy is used, the macro restores the critical section status from the
//! @a status_ argument. When the policy of "unconditional critical section
//! exit" is used, the macro does not use the \a status argument and
//! exits the critical section unconditionally (often by means of enabling
//! interrupts).
//!
//! @note the #QF_CRIT_ENTRY macro should always be used in pair with the
//! macro #QF_CRIT_EXIT.
//!
#define QF_CRIT_EXIT(stat_) critExit(stat_)
//! Enable the QActive::stop() API in the QF port.
//!
//! @description
@ -270,119 +56,9 @@
//! not generate any code.
#define Q_SPY
//! The preprocessor switch to activate the QUTest unit testing
//! instrumentation in the code
//!
//! @note
//! This macro requires that #Q_SPY be defined as well.
#define Q_UTEST
//! This macro defines the type of the thread handle used for AOs
#define QF_THREAD_TYPE void*
//! This macro defines the type of the event-queue used for AOs
#define QF_EQUEUE_TYPE QEQueue
//! This macro defines the type of the OS-Object used for blocking
//! the native ::QEQueue when the queue is empty
//!
//! @description
//! This macro is used when ::QEQueue is used as the event-queue for AOs
//! but also the AO queue must *block* when the queue is empty.
//! In that case, #QF_OS_OBJECT_TYPE specifies the blocking mechanism.
//! For examle, in the POSIX port, the blocking mechanism is a condition
//! variable.
//!
#define QF_OS_OBJECT_TYPE pthread_cond_t
//! Platform-dependent macro defining how QF should block the calling
//! task when the QF native queue is empty
//!
//! @note
//! This is just an example of #QACTIVE_EQUEUE_WAIT_ for the QK-port
//! of QF. QK never activates a task that has no events to process, so in this
//! case the macro asserts that the queue is not empty. In other QF ports you
//! need to define the macro appropriately for the underlying kernel/OS you're
//! using.
#define QACTIVE_EQUEUE_WAIT_(me_) \
Q_ASSERT((me_)->m_eQueue.m_frontEvt != nullptr)
//! Platform-dependent macro defining how QF should signal the
//! active object task that an event has just arrived.
//!
//! @description
//! The macro is necessary only when the native QF event queue is used.
//! The signaling of task involves unblocking the task if it is blocked.
//!
//! @note #QACTIVE_EQUEUE_SIGNAL_ is called from a critical section.
//! It might leave the critical section internally, but must restore
//! the critical section before exiting to the caller.
//!
//! @note This is just an example of #QACTIVE_EQUEUE_SIGNAL_ for the QK-port
//! of QF. In other QF ports you need to define the macro appropriately for
//! the underlying kernel/OS you're using.
#define QACTIVE_EQUEUE_SIGNAL_(me_) do { \
QF::readySet_.insert((me_)->m_prio); \
if (QF::intNest_ == 0U) { \
uint8_t p = QK_schedPrio_(); \
if (p != 0U) { \
QK_sched_(p); \
} \
} \
} while (false)
//! This macro defines the type of the event pool used in this QF port.
//!
//! @note
//! This is a specific implementation for the QK-port of QF.
//! In other QF ports you need to define the macro appropriately for
//! the underlying kernel/OS you're using.
#define QF_EPOOL_TYPE_ QMPool
//! This macro enables calling the QK context-switch callback
//! QK_onContextSw()
#define QK_ON_CONTEXT_SW
//! This macro enables calling the QXK context-switch callback
//! QXK_onContextSw()
#define QXK_ON_CONTEXT_SW
//! Platform-dependent macro defining the event pool initialization
//!
//! @note
//! This is 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_INIT_(p_, poolSto_, poolSize_, evtSize_) \
(p_).init((poolSto_), (poolSize_), static_cast<QMPoolSize>(evtSize_))
//! Platform-dependent macro defining how QF should obtain the
//! event pool block-size
//!
//! @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_EVENT_SIZE_(p_) static_cast<uint32_t>((p_).getBlockSize())
//! Platform-dependent macro defining how QF should obtain an event
//! @a e_ from the event pool @a p_
//!
//! @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_, 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_
//!
//! @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_, qs_id_) ((p_).put((e_), (qs_id_)))
//! QF_onContextSw()
#define QF_ON_CONTEXT_SW
//! 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

View File

@ -16,7 +16,7 @@ The QP&trade;/C++ <span class="img folder">src</span> directory needs to be adde
*/
/*##########################################################################*/
/*! @dir src/qf
@brief Platform-independent implementation of the @ref qep and @ref qf components.
@brief Platform-independent implementation of the QEP and QF components.
@note
Typically, files in this directory need to be added to the application build, but some QP ports might not need all the files in this directory. For example, a QP port to a 3rd-party RTOS kernel might be using a message queue of the RTOS instead of the native QP event queue, in which case the file qf_actq.c would not be needed and should be excluded from the build.
@ -44,15 +44,5 @@ Files in this directory need to be included in the QP application build only if
*/
/*##########################################################################*/
/*! @dir src/qs
@brief Platform-independent implementation of the @ref qs component (software tracing).
*/
/*##########################################################################*/
/*! @dir test
@brief System-level tests of the QP/C++ framework itself.
@@note
The `qpcpp/test/` directory is planned to contain a growing number of system-level tests, which are based on QUTest, but *without* the QP-stub. The tests take advantage of the new QUTest configuration, where the QP-stub is NOT included (because the actual QP framework is linked). This configuration is activated by defining macro `Q_UTEST=0`.
@attention
Many tests provided in the `qpcpp/test/` directory run only on embedded targets and cannot run on the host machine.
@brief Platform-independent implementation of the QS component (software tracing).
*/

View File

@ -14,7 +14,9 @@ The main purpose of integrating QP/C++ with conventional RTOSes is to enable you
@note
You do **not** need to use a third-party RTOS just to achieve preemptive multitasking with QP/C++. The framework contains a selection of built-in real-time kernels, such as the cooperative @ref srs_qv "QV kernel", the preemptive non-blocking @ref srs_qk "QK kernel", and the preemptive, dual-mode, blocking @ref srs_qxk "QXK kernel". Specifically, the QXK kernel has been designed specifically for mixing event-driven active objects with traditional **blocking code**, such as commercial middleware (TCP/IP stacks, UDP stacks, embedded file systems, etc.) or legacy software.
@next{exa_embos examples}
@ifnot LATEX
@nav_next{exa_embos}
@endif
*/
/*##########################################################################*/
@ -28,14 +30,18 @@ The QP/C++ examples for SEGGER embOS are as follows:
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@next{embos_dpp_nucleo-h743zi}
@ifnot LATEX
@nav_next{embos_dpp_nucleo-h743zi}
@endif
*/
/*##########################################################################*/
/*! @page embos_dpp_nucleo-h743zi DPP on NUCLEO-H743ZI
The @ref dpp "DPP example" for embOS on NUCLEO-H743ZI board is located directory <span class="img folder">examples/embos/arm-cm/dpp_nucleo-h743zi</span>.
@image html bd_NUCLEO-H743ZI.jpg NUCLEO-H743ZI
@image html bd_NUCLEO-H743ZI.jpg
@image latex bd_NUCLEO-H743ZI.jpg width=4.5in
@caption{NUCLEO-H743ZI}
@ref dpp "Dining Philosophers Problem (DPP)" example for NUCLEO-H743ZI MCU (Cortex-M7).
@ -68,7 +74,9 @@ qspy -c COM4
The actual COM port number might be different on your Windows machine. Please check the Device Manager to find the COM port number.
@next{exa_freertos examples}
@ifnot LATEX
@nav_next{exa_freertos}
@endif
*/
/*##########################################################################*/
@ -85,12 +93,16 @@ The QP/C++ examples for FreeRTOS are as follows:
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@next{exa_os examples}
@ifnot LATEX
@nav_next{exa_os}
@endif
*/
/*##########################################################################*/
/*! @page freertos_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
@image html bd_EK-TM4C123GXL.jpg EK-TM4C123GXL board
@image html bd_EK-TM4C123GXL.jpg
@image latex bd_EK-TM4C123GXL.jpg width=2.5in
@caption{EK-TM4C123GXL (TivaC LaunchPad)}
@ref dpp "DPP example" for @ref freertos "FreeRTOS" on Texas Instruments TivaC123GXL MCU (Cortex-M4F) with the following toolchains:
- ARM-Keil
@ -110,12 +122,16 @@ Demonstrated features:
- QP/Spy input over the virtual COM port (bi-directional Spy) (Spy build configuration)
@next{freertos_dpp_stm32f746g-disco examples}
@ifnot LATEX
@nav_next{freertos_dpp_stm32f746g-disco}
@endif
*/
/*##########################################################################*/
/*! @page freertos_dpp_stm32f746g-disco DPP on STM32F746G-Discovery
@image html bd_STM32F746G-Disco.jpg STM32F746G-Discovery
@image html bd_STM32F746G-Disco.jpg
@image latex bd_STM32F746G-Disco.jpg width=4.75in
@caption{STM32F746G-Discovery}
@ref dpp "DPP example" for @ref freertos "FreeRTOS" on STM32F746G-Discovery MCU (Cortex-M7) with the following toolchains:
- ARM-Keil
@ -134,13 +150,16 @@ Demonstrated features:
- QP/Spy output over the virtual COM port (Spy build configuration)
- QP/Spy input over the virtual COM port (bi-directional Spy) (Spy build configuration)
@next{freertos_dpp_nucleo-h743zi}
@ifnot LATEX
@nav_next{freertos_dpp_nucleo-h743zi}
@endif
*/
/*##########################################################################*/
/*! @page freertos_dpp_nucleo-h743zi DPP on NUCLEO-H743ZI
@image html bd_NUCLEO-H743ZI.jpg NUCLEO-H743ZI
@image html bd_NUCLEO-H743ZI.jpg
@image latex bd_NUCLEO-H743ZI.jpg width=4.5in
@caption{NUCLEO-H743ZI}
@ref dpp "Dining Philosophers Problem (DPP)" example for NUCLEO-H743ZI MCU (Cortex-M7).
@ -149,12 +168,16 @@ Features:
- [QP/Spy software tracing](https://www.state-machine.com/qtools/qpspy.html) using the virtual COM-port
- bi-directional [QP/Spy](https://www.state-machine.com/qtools/qs.html#qs_rx) (sending commands to the target)
@next{freertos_start-stop_nucleo-h743zi}
@ifnot LATEX
@nav_next{freertos_start-stop_nucleo-h743zi}
@endif
*/
/*##########################################################################*/
/*! @page freertos_start-stop_nucleo-h743zi Start-Stop on NUCLEO-H743ZI
@image html bd_NUCLEO-H743ZI.jpg NUCLEO-H743ZI
@image html bd_NUCLEO-H743ZI.jpg
@image latex bd_NUCLEO-H743ZI.jpg width=4.5in
@caption{NUCLEO-H743ZI}
Start-Stop example for NUCLEO-H743ZI MCU (Cortex-M7) demonstrates staring and stopping active objects multiple times
during the runtime, as opposed to starting AOs only at the beginning.
@ -167,7 +190,10 @@ The start-stop application consists of two AOs:
- the Worker AO is NOT started at the beginning, but instead it is instantiated and started by the Launcher AO.
![Launcher and Worker state machines](start-stop.png)
@image html start-stop.png
@image latex start-stop.png width=5.0in
@caption{Launcher and Worker state machines}
The actual visible work is performed by the Worker AO, which blinks the yellow LED (LD1) on the NUCLEO-H743ZI board. After blinking the LED five times, the Worker AO publishes turns the blue LED (LD2), publishes the DONE event and stops itself (by calling QP::QActive::stop() on itself).
@ -184,7 +210,7 @@ Because this application is intended for embedded real-time systems, it does not
It is possible to use the standard **new** and **delete** operators with the standard heap, or some customized memory allocation (overloaded new/delete). This goes beyond the scope of this example.
**Supported Toolchains** @n
**Supported Toolchains**<br>
This example contains sub-directories for building it with various toolchains. The following toolchains are supported:
- ARM-Keil MDK
@ -194,7 +220,7 @@ This example contains sub-directories for building it with various toolchains. T
Please refer to the README.txt files in these sub-directories for more information about building and running the examples.
**QP/Spy Support** @n
**QP/Spy Support**<br>
This example demonstrates the [QP/Spy software tracing](https://www.state-machine.com/qtools/qpspy.html) in the **Spy build configuration**. The QP/Spy uses the virtual COM port provided by the NUCLEO-H743ZI board. To see the QP/Spy output, you need to launch the qspy host utility, as follows (Windows command prompt):
@verbatim
@ -204,7 +230,7 @@ qspy -u -c COM4
where COM4 is the particular virtual serial port registered by your NUCLEO board. You need to adjust the COM port number for your machine.
**Programming the NUCLEO Board** @n
**Programming the NUCLEO Board**<br>
The NUCLEO boards appear as a USB-flash drive in the file system. Programming of the board is done by simply copying the binary into
thy flash drive letter.
@ -221,7 +247,9 @@ copy dbg\start-stop.bin E:
- [QP/Spy software tracing](https://www.state-machine.com/qtools/qpspy.html) using the virtual COM-port
- bi-directional [QP/Spy](https://www.state-machine.com/qtools/qs.html#qs_rx) (sending commands to the target)
@next{exa_threadx examples}
@ifnot LATEX
@nav_next{exa_threadx}
@endif
*/
/*##########################################################################*/
@ -235,12 +263,16 @@ The QP/C++ examples for ThreadX (Express Logic) are as follows:
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@next{exa_uc-os2 examples}
@ifnot LATEX
@nav_next{exa_uc-os2}
@endif
*/
/*##########################################################################*/
/*! @page threadx_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
@image html bd_EK-TM4C123GXL.jpg "EK-TM4C123GXL (TivaC LaunchPad) board"
@image html bd_EK-TM4C123GXL.jpg
@image latex bd_EK-TM4C123GXL.jpg width=2.5in
@caption{EK-TM4C123GXL (TivaC LaunchPad)}
@ref dpp "DPP example" for ThreadX on Texas Instruments TivaC123GXL MCU (Cortex-M4F) with the following toolchain:
- IAR-ARM
@ -250,15 +282,18 @@ Demonstrated features:
- QP/Spy output over the virtual COM port (Spy build configuration)
- QP/Spy input over the virtual COM port (bi-directional Spy) (Spy build configuration)
@next{threadx_dpp_stm32f429-discovery examples}
@ifnot LATEX
@nav_next{threadx_dpp_stm32f429-discovery}
@endif
*/
/*##########################################################################*/
/*! @page threadx_dpp_stm32f429-discovery DPP on STM32F4-Discovery
The @ref dpp "DPP example" for ThreadX on STM32F4-Discovery board is located directory <span class="img folder">examples/threadx/arm-cm/dpp_stm32f429-discovery</span>.
@image html bd_STM32F4-Discovery.jpg "STM32F4-Discovery board"
@image html bd_STM32F4-Disco.jpg
@image latex bd_STM32F4-Disco.jpg width=2.8in
@caption{STM32F4-Discovery}
The sub-directory <span class="img folder">iar</span> contains the workspace and project file that you can open in IAR EWARM IDE.
@ -278,7 +313,9 @@ VDD | VCC
GND | GND
</center>
@image html bd_STM32F4-Discovery_RS232.jpg STM32F4-Discovery board connected to RS232 level shifter
@image html bd_STM32F4-Disco.jpg
@image latex bd_STM32F4-Disco.jpg width=2.8in
@caption{STM32F4-Discovery}
The output is generated at 115200 baud rate.
@ -290,7 +327,9 @@ qspy -cCOM1
The actual COM port number might be different on your Windows machine. Please check the Device Manager to find the COM port number.
@next{exa_uc-os2 examples}
@ifnot LATEX
@nav_next{exa_uc-os2}
@endif
*/
/*##########################################################################*/
@ -305,29 +344,41 @@ The QP/C++ examples for uC-OS2 are as follows:
@note
You can hover the mouse cursor over the <span class="board"></span>&nbsp;&nbsp; icon in the list below to see the picture of the board.
@next{exa_os examples}
@ifnot LATEX
@nav_next{exa_os}
@endif
*/
/*##########################################################################*/
/*! @page uc-os2_dpp_ek-tm4c123gxl DPP on EK-TM4C123GXL
@image html bd_EK-TM4C123GXL.jpg "EK-TM4C123GXL board"
@image html bd_EK-TM4C123GXL.jpg
@image latex bd_EK-TM4C123GXL.jpg width=2.5in
@caption{EK-TM4C123GXL (TivaC LaunchPad)}
DPP example for Texas Instruments TivaC123GXL MCU (Cortex-M4F) and ARM-CLANG, GNU-ARM and IAR EWARM toolsets.
@image html under_construction.jpg
@image html under-constr.png
@image latex under-constr.png width=1in
@next{uc-os2_dpp_nucleo-l053r8 examples}
@ifnot LATEX
@nav_next{uc-os2_dpp_nucleo-l053r8}
@endif
*/
/*##########################################################################*/
/*! @page uc-os2_dpp_nucleo-l053r8 DPP on STM32-NUCLEO-L053R8
@image html bd_NUCLEO-L053R8.jpg "STM32-NUCLEO-L053R8 board"
@image html bd_NUCLEO-L053R8.jpg
@image latex bd_NUCLEO-L053R8.jpg width=2.5in
@caption{NUCLEO-L053R8}
DPP example for STM32 L053R8 MCU (Cortex-M0+) and ARM-CLANG, GNU-ARM and IAR EWARM toolsets.
@image html under_construction.jpg
@image html under-constr.png
@image latex under-constr.png width=1in
@next{exa_zephyr examples}
@ifnot LATEX
@nav_next{exa_zephyr}
@endif
*/
/*##########################################################################*/
@ -338,7 +389,9 @@ The QP/C++ examples for Zephyr are as follows:
- @subpage zephyr_blinky
- @subpage zephyr_dpp
@next{zephyr_blinky}
@ifnot LATEX
@nav_next{zephyr_blinky}
@endif
*/
/*##########################################################################*/
/*! @page zephyr_blinky Blinky
@ -389,12 +442,15 @@ The "Blinky" example blinks an on-board LED once per second. The blinking is don
@remark
The example has been tested with the following boards:
![STM32-NUCLEO-L053R8 board](bd_NUCLEO-L053R8.jpg)
@image html bd_NUCLEO-L053R8.jpg
@image latex bd_NUCLEO-L053R8.jpg width=2.5in
@caption{NUCLEO-L053R8}
<br>
![STM32-NUCLEO-H743ZI board](bd_NUCLEO-H743ZI.jpg)
@image html bd_NUCLEO-H743ZI.jpg
@image latex bd_NUCLEO-H743ZI.jpg width=4.5in
@caption{NUCLEO-H743ZI}
@note
The example should also work with most boards supported by Zephyr.
@ -416,7 +472,9 @@ BSP::ledOff
@section zephyr_blinky-limits Limitations
The simple Blinky example does not support the QS software tracing.
@next{zephyr_dpp}
@ifnot LATEX
@nav_next{zephyr_dpp}
@endif
*/
/*##########################################################################*/
/*! @page zephyr_dpp DPP
@ -467,12 +525,15 @@ DPP example with multiple active objects.
@remark
The example has been tested with the following boards:
![STM32-NUCLEO-L053R8 board](bd_NUCLEO-L053R8.jpg)
@image html bd_NUCLEO-L053R8.jpg
@image latex bd_NUCLEO-L053R8.jpg width=2.5in
@caption{NUCLEO-L053R8}
<br>
![STM32-NUCLEO-H743ZI board](bd_NUCLEO-H743ZI.jpg)
@image html bd_NUCLEO-H743ZI.jpg
@image latex bd_NUCLEO-H743ZI.jpg width=4.5in
@caption{NUCLEO-H743ZI}
@note
The example should also work with most boards supported by Zephyr.
@ -545,7 +606,7 @@ qspy -c /dev/ttyACM0
@endverbatim
@subsection @section zephyr_dpp-qs-output QSPY Output Example
@subsection zephyr_dpp-qs-output QSPY Output Example
After resetting the board, you should see output similar to the following:
@verbatim
########## Trg-RST QP-Ver=701,Build=220810_150847
@ -619,6 +680,8 @@ After resetting the board, you should see output similar to the following:
0000000371 PHILO_STAT 3 thinking
@endverbatim
@next{exa_os}
@ifnot LATEX
@nav_next{exa_os}
@endif
*/
} // namespace QP

View File

@ -2,31 +2,31 @@
================================================
NLOC CCN token PARAM length location
------------------------------------------------
3 1 13 1 4 QP::QEvt::QEvt@183-186@..\include\qep.hpp
7 1 27 2 7 QP::QEvt::QEvt@192-198@..\include\qep.hpp
2 1 6 0 3 QP::QEvt::~QEvt@204-206@..\include\qep.hpp
2 1 6 0 3 QP::QHsm::~QHsm@375-377@..\include\qep.hpp
3 1 17 1 3 QP::QHsm::init@406-408@..\include\qep.hpp
3 1 12 0 3 QP::QHsm::state@455-457@..\include\qep.hpp
3 1 11 0 3 QP::QHsm::getStateHandler@462-464@..\include\qep.hpp
4 1 18 1 4 QP::QHsm::tran@494-497@..\include\qep.hpp
4 1 18 1 4 QP::QHsm::tran_hist@500-503@..\include\qep.hpp
4 1 18 1 4 QP::QHsm::super@506-509@..\include\qep.hpp
4 1 30 1 4 QP::QHsm::qm_tran@513-516@..\include\qep.hpp
4 1 30 1 4 QP::QHsm::qm_tran_init@520-523@..\include\qep.hpp
8 1 42 2 8 QP::QHsm::qm_tran_hist@527-534@..\include\qep.hpp
4 1 30 1 4 QP::QHsm::qm_tran_ep@538-541@..\include\qep.hpp
8 1 40 2 8 QP::QHsm::qm_tran_xp@545-552@..\include\qep.hpp
4 1 20 1 4 QP::QHsm::qm_entry@557-560@..\include\qep.hpp
4 1 22 1 4 QP::QHsm::qm_entry@566-569@..\include\qep.hpp
4 1 20 1 4 QP::QHsm::qm_exit@575-578@..\include\qep.hpp
4 1 22 1 4 QP::QHsm::qm_exit@584-587@..\include\qep.hpp
4 1 20 1 4 QP::QHsm::qm_sm_exit@591-594@..\include\qep.hpp
4 1 20 1 4 QP::QHsm::qm_super_sub@598-601@..\include\qep.hpp
6 1 26 1 6 QP::QMsm::QMsm@687-692@..\include\qep.hpp
3 1 20 1 3 QP::QMsm::init@705-707@..\include\qep.hpp
3 1 12 0 3 QP::QMsm::stateObj@750-752@..\include\qep.hpp
3 1 14 0 3 QP::QMsm::getStateHandler@782-784@..\include\qep.hpp
3 1 13 1 4 QP::QEvt::QEvt@182-185@..\include\qep.hpp
7 1 27 2 7 QP::QEvt::QEvt@190-196@..\include\qep.hpp
2 1 6 0 3 QP::QEvt::~QEvt@201-203@..\include\qep.hpp
2 1 6 0 3 QP::QHsm::~QHsm@373-375@..\include\qep.hpp
3 1 17 1 3 QP::QHsm::init@404-406@..\include\qep.hpp
3 1 12 0 3 QP::QHsm::state@453-455@..\include\qep.hpp
3 1 11 0 3 QP::QHsm::getStateHandler@459-461@..\include\qep.hpp
4 1 18 1 4 QP::QHsm::tran@491-494@..\include\qep.hpp
4 1 18 1 4 QP::QHsm::tran_hist@497-500@..\include\qep.hpp
4 1 18 1 4 QP::QHsm::super@503-506@..\include\qep.hpp
4 1 30 1 4 QP::QHsm::qm_tran@510-513@..\include\qep.hpp
4 1 30 1 4 QP::QHsm::qm_tran_init@517-520@..\include\qep.hpp
8 1 42 2 8 QP::QHsm::qm_tran_hist@524-531@..\include\qep.hpp
4 1 30 1 4 QP::QHsm::qm_tran_ep@535-538@..\include\qep.hpp
8 1 40 2 8 QP::QHsm::qm_tran_xp@542-549@..\include\qep.hpp
4 1 20 1 4 QP::QHsm::qm_entry@553-556@..\include\qep.hpp
4 1 22 1 4 QP::QHsm::qm_entry@561-564@..\include\qep.hpp
4 1 20 1 4 QP::QHsm::qm_exit@569-572@..\include\qep.hpp
4 1 22 1 4 QP::QHsm::qm_exit@577-580@..\include\qep.hpp
4 1 20 1 4 QP::QHsm::qm_sm_exit@584-587@..\include\qep.hpp
4 1 20 1 4 QP::QHsm::qm_super_sub@591-594@..\include\qep.hpp
6 1 26 1 6 QP::QMsm::QMsm@680-685@..\include\qep.hpp
3 1 20 1 3 QP::QMsm::init@698-700@..\include\qep.hpp
3 1 12 0 3 QP::QMsm::stateObj@743-745@..\include\qep.hpp
3 1 14 0 3 QP::QMsm::getStateHandler@774-776@..\include\qep.hpp
3 1 10 0 3 QP::QEQueue::getNFree@289-291@..\include\qequeue.hpp
3 1 10 0 3 QP::QEQueue::getNMin@304-306@..\include\qequeue.hpp
3 1 12 0 3 QP::QEQueue::isEmpty@318-320@..\include\qequeue.hpp
@ -37,18 +37,18 @@
11 3 101 1 14 QP::QPSet::insert@273-286@..\include\qf.hpp
12 3 117 1 15 QP::QPSet::remove@289-303@..\include\qf.hpp
6 3 45 0 9 QP::QPSet::findMax@306-314@..\include\qf.hpp
9 1 49 5 9 QP::QActive::start@478-486@..\include\qf.hpp
3 1 10 0 3 QP::QActive::getPrio@711-713@..\include\qf.hpp
4 1 38 1 4 QP::QActive::setPrio@718-721@..\include\qf.hpp
3 1 9 0 3 QP::QActive::getOsObject@734-736@..\include\qf.hpp
9 1 49 5 9 QP::QActive::start@481-489@..\include\qf.hpp
3 1 18 0 3 QP::QActive::getPrio@713-715@..\include\qf.hpp
4 1 38 1 4 QP::QActive::setPrio@720-723@..\include\qf.hpp
3 1 9 0 3 QP::QActive::getOsObject@735-737@..\include\qf.hpp
3 1 9 0 3 QP::QActive::getThread@743-745@..\include\qf.hpp
5 1 20 1 5 QP::QMActive::QMActive@897-901@..\include\qf.hpp
3 1 12 0 3 QP::QMActive::stateObj@922-924@..\include\qf.hpp
3 1 10 0 3 QP::QTimeEvt::getAct@1118-1120@..\include\qf.hpp
3 1 10 0 3 QP::QTimeEvt::getCtr@1123-1125@..\include\qf.hpp
3 1 10 0 3 QP::QTimeEvt::getInterval@1128-1130@..\include\qf.hpp
3 1 16 0 3 QP::QTimeEvt::toActive@1187-1189@..\include\qf.hpp
3 1 16 0 3 QP::QTimeEvt::toTimeEvt@1192-1194@..\include\qf.hpp
5 1 20 1 5 QP::QMActive::QMActive@895-899@..\include\qf.hpp
3 1 12 0 3 QP::QMActive::stateObj@920-922@..\include\qf.hpp
3 1 10 0 3 QP::QTimeEvt::getAct@1115-1117@..\include\qf.hpp
3 1 10 0 3 QP::QTimeEvt::getCtr@1120-1122@..\include\qf.hpp
3 1 10 0 3 QP::QTimeEvt::getInterval@1125-1127@..\include\qf.hpp
3 1 16 0 3 QP::QTimeEvt::toActive@1182-1184@..\include\qf.hpp
3 1 16 0 3 QP::QTimeEvt::toTimeEvt@1187-1189@..\include\qf.hpp
6 1 23 2 6 QP::QF::psInit@1348-1353@..\include\qf.hpp
7 1 34 3 7 QP::QF::publish_@1360-1366@..\include\qf.hpp
6 1 26 2 6 QP::QF::tick_@1373-1378@..\include\qf.hpp
@ -56,11 +56,11 @@
3 1 29 1 3 QP::QEvt_refCtr_dec_@117-119@..\include\qf_pkg.hpp
3 1 10 0 3 QP::QMPool::getNMin@263-265@..\include\qmpool.hpp
3 1 10 0 3 QP::QMPool::getNFree@275-277@..\include\qmpool.hpp
3 1 18 0 3 QP::QSpyId::getPrio@315-317@..\include\qs.hpp
7 1 28 1 7 QP::QS::force_cast@399-405@..\include\qs.hpp
14 3 70 1 14 QP::QS::rxPut@805-818@..\include\qs.hpp
9 1 49 5 9 QP::QActiveDummy::start@1517-1525@..\include\qs.hpp
3 1 18 0 3 QP::QSpyId::getPrio@134-136@..\include\qs_dummy.hpp
3 1 18 0 3 QP::QSpyId::getPrio@335-337@..\include\qs.hpp
7 1 28 1 7 QP::QS::force_cast@417-423@..\include\qs.hpp
14 3 70 1 14 QP::QS::rxPut@831-844@..\include\qs.hpp
9 1 49 5 9 QP::QActiveDummy::start@1573-1581@..\include\qs.hpp
3 1 18 0 3 QP::QSpyId::getPrio@137-139@..\include\qs_dummy.hpp
3 1 11 0 3 QP::QXThread::getTimeEvt@208-210@..\include\qxk.hpp
9 1 49 5 9 QP::QXThread::start@310-318@..\include\qxk.hpp
2 1 39 2 3 QP::QEvt@86-88@..\src\qf\qep_hsm.cpp
@ -68,19 +68,19 @@
17 3 102 3 20 hsm_state_entry_@117-136@..\src\qf\qep_hsm.cpp
23 3 114 3 26 hsm_state_exit_@148-173@..\src\qf\qep_hsm.cpp
4 1 27 1 4 QP::QHsm::QHsm@183-186@..\src\qf\qep_hsm.cpp
50 7 325 2 73 QP::QHsm::init@189-261@..\src\qf\qep_hsm.cpp
103 15 609 2 158 QP::QHsm::dispatch@264-421@..\src\qf\qep_hsm.cpp
8 1 31 2 8 QP::QHsm::top@424-431@..\src\qf\qep_hsm.cpp
16 3 87 1 22 QP::QHsm::isIn@434-455@..\src\qf\qep_hsm.cpp
20 4 107 1 29 QP::QHsm::childState@458-486@..\src\qf\qep_hsm.cpp
90 15 487 2 132 QP::QHsm::hsm_tran@489-620@..\src\qf\qep_hsm.cpp
54 9 359 2 78 QP::QHsm::init@189-266@..\src\qf\qep_hsm.cpp
103 15 609 2 158 QP::QHsm::dispatch@269-426@..\src\qf\qep_hsm.cpp
8 1 31 2 8 QP::QHsm::top@429-436@..\src\qf\qep_hsm.cpp
16 3 87 1 22 QP::QHsm::isIn@439-460@..\src\qf\qep_hsm.cpp
20 4 107 1 29 QP::QHsm::childState@463-491@..\src\qf\qep_hsm.cpp
90 15 487 2 132 QP::QHsm::hsm_tran@494-625@..\src\qf\qep_hsm.cpp
25 3 165 2 38 QP::QMsm::init@79-116@..\src\qf\qep_msm.cpp
116 21 658 2 168 QP::QMsm::dispatch@119-286@..\src\qf\qep_msm.cpp
13 3 59 1 14 QP::QMsm::isInState@289-302@..\src\qf\qep_msm.cpp
19 4 87 1 26 QP::QMsm::childStateObj@305-330@..\src\qf\qep_msm.cpp
51 9 294 2 62 QP::QMsm::execTatbl_@333-394@..\src\qf\qep_msm.cpp
22 4 107 3 29 QP::QMsm::exitToTranSource_@397-425@..\src\qf\qep_msm.cpp
44 6 227 2 55 QP::QMsm::enterHistory_@428-482@..\src\qf\qep_msm.cpp
117 21 664 2 169 QP::QMsm::dispatch@119-287@..\src\qf\qep_msm.cpp
13 3 59 1 14 QP::QMsm::isInState@290-303@..\src\qf\qep_msm.cpp
28 7 137 1 35 QP::QMsm::childStateObj@306-340@..\src\qf\qep_msm.cpp
51 9 294 2 62 QP::QMsm::execTatbl_@343-404@..\src\qf\qep_msm.cpp
22 4 107 3 29 QP::QMsm::exitToTranSource_@407-435@..\src\qf\qep_msm.cpp
44 6 227 2 55 QP::QMsm::enterHistory_@438-492@..\src\qf\qep_msm.cpp
82 14 410 3 120 QP::QActive::post_@77-196@..\src\qf\qf_actq.cpp
42 7 237 1 63 QP::QActive::postLIFO@204-266@..\src\qf\qf_actq.cpp
34 3 205 0 45 QP::QActive::get_@274-318@..\src\qf\qf_actq.cpp
@ -138,25 +138,25 @@
20 4 129 1 32 QP::QK::schedUnlock@110-141@..\src\qk\qk.cpp
14 3 144 0 25 QP::QF::init@151-175@..\src\qk\qk.cpp
3 1 9 0 4 QP::QF::stop@178-181@..\src\qk\qk.cpp
15 4 62 0 25 QP::QF::run@184-208@..\src\qk\qk.cpp
25 3 146 6 34 QP::QActive::start@219-252@..\src\qk\qk.cpp
19 4 93 0 24 QK_sched_@265-288@..\src\qk\qk.cpp
65 17 428 0 112 QK_activate_@291-402@..\src\qk\qk.cpp
19 6 85 0 34 QP::QF::run@184-217@..\src\qk\qk.cpp
25 3 146 6 34 QP::QActive::start@228-261@..\src\qk\qk.cpp
19 4 93 0 24 QK_sched_@274-297@..\src\qk\qk.cpp
65 17 424 0 112 QK_activate_@300-411@..\src\qk\qk.cpp
7 3 66 0 13 QP::QF::init@83-95@..\src\qv\qv.cpp
3 1 9 0 4 QP::QF::stop@98-101@..\src\qv\qv.cpp
38 10 197 0 75 QP::QF::run@104-178@..\src\qv\qv.cpp
18 1 114 6 25 QP::QActive::start@189-213@..\src\qv\qv.cpp
45 15 248 0 92 QP::QF::run@104-195@..\src\qv\qv.cpp
18 1 114 6 25 QP::QActive::start@206-230@..\src\qv\qv.cpp
24 3 152 1 35 QP::QXK::schedLock@77-111@..\src\qxk\qxk.cpp
20 4 129 1 32 QP::QXK::schedUnlock@114-145@..\src\qxk\qxk.cpp
14 3 144 0 25 QP::QF::init@155-179@..\src\qxk\qxk.cpp
3 1 9 0 4 QP::QF::stop@182-185@..\src\qxk\qxk.cpp
17 4 84 0 29 QP::QF::run@188-216@..\src\qxk\qxk.cpp
29 5 159 6 40 QP::QActive::start@227-266@..\src\qxk\qxk.cpp
43 8 230 0 54 QXK_sched_@279-332@..\src\qxk\qxk.cpp
59 16 406 0 98 QXK_activate_@335-432@..\src\qxk\qxk.cpp
12 2 69 0 18 QXK_current@435-452@..\src\qxk\qxk.cpp
23 7 130 1 34 QXK_contextSw@456-489@..\src\qxk\qxk.cpp
14 2 110 0 23 QXK_threadExit_@493-515@..\src\qxk\qxk.cpp
20 6 103 0 36 QP::QF::run@188-223@..\src\qxk\qxk.cpp
29 5 159 6 40 QP::QActive::start@234-273@..\src\qxk\qxk.cpp
43 8 230 0 54 QXK_sched_@286-339@..\src\qxk\qxk.cpp
59 16 382 0 98 QXK_activate_@342-439@..\src\qxk\qxk.cpp
12 2 69 0 18 QXK_current@442-459@..\src\qxk\qxk.cpp
19 5 105 1 26 QXK_contextSw@463-488@..\src\qxk\qxk.cpp
14 2 110 0 23 QXK_threadExit_@492-514@..\src\qxk\qxk.cpp
3 1 15 0 3 QP::QXMutex::QXMutex@76-78@..\src\qxk\qxk_mutex.cpp
8 2 54 1 11 QP::QXMutex::init@81-91@..\src\qxk\qxk_mutex.cpp
61 9 422 0 95 QP::QXMutex::tryLock@94-188@..\src\qxk\qxk_mutex.cpp
@ -187,21 +187,21 @@ NLOC Avg.NLOC AvgCCN Avg.token function_cnt file
6 0.0 0.0 0.0 0 ..\include\qassert.h
235 4.1 1.0 20.6 25 ..\include\qep.hpp
46 3.0 1.0 10.7 3 ..\include\qequeue.hpp
317 5.1 1.6 33.9 22 ..\include\qf.hpp
322 5.1 1.6 34.3 22 ..\include\qf.hpp
24 3.0 1.0 29.0 2 ..\include\qf_pkg.hpp
25 0.0 0.0 0.0 0 ..\include\qk.hpp
22 0.0 0.0 0.0 0 ..\include\qk.hpp
49 3.0 1.0 10.0 2 ..\include\qmpool.hpp
5 0.0 0.0 0.0 0 ..\include\qpcpp.hpp
397 8.2 1.5 41.2 4 ..\include\qs.hpp
401 8.2 1.5 41.2 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
25 3.0 1.0 18.0 1 ..\include\qs_dummy.hpp
25 0.0 0.0 0.0 0 ..\include\qs_pkg.hpp
9 0.0 0.0 0.0 0 ..\include\quit.hpp
8 0.0 0.0 0.0 0 ..\include\qv.hpp
121 6.0 1.0 30.0 2 ..\include\qxk.hpp
360 30.9 4.9 179.0 11 ..\src\qf\qep_hsm.cpp
307 41.4 7.1 228.1 7 ..\src\qf\qep_msm.cpp
118 6.0 1.0 30.0 2 ..\include\qxk.hpp
364 31.3 5.1 182.1 11 ..\src\qf\qep_hsm.cpp
317 42.9 7.6 236.1 7 ..\src\qf\qep_msm.cpp
2 0.0 0.0 0.0 0 ..\src\qf\qf_act.cpp
251 25.6 3.8 139.6 9 ..\src\qf\qf_actq.cpp
73 19.3 2.3 99.3 3 ..\src\qf\qf_defer.cpp
@ -212,9 +212,9 @@ NLOC Avg.NLOC AvgCCN Avg.token function_cnt file
163 30.4 4.0 152.4 5 ..\src\qf\qf_qeq.cpp
33 4.5 1.0 30.0 6 ..\src\qf\qf_qmact.cpp
233 27.6 4.1 157.1 8 ..\src\qf\qf_time.cpp
205 22.9 4.8 143.4 8 ..\src\qk\qk.cpp
85 16.5 3.8 96.5 4 ..\src\qv\qv.cpp
280 23.5 5.0 147.5 11 ..\src\qxk\qxk.cpp
209 23.4 5.0 145.8 8 ..\src\qk\qk.cpp
92 18.2 5.0 109.2 4 ..\src\qv\qv.cpp
279 23.4 5.0 144.7 11 ..\src\qxk\qxk.cpp
241 46.0 7.0 333.6 5 ..\src\qxk\qxk_mutex.cpp
142 32.8 4.5 196.5 4 ..\src\qxk\qxk_sema.cpp
309 21.3 3.5 128.8 14 ..\src\qxk\qxk_xthr.cpp
@ -224,9 +224,9 @@ NLOC Avg.NLOC AvgCCN Avg.token function_cnt file
================================================
NLOC CCN token PARAM length location
------------------------------------------------
116 21 658 2 168 QP::QMsm::dispatch@119-286@..\src\qf\qep_msm.cpp
117 21 664 2 169 QP::QMsm::dispatch@119-287@..\src\qf\qep_msm.cpp
==========================================================================================
Total nloc Avg.NLOC AvgCCN Avg.token Fun Cnt Warning cnt Fun Rt nloc Rt
------------------------------------------------------------------------------------------
4513 18.0 3.2 107.2 178 1 0.01 0.04
4540 18.1 3.3 108.0 178 1 0.01 0.04
@endcode

View File

@ -1,7 +1,64 @@
/** @page history Revision History
/** @page history Design History File (DHF)
@image html qcp_banner.jpg
@image latex qcp_banner.jpg width=6.5in
@remark
This document is part of the @webref{products/qp#CERT,QP Certification Pack}, which has been specifically designed to aid companies in **safety certification** of their software based on the QP real-time embedded frameworks.
@section qpcpp_7_2_0 Version 7.2.0, 2023-01-06
__QP/C++ Source Code:__
- Added "enumeration dictionaries" for QS software tracing (see QS_ENUM_DICTIONARY())
- Introduced common callback `QF_onContextSw()` used in all built-in kernels (QV, QK, QXK). This callback is enabled by the macro #QF_ON_CONTEXT_SW.
- Removed callback `QK_onContextSW()` and macro QK_ON_CONTEXT_SW and replaced with `QF_onContextSw()`/#QF_ON_CONTEXT_SW.
- Removed callback `QXK_onContextSW()` and macro QXK_ON_CONTEXT_SW and replaced with `QF_onContextSw()`/#QF_ON_CONTEXT_SW.
- Added callback `QF_onContextSW()` and macro #QF_ON_CONTEXT_SW to the QV kernel.
- added configuration macro #QS_CTR_SIZE to determine the size of the type QS::QSCtr (see also [feature#195](https://sourceforge.net/p/qpc/feature-requests/195))
- Modified QMsm::childStateObj() implementation to correctly handle submachine states (see also [bug#316](https://sourceforge.net/p/qpc/bugs/316))
- Added automatic generation of the QS function dictionary for the QP::QHsm::top() state handler function. This happens only once on the first call to QP::QHsm::init().
@note
It is no longer necessary to generate QS function dictionary for QP::QHsm::top() in the application (although it is still allowed, but wasteful).
__Ports:__
- `ports/arm-cm` added setup of the FPU (if configured) to all build-in kernels (QV, QK, QXK) and toolchains (ARMCLANG, GNU-ARM, IAR).
- `ports/arm-cm` all ports now clear the FPCA bit in the CONTROL register (if FPU configured) right before starting the interrupts. That potentially saves the stack space (MSP) for the automatically reserved FPU context.
@note
This change means that the applications no longer need to setup the FPU, which was done typically in the BSP.
- `ports/posix` added configuration macro #QS_CTR_SIZE 4U, to allow QS trace buffers > 64KB (see also [feature#195](https://sourceforge.net/p/qpc/feature-requests/195))
- `ports/win32` added configuration macro #QS_CTR_SIZE 4U, to allow QS trace buffers > 64KB (see also [feature#195](https://sourceforge.net/p/qpc/feature-requests/195))
- `ports/esp-idf` fixed compilation error caused by obsolete macro `QF_PTR_RANGE_()`
- `ports/sample` added a sample QP/C port for reference and documentation of all available configuration options.
- `zephyr` updated `qf_port.hpp` to include `<zephyr/kernel.h>` rather than `<zephyr/zephyr.h>` (see also [bug#321](https://sourceforge.net/p/qpc/bugs/321))
__Examples:__
- examples for QV: added callback `QF_onContextSw()`
- exampels for QK, QXK: replaced callbacks `QK_onContextSw()/QXK_onContextSw()` with `QF_onContextSw()`
- `examples/arm-cm` removed setting up the FPU from the BSPs (the FPU is now setup in the ports).
- `examples/arm-cm` added setting up the MPU (Memory Protection Unit) to catch [NULL-pointer dereferencing](https://www.state-machine.com/null-pointer-protection-with-arm-cortex-m-mpu) and other incorrect memory access.
__Testing:__
- changed the QUTest assertion handler Q_onAssert() (file qutest.cpp) to reset the target rather than wait for user commands. This allows proper assertion handling even inside exception handlers, where the target really cannot handle interrupts (which were needed for reception of commands). This change matches the updated policy of **assertion failures** in [QUTest 7.2.0](https://www.state-machine.com/qtools/history.html#qtools_7_2_0).
- examples for QUTest (`examples/qutest` and `test` directories): adjusted makefiels to invoke the `qutest.py` utility with the new [command-line parameters](https://www.state-machine.com/qtools/qutest_use.html#qutest_command).
- modified the test fixtures to use "enum dictionaries" for commands
- added example `examples/qutest/start_seq` that demonstrates testing of start sequences.
__Bug Fixes:__
- [bug#316 Using History with Submachines does not work](https://sourceforge.net/p/qpc/bugs/316)
- [bug#321 zephyr port build error](https://sourceforge.net/p/qpc/bugs/321)
- [bug#325 QSpy shows Sig=NULL if #Q_EVT_CTOR is used](https://sourceforge.net/p/qpc/bugs/325)
__Feature Requests:__
- [feature#195 allow > 64K QS trace buffer on target](https://sourceforge.net/p/qpc/feature-requests/195). This is configurable by setting the macro #QS_CTR_SIZE.
@section qpcpp_7_1_3 Version 7.1.3, 2022-11-18
__Bug Fixes:__
- This release fixes [bug#317](https://sourceforge.net/p/qpc/bugs/317) in QK kernel

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,9 +1,8 @@
extern "C" { // use the "C" calling convention
#ifdef QK_ON_CONTEXT_SW
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
void QK_onContextSw(QActive *prev, QActive *next) {
(void)prev;
void QF_onContextSw(QActive *prev, QActive *next) {
if (next != (QActive *)0) { // next is not the QK idle loop?
_impure_ptr = next->thread; // switch to next TLS
}
@ -14,6 +13,6 @@ void QK_onContextSw(QActive *prev, QActive *next) {
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QK_ON_CONTEXT_SW
#endif // QF_ON_CONTEXT_SW
} // extern "C"

View File

@ -3,11 +3,6 @@ Table Table::inst;
Q_STATE_DEF(Table, initial) {
QS_OBJ_DICTIONARY(&Table::inst);
QS_FUN_DICTIONARY(&QP::QHsm::top);
QS_FUN_DICTIONARY(&Table::initial);
QS_FUN_DICTIONARY(&Table::active);
QS_FUN_DICTIONARY(&Table::serving);
QS_FUN_DICTIONARY(&Table::paused);
QS_SIG_DICTIONARY(DONE_SIG, nullptr); // global signals
QS_SIG_DICTIONARY(EAT_SIG, nullptr);

View File

@ -1,19 +0,0 @@
extern "C" { // use the "C" calling convention
#ifdef QXK_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
void QXK_onContextSw(QActive *prev, QActive *next) {
(void)prev;
if (next != (QActive *)0) { // next is not the QK idle loop?
_impure_ptr = next->thread; // switch to next TLS
}
// If you use QS software tracing, use the _NOCRIT() begin/end
QS_BEGIN_NOCRIT(ON_CONTEXT_SW, 0U)
QS_OBJ(prev);
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QXK_ON_CONTEXT_SW
} // extern "C"

View File

@ -76,30 +76,7 @@ void BSP_init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
// NOTE: The VFP (hardware Floating Point) unit is configured by QK
// enable clock for to the peripherals used by this application...
CMU_ClockEnable(cmuClock_HFPER, true);

View File

@ -74,17 +74,7 @@ void BSP_init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
//
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used only by active objects
// and NOT in any ISR. This setting is very efficient, but if any ISRs
// start using the FPU, this can lead to corruption of the FPU registers.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
// NOTE: The VFP (hardware Floating Point) unit is configured by QV
// enable clock for to the peripherals used by this application...
CMU_ClockEnable(cmuClock_HFPER, true);

View File

@ -75,30 +75,7 @@ void BSP_init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
// NOTE: The VFP (hardware Floating Point) unit is configured by QK
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF

View File

@ -73,17 +73,7 @@ void BSP_init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used only by active objects
// and NOT in any ISR. This setting is very efficient, but if any ISRs
// start using the FPU, this can lead to corruption of the FPU registers.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
// NOTE: The VFP (hardware Floating Point) unit is configured by QV
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ inline uint8_t PHILO_ID(Philo const * const me) {
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,13 +1,13 @@
//============================================================================
// Product: DPP example, EFM32-SLSTK3401A board, preemptive QK kernel
// Last updated for version 7.1.0
// Last updated on 2022-08-28
// Last updated for version 7.2.0
// Last updated on 2022-12-13
//
// Q u a n t u m L e a P s
// ------------------------
// Modern Embedded Software
//
// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
// Copyright (C) 2005 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
@ -171,9 +171,7 @@ void BSP::init(void) {
//
SystemCoreClockUpdate();
/* NOTE: The VFP (hardware Floating Point) unit is configured by QXK */
//FPU->FPCCR = FPU->FPCCR
// | (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
// NOTE: The VFP (hardware Floating Point) unit is configured by QXK
// enable clock for to the peripherals used by this application...
CMU_ClockEnable(cmuClock_HFPER, true);
@ -300,6 +298,21 @@ void QF::onStartup(void) {
void QF::onCleanup(void) {
}
//............................................................................
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
extern "C"
void QF_onContextSw(QActive *prev, QActive *next) {
(void)prev;
if (next != nullptr) {
//_impure_ptr = next->thread; // switch to next TLS
}
QS_BEGIN_NOCRIT(DPP::CONTEXT_SW, 0U) // no critical section!
QS_OBJ(prev);
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QF_ON_CONTEXT_SW
//............................................................................
void QK::onIdle(void) {
// toggle the User LED on and then off, see NOTE01
// QF_INT_DISABLE();
@ -338,9 +351,9 @@ void QK::onIdle(void) {
extern "C" {
//............................................................................
#ifdef QK_ON_CONTEXT_SW
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
void QK_onContextSw(QActive *prev, QActive *next) {
void QF_onContextSw(QActive *prev, QActive *next) {
if (next != nullptr) {
//_impure_ptr = next->thread; // switch to next TLS
}
@ -349,7 +362,7 @@ void QK_onContextSw(QActive *prev, QActive *next) {
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QK_ON_CONTEXT_SW
#endif // QF_ON_CONTEXT_SW
//............................................................................
Q_NORETURN Q_onAssert(char const * const module, int_t const loc) {

View File

@ -1,13 +1,13 @@
//============================================================================
// Product: DPP example, EFM32-SLSTK3401A board, cooperative QV kernel
// Last updated for version 7.1.0
// Last updated on 2022-08-28
// Last updated for version 7.2.0
// Last updated on 2022-12-13
//
// Q u a n t u m L e a P s
// ------------------------
// Modern Embedded Software
//
// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
// Copyright (C) 2005 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
@ -99,8 +99,8 @@ void SysTick_Handler(void) {
}
#endif
//QP::QTimeEvt::TICK_X(0U, &l_SysTick_Handler); // process time evts for rate 0
DPP::the_Ticker0->POST(0, &l_SysTick_Handler); // post to Ticker0 active object
QP::QTimeEvt::TICK_X(0U, &l_SysTick_Handler); // process time evts for rate 0
//DPP::the_Ticker0->POST(0, &l_SysTick_Handler); // post to Ticker0 active object
// Perform the debouncing of buttons. The algorithm for debouncing
// adapted from the book "Embedded Systems Dictionary" by Jack Ganssle
@ -156,20 +156,12 @@ void USART0_RX_IRQHandler(void) {}
// BSP functions =============================================================
void BSP::init(void) {
// NOTE: SystemInit() already called from the startup code
// but SystemCoreClock needs to be updated
// NOTE: SystemInit() has been already called from the startup code
// but SystemCoreClock needs to be updated
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
// NOTE: The VFP (hardware Floating Point) unit is configured by QV
// enable clock for to the peripherals used by this application...
CMU_ClockEnable(cmuClock_HFPER, true);
@ -296,6 +288,21 @@ void QF::onStartup(void) {
void QF::onCleanup(void) {
}
//............................................................................
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
extern "C"
void QF_onContextSw(QActive *prev, QActive *next) {
(void)prev;
if (next != nullptr) {
//_impure_ptr = next->thread; // switch to next TLS
}
QS_BEGIN_NOCRIT(CONTEXT_SW, 0U) // no critical section!
QS_OBJ(prev);
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QF_ON_CONTEXT_SW
//............................................................................
void QV::onIdle(void) { // called with interrupts disabled, see NOTE01
// toggle the User LED on and then off, see NOTE02
GPIO->P[LED_PORT].DOUT |= (1U << LED1_PIN);

View File

@ -1,13 +1,13 @@
##############################################################################
# Product: Makefile for QP/C++ on EMF32-SLSTK3401A, QV kernel, GNU-ARM
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
# Last Updated for Version: 7.2.0
# Date of the Last Update: 2022-12-14
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
# Copyright (C) 2005 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,7 +45,7 @@
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the Qtools collection for Windows, see:
# http://sourceforge.net/projects/qpc/files/Qtools/
# https://github.com/QuantumLeaps/qtools/releases
#
#-----------------------------------------------------------------------------
@ -138,7 +138,8 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES := -DEFM32PG1B200F256GM48=1
DEFINES := -DEFM32PG1B200F256GM48=1 \
-DQF_ON_CONTEXT_SW
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
@ -179,7 +180,7 @@ MKDIR := mkdir
RM := rm
#-----------------------------------------------------------------------------
# build options for various configurations for ARM Cortex-M4F
# build options for various configurations for ARM Cortex-M
#
# combine all the soruces...

View File

@ -1,7 +1,7 @@
//============================================================================
// Product: DPP example, EFM32-SLSTK3401A board, preemptive QXK kernel
// Last updated for version 7.1.0
// Last updated on 2022-08-28
// Last updated for version 7.2.0
// Last updated on 2022-12-13
//
// Q u a n t u m L e a P s
// ------------------------
@ -173,9 +173,7 @@ void BSP::init(void) {
//
SystemCoreClockUpdate();
/* NOTE: The VFP (hardware Floating Point) unit is configured by QXK */
//FPU->FPCCR = FPU->FPCCR
// | (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
// NOTE: The VFP (hardware Floating Point) unit is configured by QXK
// enable clock for to the peripherals used by this application...
CMU_ClockEnable(cmuClock_HFPER, true);
@ -345,9 +343,9 @@ void QXK::onIdle(void) {
extern "C" {
//............................................................................
#ifdef QXK_ON_CONTEXT_SW
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
void QXK_onContextSw(QActive *prev, QActive *next) {
void QF_onContextSw(QActive *prev, QActive *next) {
if (next != nullptr) {
//_impure_ptr = next->thread; // switch to next TLS
}
@ -356,7 +354,7 @@ void QXK_onContextSw(QActive *prev, QActive *next) {
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QXK_ON_CONTEXT_SW
#endif // QF_ON_CONTEXT_SW
//............................................................................
Q_NORETURN Q_onAssert(char const * const module, int_t const loc) {

View File

@ -1,13 +1,13 @@
##############################################################################
# Product: Makefile for QP/C++ on EMF32-SLSTK3401A, QXK kernel, GNU-ARM
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
# Last Updated for Version: 7.2.0
# Date of the Last Update: 2022-12-14
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2022 Quantum Leaps, LLC. All rights reserved.
# Copyright (C) 2005 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,7 +45,7 @@
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the Qtools collection for Windows, see:
# https://sourceforge.net/projects/qpc/files/QTools/
# https://github.com/QuantumLeaps/qtools/releases
#
#-----------------------------------------------------------------------------
@ -143,9 +143,9 @@ LIBS :=
# defines
DEFINES := -DEFM32PG1B200F256GM48=1 \
-DQXK_ON_CONTEXT_SW \
-DQXK_USE_IRQ_HANDLER=CRYPTO_IRQHandler \
-DQXK_USE_IRQ_NUM=25
-DQXK_USE_IRQ_NUM=25 \
-DQF_ON_CONTEXT_SW
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]
@ -186,7 +186,7 @@ MKDIR := mkdir
RM := rm
#-----------------------------------------------------------------------------
# build options for various configurations for ARM Cortex-M4F
# build options for various configurations for ARM Cortex-M
#
# combine all the soruces...

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++ on EMF32-SLSTK3401A, QXK kernel, GNU-ARM
# Last Updated for Version: 7.0.0
# Date of the Last Update: 2022-05-13
# Last Updated for Version: 7.2.0
# Date of the Last Update: 2022-12-14
#
# Q u a n t u m L e a P s
# ------------------------
@ -80,7 +80,6 @@ VPATH = \
INCLUDES = \
-I../.. \
-I$(QPCPP)/include \
-I$(QPCPP)/src \
-I$(QP_PORT_DIR) \
-I$(QPCPP)/3rd_party/CMSIS/Include \
-I$(QPCPP)/3rd_party/efm32pg1b
@ -137,15 +136,14 @@ QP_ASMS := \
QS_SRCS := \
qs.cpp \
qs_rx.cpp \
qs_fp.cpp \
qs_64bit.cpp
qs_fp.cpp
LIB_DIRS :=
LIBS :=
# defines
DEFINES := -DEFM32PG1B200F256GM48=1 \
-DQXK_ON_CONTEXT_SW \
-DQF_ON_CONTEXT_SW \
-DQXK_USE_IRQ_HANDLER=CRYPTO_IRQHandler \
-DQXK_USE_IRQ_NUM=25

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++ on EMF32-SLSTK3401A, QXK kernel, GNU-ARM
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
# Last Updated for Version: 7.2.0
# Date of the Last Update: 2022-12-14
#
# Q u a n t u m L e a P s
# ------------------------
@ -45,7 +45,7 @@
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the Qtools collection for Windows, see:
# https://sourceforge.net/projects/qpc/files/QTools/
# https://github.com/QuantumLeaps/qtools/releases
#
#-----------------------------------------------------------------------------
@ -142,9 +142,11 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES := -DQ_NASSERT -DEFM32PG1B200F256GM48=1 \
DEFINES := -DEFM32PG1B200F256GM48=1 \
-DQF_ON_CONTEXT_SW \
-DQXK_USE_IRQ_HANDLER=CRYPTO_IRQHandler \
-DQXK_USE_IRQ_NUM=25 \
-DQXK_USE_IRQ_HANDLER=CRYPTO_IRQHandler
-DQ_NASSERT
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ constexpr char const * const EATING = &"eating "[0];
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ inline uint8_t PHILO_ID(Philo const * const me) {
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -168,30 +168,7 @@ void BSP::init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
// NOTE: The VFP (hardware Floating Point) unit is configured by QK
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF

View File

@ -168,30 +168,7 @@ void BSP::init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
// NOTE: The VFP (hardware Floating Point) unit is configured by QK
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF

View File

@ -162,15 +162,7 @@ void BSP::init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
// NOTE: The VFP (hardware Floating Point) unit is configured by QV
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF

View File

@ -10,7 +10,7 @@
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj; *.o</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<tExt>*.txt; *.h; *.inc; *.md</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
@ -103,7 +103,7 @@
<bEvRecOn>1</bEvRecOn>
<bSchkAxf>0</bSchkAxf>
<bTchkAxf>0</bTchkAxf>
<nTsel>8</nTsel>
<nTsel>19</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>

View File

@ -10,7 +10,7 @@
<TargetName>dpp-dbg</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>6130001::V6.13.1::.\ARMCLANG</pCCUsed>
<pCCUsed>6160000::V6.16::ARMCLANG</pCCUsed>
<uAC6>1</uAC6>
<TargetOption>
<TargetCommonOption>
@ -185,6 +185,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -351,7 +352,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=2048 Heap_Size=16</Define>
@ -610,7 +611,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -824,6 +825,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -990,7 +992,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=2048 Heap_Size=16</Define>
@ -1249,7 +1251,7 @@
<NoWarn>2</NoWarn>
<uSurpInc>2</uSurpInc>
<useXO>2</useXO>
<uClangAs>2</uClangAs>
<ClangAsOpt>0</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
@ -1463,6 +1465,7 @@
<uocXRam>0</uocXRam>
<RvdsVP>2</RvdsVP>
<RvdsMve>0</RvdsMve>
<RvdsCdeCp>0</RvdsCdeCp>
<hadIRAM2>0</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
@ -1629,7 +1632,7 @@
<NoWarn>0</NoWarn>
<uSurpInc>1</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<ClangAsOpt>4</ClangAsOpt>
<VariousControls>
<MiscControls></MiscControls>
<Define>Stack_Size=2048 Heap_Size=16</Define>

View File

@ -169,10 +169,7 @@ void BSP::init(void) {
// but SystemCoreClock needs to be updated
SystemCoreClockUpdate();
// FPU ( Floating Point Unit) configuration for QXK
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
// NOTE: The VFP (hardware Floating Point) unit is configured by QXK
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ constexpr char const * const EATING = &"eating "[0];
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -96,8 +96,8 @@ QP::QActive * const AO_Philo[N_PHILO] = { // "opaque" pointers to Philo AO
// Philo definition ----------------------------------------------------------
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -87,8 +87,8 @@ QP::QActive * const AO_Table = &l_table; // "opaque" AO pointer
//............................................................................
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ inline uint8_t PHILO_ID(Philo const * const me) {
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,7 +1,7 @@
//============================================================================
// Product: DPP example, NUCLEO-H743ZI board, premptive QK kernel
// Last updated for: @qpcpp_7_0_0
// Last updated on 2022-02-28
// Product: DPP example, NUCLEO-H743ZI board, preemptive QK kernel
// Last updated for version 7.2.0
// Last updated on 2022-12-13
//
// Q u a n t u m L e a P s
// ------------------------
@ -90,7 +90,8 @@ void SysTick_Handler(void) {
}
#endif
QP::QTimeEvt::TICK_X(0U, &l_SysTick_Handler); // process time events for rate 0
//QP::QTimeEvt::TICK_X(0U, &l_SysTick_Handler); // process time events for rate 0
DPP::ticker0.POST(nullptr, &l_SysTick_Handler);
// Perform the debouncing of buttons. The algorithm for debouncing
// adapted from the book "Embedded Systems Dictionary" by Jack Ganssle
@ -138,9 +139,62 @@ void USART3_IRQHandler(void) {
} // extern "C"
// BSP functions =============================================================
// MPU setup for STM32H743ZI MCU
static void STM32H743ZI_MPU_setup(void) {
// The following MPU configuration contains just a generic ROM
// region (with read-only access) and NULL-pointer protection region.
// Otherwise, the MPU will fall back on the background region (PRIVDEFENA).
//
static struct {
std::uint32_t rbar;
std::uint32_t rasr;
} const mpu_setup[] = {
{ // region #0: Flash: base=0x0000'0000, size=512M=2^(28+1)
0x00000000U // base address
| MPU_RBAR_VALID_Msk // valid region
| (MPU_RBAR_REGION_Msk & 0U), // region #0
(28U << MPU_RASR_SIZE_Pos) // 2^(18+1) region
| (0x6U << MPU_RASR_AP_Pos) // PA:ro/UA:ro
| (1U << MPU_RASR_C_Pos) // C=1
| MPU_RASR_ENABLE_Msk // region enable
},
{ // region #7: NULL-pointer: base=0x000'0000, size=128M=2^(26+1)
// NOTE: this region extends to 0x080'0000, which is where
// the ROM is re-mapped by STM32
//
0x00000000U // base address
| MPU_RBAR_VALID_Msk // valid region
| (MPU_RBAR_REGION_Msk & 7U), // region #7
(26U << MPU_RASR_SIZE_Pos) // 2^(26+1)=128M region
| (0x0U << MPU_RASR_AP_Pos) // PA:na/UA:na
| (1U << MPU_RASR_XN_Pos) // XN=1
| MPU_RASR_ENABLE_Msk // region enable
},
};
// enable the MemManage_Handler for MPU exception
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
__DSB();
MPU->CTRL = 0U; // disable the MPU */
for (std::uint_fast8_t n = 0U; n < Q_DIM(mpu_setup); ++n) {
MPU->RBAR = mpu_setup[n].rbar;
MPU->RASR = mpu_setup[n].rasr;
}
MPU->CTRL = MPU_CTRL_ENABLE_Msk // enable the MPU */
| MPU_CTRL_PRIVDEFENA_Msk; // enable background region */
__ISB();
__DSB();
}
//............................................................................
void BSP::init(void) {
// setup the MPU...
STM32H743ZI_MPU_setup();
// NOTE: SystemInit() has been already called from the startup code
// but SystemCoreClock needs to be updated
// but SystemCoreClock needs to be updated
//
SystemCoreClockUpdate();
@ -152,32 +206,7 @@ void BSP::init(void) {
__HAL_FLASH_ART_ENABLE();
#endif // ART_ACCLERATOR_ENABLE
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
/* Configure the LEDs */
// Configure the LEDs
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
@ -193,7 +222,7 @@ void BSP::init(void) {
Q_ERROR();
}
/* object dictionaries... */
// dictionaries...
QS_OBJ_DICTIONARY(AO_Table);
QS_OBJ_DICTIONARY(AO_Philo[0]);
QS_OBJ_DICTIONARY(AO_Philo[1]);
@ -202,21 +231,25 @@ void BSP::init(void) {
QS_OBJ_DICTIONARY(AO_Philo[4]);
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
QS_OBJ_DICTIONARY(&DPP::ticker0);
QS_USR_DICTIONARY(PHILO_STAT);
QS_USR_DICTIONARY(PAUSED_STAT);
QS_USR_DICTIONARY(COMMAND_STAT);
QS_USR_DICTIONARY(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
QS_GLB_FILTER(QP::QS_ALL_RECORDS); // all records
QS_GLB_FILTER(-QP::QS_QF_TICK); // exclude the clock tick
}
/*..........................................................................*/
//............................................................................
void BSP::terminate(int16_t result) {
Q_UNUSED_PAR(result);
}
//............................................................................
void BSP::ledOn(void) {
BSP_LED_On(LED1);
}
/*..........................................................................*/
//............................................................................
void BSP::ledOff(void) {
BSP_LED_Off(LED1);
}
@ -264,10 +297,6 @@ void BSP::randomSeed(uint32_t seed) {
l_rnd = seed;
}
//............................................................................
void BSP::terminate(int16_t result) {
(void)result;
}
} // namespace DPP
@ -283,12 +312,7 @@ 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 NOTE1
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
//
// set priorities of ALL ISRs used in the system
NVIC_SetPriority(USART3_IRQn, 0U); // kernel unaware interrupt
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
// ...
@ -302,21 +326,6 @@ void QF::onStartup(void) {
void QF::onCleanup(void) {
}
//............................................................................
#ifdef QK_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
extern "C"
void QK_onContextSw(QActive *prev, QActive *next) {
(void)prev;
if (next != (QActive *)0) {
//_impure_ptr = next->thread; // switch to next TLS
}
QS_BEGIN_NOCRIT(DPP::CONTEXT_SW, 0U) // no critical section!
QS_OBJ(prev);
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QK_ON_CONTEXT_SW
//............................................................................
void QK::onIdle(void) {
// toggle the User LED on and then off, see NOTE01
@ -456,10 +465,6 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
QS_U8(2, cmdId);
QS_U32(8, param1);
QS_END()
if (cmdId == 10U) {
assert_failed("QS_onCommand", 11);
}
}
#endif // Q_SPY
@ -467,6 +472,22 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
} // namespace QP
extern "C" {
//............................................................................
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
void QF_onContextSw(QP::QActive *prev, QP::QActive *next) {
if ((prev != &DPP::ticker0) && (next != &DPP::ticker0)) {
QS_BEGIN_NOCRIT(DPP::CONTEXT_SW, 0U) // no critical section!
QS_OBJ(prev);
QS_OBJ(next);
QS_END_NOCRIT()
}
}
#endif // QF_ON_CONTEXT_SW
} // extern "C"
//============================================================================
// NOTE1:
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest

View File

@ -1,13 +1,13 @@
##############################################################################
# Product: Makefile for QP/C++ on NUCLEO-H743ZI, QXK kernel, GNU-ARM
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
# Product: Makefile for QP/C++ on NUCLEO-H743ZI, QK kernel, GNU-ARM
# Last Updated for Version: 7.2.0
# Date of the Last Update: 2022-12-14
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
# Copyright (C) 2005 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,7 +45,7 @@
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the Qtools collection for Windows, see:
# https://sourceforge.net/projects/qpc/files/QTools/
# https://github.com/QuantumLeaps/qtools/releases
#
#-----------------------------------------------------------------------------
@ -147,7 +147,11 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES := -DQK_ON_CONTEXT_SW -DSTM32H743xx -DUSE_HAL_DRIVER -DUSE_STM32H7XX_NUCLEO_144
DEFINES := \
-DSTM32H743xx \
-DUSE_HAL_DRIVER \
-DUSE_STM32H7XX_NUCLEO_144 \
-DQF_ON_CONTEXT_SW
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -1,13 +1,13 @@
//============================================================================
// DPP example
// Last updated for version 7.1.2
// Last updated on 2022-10-05
// Last updated for: @qpcpp_7_2_0
// Last updated on 2022-12-26
//
// Q u a n t u m L e a P s
// ------------------------
// Modern Embedded Software
// Q u a n t u m L e a P s
// ---------------------------
// innovating embedded systems
//
// Copyright (C) Quantum Leaps, LLC. All rights reserved.
// Copyright (C) 2005 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
@ -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>
@ -35,6 +35,8 @@
#include "dpp.hpp"
#include "bsp.hpp"
QP::QTicker DPP::ticker0(0U); // ticker for tick rate 0
//............................................................................
int main() {
static QP::QEvt const *tableQueueSto[N_PHILO];
@ -61,8 +63,13 @@ int main() {
nullptr, 0U); // no stack storage
}
// example of prioritizing the Ticker0 active object
DPP::ticker0.start(N_PHILO + 2U, // priority
nullptr, 0U, nullptr, 0U); // not used
QS_LOC_FILTER(-DPP::ticker0.getPrio()); // don't trace ticker0
DPP::AO_Table->start(
N_PHILO + 1U, // priority
N_PHILO + 3U, // priority
tableQueueSto, Q_DIM(tableQueueSto),
nullptr, 0U);

View File

@ -1,7 +1,7 @@
//============================================================================
// Product: DPP example, NUCLEO-H743ZI board, cooperative QV kernel
// Last updated for: @qpcpp_7_0_0
// Last updated on 2022-02-28
// Last updated for version 7.2.0
// Last updated on 2022-12-13
//
// Q u a n t u m L e a P s
// ------------------------
@ -88,7 +88,8 @@ void SysTick_Handler(void) {
}
#endif
QP::QTimeEvt::TICK_X(0U, &l_SysTick_Handler); // process time events for rate 0
//QP::QTimeEvt::TICK_X(0U, &l_SysTick_Handler); // process time events for rate 0
DPP::ticker0.POST(nullptr, &l_SysTick_Handler);
// Perform the debouncing of buttons. The algorithm for debouncing
// adapted from the book "Embedded Systems Dictionary" by Jack Ganssle
@ -110,6 +111,7 @@ void SysTick_Handler(void) {
QP::QF::PUBLISH(&serveEvt, &l_SysTick_Handler);
}
}
QV_ARM_ERRATUM_838869();
}
@ -134,9 +136,62 @@ void USART3_IRQHandler(void) {
} // extern "C"
// BSP functions =============================================================
// MPU setup for STM32H743ZI MCU
static void STM32H743ZI_MPU_setup(void) {
// The following MPU configuration contains just a generic ROM
// region (with read-only access) and NULL-pointer protection region.
// Otherwise, the MPU will fall back on the background region (PRIVDEFENA).
//
static struct {
std::uint32_t rbar;
std::uint32_t rasr;
} const mpu_setup[] = {
{ // region #0: Flash: base=0x0000'0000, size=512M=2^(28+1)
0x00000000U // base address
| MPU_RBAR_VALID_Msk // valid region
| (MPU_RBAR_REGION_Msk & 0U), // region #0
(28U << MPU_RASR_SIZE_Pos) // 2^(18+1) region
| (0x6U << MPU_RASR_AP_Pos) // PA:ro/UA:ro
| (1U << MPU_RASR_C_Pos) // C=1
| MPU_RASR_ENABLE_Msk // region enable
},
{ // region #7: NULL-pointer: base=0x000'0000, size=128M=2^(26+1)
// NOTE: this region extends to 0x080'0000, which is where
// the ROM is re-mapped by STM32
//
0x00000000U // base address
| MPU_RBAR_VALID_Msk // valid region
| (MPU_RBAR_REGION_Msk & 7U), // region #7
(26U << MPU_RASR_SIZE_Pos) // 2^(26+1)=128M region
| (0x0U << MPU_RASR_AP_Pos) // PA:na/UA:na
| (1U << MPU_RASR_XN_Pos) // XN=1
| MPU_RASR_ENABLE_Msk // region enable
},
};
// enable the MemManage_Handler for MPU exception
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
__DSB();
MPU->CTRL = 0U; // disable the MPU */
for (std::uint_fast8_t n = 0U; n < Q_DIM(mpu_setup); ++n) {
MPU->RBAR = mpu_setup[n].rbar;
MPU->RASR = mpu_setup[n].rasr;
}
MPU->CTRL = MPU_CTRL_ENABLE_Msk // enable the MPU */
| MPU_CTRL_PRIVDEFENA_Msk; // enable background region */
__ISB();
__DSB();
}
//............................................................................
void BSP::init(void) {
// setup the MPU...
STM32H743ZI_MPU_setup();
// NOTE: SystemInit() has been already called from the startup code
// but SystemCoreClock needs to be updated
// but SystemCoreClock needs to be updated
//
SystemCoreClockUpdate();
@ -148,32 +203,7 @@ void BSP::init(void) {
__HAL_FLASH_ART_ENABLE();
#endif // ART_ACCLERATOR_ENABLE
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
/* Configure the LEDs */
// Configure the LEDs
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
@ -189,7 +219,7 @@ void BSP::init(void) {
Q_ERROR();
}
/* object dictionaries... */
// dictionaries...
QS_OBJ_DICTIONARY(AO_Table);
QS_OBJ_DICTIONARY(AO_Philo[0]);
QS_OBJ_DICTIONARY(AO_Philo[1]);
@ -198,21 +228,25 @@ void BSP::init(void) {
QS_OBJ_DICTIONARY(AO_Philo[4]);
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
QS_OBJ_DICTIONARY(&DPP::ticker0);
QS_USR_DICTIONARY(PHILO_STAT);
QS_USR_DICTIONARY(PAUSED_STAT);
QS_USR_DICTIONARY(COMMAND_STAT);
QS_USR_DICTIONARY(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
QS_GLB_FILTER(QP::QS_ALL_RECORDS); // all records
QS_GLB_FILTER(-QP::QS_QF_TICK); // exclude the clock tick
}
/*..........................................................................*/
//............................................................................
void BSP::terminate(int16_t result) {
Q_UNUSED_PAR(result);
}
//............................................................................
void BSP::ledOn(void) {
BSP_LED_On(LED1);
}
/*..........................................................................*/
//............................................................................
void BSP::ledOff(void) {
BSP_LED_Off(LED1);
}
@ -258,10 +292,6 @@ void BSP::randomSeed(uint32_t seed) {
l_rnd = seed;
}
//............................................................................
void BSP::terminate(int16_t result) {
(void)result;
}
} // namespace DPP
@ -277,12 +307,7 @@ 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 NOTE1
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
//
// set priorities of ALL ISRs used in the system
NVIC_SetPriority(USART3_IRQn, 0U); // kernel unaware interrupt
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
// ...
@ -295,6 +320,7 @@ void QF::onStartup(void) {
//............................................................................
void QF::onCleanup(void) {
}
//............................................................................
void QV::onIdle(void) { // called with interrupts disabled, see NOTE01
// toggle the User LED on and then off, see NOTE01
@ -436,10 +462,6 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
QS_U8(2, cmdId);
QS_U32(8, param1);
QS_END()
if (cmdId == 10U) {
assert_failed("QS_onCommand", 11);
}
}
#endif // Q_SPY
@ -447,6 +469,22 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
} // namespace QP
extern "C" {
//............................................................................
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
void QF_onContextSw(QP::QActive *prev, QP::QActive *next) {
if ((prev != &DPP::ticker0) && (next != &DPP::ticker0)) {
QS_BEGIN_NOCRIT(DPP::CONTEXT_SW, 0U) // no critical section!
QS_OBJ(prev);
QS_OBJ(next);
QS_END_NOCRIT()
}
}
#endif // QF_ON_CONTEXT_SW
} // extern "C"
//============================================================================
// NOTE1:
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest
@ -461,7 +499,8 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
// Conversely, any ISRs prioritized above the QF_AWARE_ISR_CMSIS_PRI priority
// level (i.e., with the numerical values of priorities less than
// QF_AWARE_ISR_CMSIS_PRI) are never disabled and are not aware of the kernel.
// Such "QF-unaware" ISRs cannot call any QF services. The only mechanism
// Such "QF-unaware" ISRs cannot call any QF services. In particular they
// can NOT call the macros QK_ISR_ENTRY/QK_ISR_ENTRY. The only mechanism
// by which a "QF-unaware" ISR can communicate with the QF framework is by
// triggering a "QF-aware" ISR, which can post/publish events.
//

View File

@ -1,13 +1,13 @@
##############################################################################
# Product: Makefile for QP/C++ on NUCLEO-H743ZI, QV kernel, GNU-ARM
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
# Last Updated for Version: 7.2.0
# Date of the Last Update: 2022-12-14
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
# Copyright (C) 2005 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,7 +45,7 @@
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the Qtools collection for Windows, see:
# https://sourceforge.net/projects/qpc/files/QTools/
# https://github.com/QuantumLeaps/qtools/releases
#
#-----------------------------------------------------------------------------
@ -147,7 +147,11 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES := -DQK_ON_CONTEXT_SW -DSTM32H743xx -DUSE_HAL_DRIVER -DUSE_STM32H7XX_NUCLEO_144
DEFINES := \
-DSTM32H743xx \
-DUSE_HAL_DRIVER \
-DUSE_STM32H7XX_NUCLEO_144 \
-DQF_ON_CONTEXT_SW
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -1,7 +1,7 @@
//============================================================================
// DPP example
// Last updated for: @qpcpp_7_0_0
// Last updated on 2022-02-28
// Last updated for: @qpcpp_7_2_0
// Last updated on 2022-12-26
//
// Q u a n t u m L e a P s
// ---------------------------
@ -35,6 +35,8 @@
#include "dpp.hpp"
#include "bsp.hpp"
QP::QTicker DPP::ticker0(0U); // ticker for tick rate 0
//............................................................................
int main() {
static QP::QEvt const *tableQueueSto[N_PHILO];
@ -54,12 +56,20 @@ int main() {
// start the active objects...
for (uint8_t n = 0U; n < N_PHILO; ++n) {
DPP::AO_Philo[n]->start((uint_fast8_t)(n + 1U), // priority
philoQueueSto[n], Q_DIM(philoQueueSto[n]),
nullptr, 0U);
DPP::AO_Philo[n]->start(
n + 1U, // QP priority
philoQueueSto[n], // event queue storage
Q_DIM(philoQueueSto[n]), // queue length [events]
nullptr, 0U); // no stack storage
}
DPP::AO_Table->start((uint_fast8_t)(N_PHILO + 1U), // priority
// example of prioritizing the Ticker0 active object
DPP::ticker0.start(N_PHILO + 2U, // priority
nullptr, 0U, nullptr, 0U); // not used
QS_LOC_FILTER(-DPP::ticker0.getPrio()); // don't trace ticker0
DPP::AO_Table->start(
N_PHILO + 3U, // priority
tableQueueSto, Q_DIM(tableQueueSto),
nullptr, 0U);

View File

@ -1,7 +1,7 @@
//============================================================================
// Product: DPP example, NUCLEO-H743ZI board, dual-mode QXK kernel
// Last updated for: @qpcpp_7_0_0
// Last updated on 2022-02-28
// Last updated for version 7.2.0
// Last updated on 2022-12-13
//
// Q u a n t u m L e a P s
// ------------------------
@ -139,9 +139,62 @@ void USART3_IRQHandler(void) {
} // extern "C"
// BSP functions =============================================================
// MPU setup for STM32H743ZI MCU
static void STM32H743ZI_MPU_setup(void) {
// The following MPU configuration contains just a generic ROM
// region (with read-only access) and NULL-pointer protection region.
// Otherwise, the MPU will fall back on the background region (PRIVDEFENA).
//
static struct {
std::uint32_t rbar;
std::uint32_t rasr;
} const mpu_setup[] = {
{ // region #0: Flash: base=0x0000'0000, size=512M=2^(28+1)
0x00000000U // base address
| MPU_RBAR_VALID_Msk // valid region
| (MPU_RBAR_REGION_Msk & 0U), // region #0
(28U << MPU_RASR_SIZE_Pos) // 2^(18+1) region
| (0x6U << MPU_RASR_AP_Pos) // PA:ro/UA:ro
| (1U << MPU_RASR_C_Pos) // C=1
| MPU_RASR_ENABLE_Msk // region enable
},
{ // region #7: NULL-pointer: base=0x000'0000, size=128M=2^(26+1)
// NOTE: this region extends to 0x080'0000, which is where
// the ROM is re-mapped by STM32
//
0x00000000U // base address
| MPU_RBAR_VALID_Msk // valid region
| (MPU_RBAR_REGION_Msk & 7U), // region #7
(26U << MPU_RASR_SIZE_Pos) // 2^(26+1)=128M region
| (0x0U << MPU_RASR_AP_Pos) // PA:na/UA:na
| (1U << MPU_RASR_XN_Pos) // XN=1
| MPU_RASR_ENABLE_Msk // region enable
},
};
// enable the MemManage_Handler for MPU exception
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
__DSB();
MPU->CTRL = 0U; // disable the MPU */
for (std::uint_fast8_t n = 0U; n < Q_DIM(mpu_setup); ++n) {
MPU->RBAR = mpu_setup[n].rbar;
MPU->RASR = mpu_setup[n].rasr;
}
MPU->CTRL = MPU_CTRL_ENABLE_Msk // enable the MPU */
| MPU_CTRL_PRIVDEFENA_Msk; // enable background region */
__ISB();
__DSB();
}
//............................................................................
void BSP::init(void) {
// setup the MPU...
STM32H743ZI_MPU_setup();
// NOTE: SystemInit() has been already called from the startup code
// but SystemCoreClock needs to be updated
// but SystemCoreClock needs to be updated
//
SystemCoreClockUpdate();
@ -153,32 +206,7 @@ void BSP::init(void) {
__HAL_FLASH_ART_ENABLE();
#endif // ART_ACCLERATOR_ENABLE
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
/* Configure the LEDs */
// Configure the LEDs
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
@ -194,13 +222,15 @@ void BSP::init(void) {
Q_ERROR();
}
/* object dictionaries... */
// dictionaries...
QS_OBJ_DICTIONARY(AO_Table);
QS_OBJ_DICTIONARY(AO_Philo[0]);
QS_OBJ_DICTIONARY(AO_Philo[1]);
QS_OBJ_DICTIONARY(AO_Philo[2]);
QS_OBJ_DICTIONARY(AO_Philo[3]);
QS_OBJ_DICTIONARY(AO_Philo[4]);
QS_OBJ_DICTIONARY(XT_Test1);
QS_OBJ_DICTIONARY(XT_Test2);
QS_OBJ_DICTIONARY(&l_SysTick_Handler);
QS_OBJ_DICTIONARY(&DPP::ticker0);
@ -210,15 +240,18 @@ void BSP::init(void) {
QS_USR_DICTIONARY(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
QS_GLB_FILTER(QP::QS_ALL_RECORDS); // all records
QS_GLB_FILTER(-QP::QS_QF_TICK); // exclude the clock tick
}
/*..........................................................................*/
//............................................................................
void BSP::terminate(int16_t result) {
Q_UNUSED_PAR(result);
}
//............................................................................
void BSP::ledOn(void) {
BSP_LED_On(LED1);
}
/*..........................................................................*/
//............................................................................
void BSP::ledOff(void) {
BSP_LED_Off(LED1);
}
@ -266,10 +299,6 @@ void BSP::randomSeed(uint32_t seed) {
l_rnd = seed;
}
//............................................................................
void BSP::terminate(int16_t result) {
(void)result;
}
} // namespace DPP
@ -285,12 +314,7 @@ 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 NOTE1
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!! CAUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Assign a priority to EVERY ISR explicitly by calling NVIC_SetPriority().
// DO NOT LEAVE THE ISR PRIORITIES AT THE DEFAULT VALUE!
//
// set priorities of ALL ISRs used in the system
NVIC_SetPriority(USART3_IRQn, 0U); // kernel unaware interrupt
NVIC_SetPriority(SysTick_IRQn, QF_AWARE_ISR_CMSIS_PRI + 1U);
// ...
@ -303,22 +327,6 @@ void QF::onStartup(void) {
//............................................................................
void QF::onCleanup(void) {
}
//............................................................................
#ifdef QXK_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
extern "C"
void QXK_onContextSw(QActive *prev, QActive *next) {
(void)prev;
if (next != (QActive *)0) {
//_impure_ptr = next->thread; // switch to next TLS
}
QS_BEGIN_NOCRIT(DPP::ON_CONTEXT_SW, 0U) // no critical section!
QS_OBJ(prev);
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QXK_ON_CONTEXT_SW
//............................................................................
void QXK::onIdle(void) {
// toggle the User LED on and then off, see NOTE01
@ -458,10 +466,6 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
QS_U8(2, cmdId);
QS_U32(8, param1);
QS_END()
if (cmdId == 10U) {
assert_failed("QS_onCommand", 11);
}
}
#endif // Q_SPY
@ -469,6 +473,22 @@ void QS::onCommand(uint8_t cmdId, uint32_t param1,
} // namespace QP
extern "C" {
//............................................................................
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
void QF_onContextSw(QP::QActive *prev, QP::QActive *next) {
if ((prev != &DPP::ticker0) && (next != &DPP::ticker0)) {
QS_BEGIN_NOCRIT(DPP::CONTEXT_SW, 0U) // no critical section!
QS_OBJ(prev);
QS_OBJ(next);
QS_END_NOCRIT()
}
}
#endif // QF_ON_CONTEXT_SW
} // extern "C"
//============================================================================
// NOTE1:
// The QF_AWARE_ISR_CMSIS_PRI constant from the QF port specifies the highest

View File

@ -1,13 +1,13 @@
##############################################################################
# Product: Makefile for QP/C++ on NUCLEO-H743ZI, QXK kernel, GNU-ARM
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
# Last Updated for Version: 7.2.0
# Date of the Last Update: 2022-12-14
#
# Q u a n t u m L e a P s
# ------------------------
# Modern Embedded Software
#
# Copyright (C) 2005-2021 Quantum Leaps, LLC. All rights reserved.
# Copyright (C) 2005 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,7 +45,7 @@
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the Qtools collection for Windows, see:
# https://sourceforge.net/projects/qpc/files/QTools/
# https://github.com/QuantumLeaps/qtools/releases
#
#-----------------------------------------------------------------------------
@ -151,7 +151,11 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES := -DQK_ON_CONTEXT_SW -DSTM32H743xx -DUSE_HAL_DRIVER -DUSE_STM32H7XX_NUCLEO_144
DEFINES := \
-DSTM32H743xx \
-DUSE_HAL_DRIVER \
-DUSE_STM32H7XX_NUCLEO_144 \
-DQF_ON_CONTEXT_SW
# ARM CPU, ARCH, FPU, and Float-ABI types...
# ARM_CPU: [cortex-m0 | cortex-m0plus | cortex-m1 | cortex-m3 | cortex-m4]

View File

@ -82,24 +82,25 @@ int main() {
// example of prioritizing the Ticker0 active object
DPP::ticker0.start(N_PHILO + 3U, // priority
nullptr, 0U, nullptr, 0U); // not used
QS_LOC_FILTER(-DPP::ticker0.getPrio()); // don't trace ticker0
// NOTE: leave priority (N_PHILO + 4) free for mutex
// start the extended Test2 thread
DPP::XT_Test2->start(
N_PHILO + 5U, // QP prio of the thread
test2QueueSto, // event queue storage
Q_DIM(test2QueueSto), // queue length [events]
test2StackSto, // stack storage
sizeof(test2StackSto)); // stack size [bytes]
N_PHILO + 5U, // QP prio of the thread
test2QueueSto, // event queue storage
Q_DIM(test2QueueSto), // queue length [events]
test2StackSto, // stack storage
sizeof(test2StackSto)); // stack size [bytes]
// NOTE: leave priority (N_PHILO + 6) free for mutex
DPP::AO_Table->start(
N_PHILO + 7U, // QP priority of the AO
tableQueueSto, // event queue storage
Q_DIM(tableQueueSto), // queue length [events]
nullptr, 0U); // no stack storage
N_PHILO + 7U, // QP priority of the AO
tableQueueSto, // event queue storage
Q_DIM(tableQueueSto), // queue length [events]
nullptr, 0U); // no stack storage
return QP::QF::run(); // run the QF application
}

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ constexpr char const * const EATING = &"eating "[0];
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ inline uint8_t PHILO_ID(Philo const * const me) {
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,7 +1,7 @@
//============================================================================
// Product: DPP example, STM32 NUCLEO-L053R8 board, preemptive QK kernel
// Last updated for version 7.1.0
// Last updated on 2022-08-26
// Last updated for version 7.2.0
// Last updated on 2022-12-13
//
// Q u a n t u m L e a P s
// ------------------------
@ -305,15 +305,15 @@ void QK::onIdle(void) {
//============================================================================
extern "C" {
#ifdef QK_ON_CONTEXT_SW
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
void QK_onContextSw(QP::QActive *prev, QP::QActive *next) {
void QF_onContextSw(QP::QActive *prev, QP::QActive *next) {
QS_BEGIN_NOCRIT(DPP::CONTEXT_SW, 0U) // no critical section!
QS_OBJ(prev);
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QK_ON_CONTEXT_SW
#endif // QF_ON_CONTEXT_SW
//............................................................................
Q_NORETURN Q_onAssert(char const * const module, int_t const loc) {

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++ on STM32 NUCLEO-L053R8, QK kernel, GNU-ARM
# Last Updated for Version: 7.1.0
# Date of the Last Update: 2022-08-26
# Last Updated for Version: 7.2.0
# Date of the Last Update: 2022-12-14
#
# Q u a n t u m L e a P s
# ------------------------
@ -133,7 +133,7 @@ LIBS :=
# defines
DEFINES := \
-DQK_ON_CONTEXT_SW \
-DQF_ON_CONTEXT_SW \
-DQK_USE_IRQ_HANDLER=LCD_IRQHandler \
-DQK_USE_IRQ_NUM=30

View File

@ -1,13 +1,13 @@
//============================================================================
// Product: DPP example, STM32 NUCLEO-L053R8 board, preemptive QXK kernel
// Last updated for: @qpcpp_7_1_0
// Last updated on 2021-08-26
// Last updated for: @qpcpp_721_0
// Last updated on 2022-12-13
//
// Q u a n t u m L e a P s
// ------------------------
// Modern Embedded Software
//
// Copyright (C) 2005-2021 Quantum Leaps. All rights reserved.
// Copyright (C) 2005 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
@ -282,10 +282,10 @@ void QF::onCleanup(void) {
}
//............................................................................
#ifdef QXK_ON_CONTEXT_SW
#ifdef QF_ON_CONTEXT_SW
// NOTE: the context-switch callback is called with interrupts DISABLED
extern "C"
void QXK_onContextSw(QActive *prev, QActive *next) {
void QF_onContextSw(QActive *prev, QActive *next) {
(void)prev;
if (next != (QActive *)0) {
//_impure_ptr = next->thread; // switch to next TLS
@ -295,7 +295,7 @@ void QXK_onContextSw(QActive *prev, QActive *next) {
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif // QXK_ON_CONTEXT_SW
#endif // QF_ON_CONTEXT_SW
//............................................................................
void QXK::onIdle(void) {
// toggle the User LED on and then off (not enough LEDs, see NOTE2)

View File

@ -1,7 +1,7 @@
##############################################################################
# Product: Makefile for QP/C++ on NUCLEO-L053R8, QXK kernel, GNU-ARM
# Last Updated for Version: 7.0.1
# Date of the Last Update: 2022-05-23
# Last Updated for Version: 7.2.0
# Date of the Last Update: 2022-12-14
#
# Q u a n t u m L e a P s
# ------------------------
@ -45,7 +45,7 @@
# NOTE:
# To use this Makefile on Windows, you will need the GNU make utility, which
# is included in the Qtools collection for Windows, see:
# https://sourceforge.net/projects/qpc/files/QTools/
# https://github.com/QuantumLeaps/qtools/releases
#
#-----------------------------------------------------------------------------
@ -137,7 +137,7 @@ LIB_DIRS :=
LIBS :=
# defines
DEFINES := -DQXK_ON_CONTEXT_SW \
DEFINES := -DQF_ON_CONTEXT_SW \
-DQXK_USE_IRQ_HANDLER=LCD_IRQHandler \
-DQXK_USE_IRQ_NUM=30

View File

@ -214,7 +214,7 @@
</option>
<option>
<name>CCDefines</name>
<state>QXK_ON_CONTEXT_SW</state>
<state>QF_ON_CONTEXT_SW</state>
<state>QXK_USE_IRQ_HANDLER=LCD_IRQHandler</state>
<state>QXK_USE_IRQ_NUM=30</state>
</option>
@ -2319,7 +2319,7 @@
<option>
<name>CCDefines</name>
<state>Q_SPY</state>
<state>QXK_ON_CONTEXT_SW</state>
<state>QF_ON_CONTEXT_SW</state>
</option>
<option>
<name>CCPreprocFile</name>
@ -3280,7 +3280,7 @@
</option>
<option>
<name>CCDefines</name>
<state>QXK_ON_CONTEXT_SW</state>
<state>QF_ON_CONTEXT_SW</state>
<state>QXK_USE_IRQ_NUM=30</state>
<state>QXK_USE_IRQ_HANDLER=LCD_IRQHandler</state>
</option>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ constexpr char const * const EATING = &"eating "[0];
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ inline uint8_t PHILO_ID(Philo const * const me) {
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ constexpr char const * const EATING = &"eating "[0];
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ inline uint8_t PHILO_ID(Philo const * const me) {
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -321,9 +321,9 @@ void QF::onCleanup(void) {
}
//............................................................................
#ifdef QK_ON_CONTEXT_SW
#ifdef QF_ON_CONTEXT_SW
/* NOTE: the context-switch callback is called with interrupts DISABLED */
void QK_onContextSw(QActive *prev, QActive *next) {
void QF_onContextSw(QActive *prev, QActive *next) {
(void)prev;
if (next != (QActive *)0) {
//_impure_ptr = next->thread; /* switch to next TLS */
@ -333,7 +333,7 @@ void QK_onContextSw(QActive *prev, QActive *next) {
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif /* QK_ON_CONTEXT_SW */
#endif /* QF_ON_CONTEXT_SW */
//............................................................................
void QK::onIdle(void) {
// toggle the User LED on and then off, see NOTE2

View File

@ -1,7 +1,7 @@
//============================================================================
// Product: DPP example, NUCLEO-L552ZE board, dual-mode QXK kernel
// Last updated for: @qpcpp_7_0_0
// Last updated on 2022-02-28
// Last updated for: @qpcpp_7_2_0
// Last updated on 2022-12-13
//
// Q u a n t u m L e a P s
// ------------------------
@ -321,9 +321,9 @@ void QF::onCleanup(void) {
}
//............................................................................
#ifdef QXK_ON_CONTEXT_SW
#ifdef QF_ON_CONTEXT_SW
/* NOTE: the context-switch callback is called with interrupts DISABLED */
void QXK_onContextSw(QActive *prev, QActive *next) {
void QF_onContextSw(QActive *prev, QActive *next) {
(void)prev;
if (next != (QActive *)0) {
//_impure_ptr = next->thread; /* switch to next TLS */
@ -333,7 +333,7 @@ void QXK_onContextSw(QActive *prev, QActive *next) {
QS_OBJ(next);
QS_END_NOCRIT()
}
#endif /* QXK_ON_CONTEXT_SW */
#endif /* QF_ON_CONTEXT_SW */
//............................................................................
void QXK::onIdle(void) {
// toggle the User LED on and then off, see NOTE2

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ constexpr char const * const EATING = &"eating "[0];
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -96,8 +96,8 @@ QP::QActive * const AO_Philo[N_PHILO] = { // "opaque" pointers to Philo AO
// Philo definition ----------------------------------------------------------
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -154,30 +154,7 @@ void BSP::init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
// NOTE: The VFP (hardware Floating Point) unit is configured by QK
GPIO_InitTypeDef GPIO_struct;

View File

@ -151,30 +151,7 @@ void BSP::init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
// NOTE: The VFP (hardware Floating Point) unit is configured by QV
GPIO_InitTypeDef GPIO_struct;

View File

@ -154,30 +154,7 @@ void BSP::init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
// NOTE: The VFP (hardware Floating Point) unit is configured by QXK
GPIO_InitTypeDef GPIO_struct;

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -87,8 +87,8 @@ QP::QActive * const AO_Table = &l_table; // "opaque" AO pointer
//............................................................................
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: game.qm
// File: ${.::game.hpp}
//
// This code has been generated by QM 5.2.0 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -154,12 +154,12 @@ extern QP::QActive * const AO_Ship;
extern QP::QActive * const AO_Missile;
//${Shared::Mine1_getInst} ...................................................
QP::QHsm * Mine1_getInst(std::uint8_t id) ;
QP::QHsm * Mine1_getInst(std::uint8_t id);
//${Shared::Mine2_getInst} ...................................................
QP::QHsm * Mine2_getInst(std::uint8_t id) ;
QP::QHsm * Mine2_getInst(std::uint8_t id);
} // namespace GAME
//$enddecl${Shared} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#endif // GAME_HPP
#endif // GAME_HPP

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.0" links="1">
<model version="5.2.4" links="1">
<documentation>&quot;Fly 'n' Shoot&quot; game model from Chapters 1 &amp; 9 of PSiCC2</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: game.qm
// File: ${.::mine1.cpp}
//
// This code has been generated by QM 5.2.0 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -76,8 +76,8 @@ static inline uint8_t MINE_ID(Mine1 const * const me) {
// Mine1 class definition ----------------------------------------------------
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: game.qm
// File: ${.::mine2.cpp}
//
// This code has been generated by QM 5.2.0 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -76,8 +76,8 @@ static inline std::uint8_t MINE_ID(Mine2 const * const me) {
// Mine1 class definition ----------------------------------------------------
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: game.qm
// File: ${.::missile.cpp}
//
// This code has been generated by QM 5.2.0 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -63,8 +63,8 @@ protected:
// Public-scope shared objects -----------------------------------------------
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -173,30 +173,7 @@ void BSP_init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
#endif
// NOTE: The VFP (hardware Floating Point) unit is configured by QK
// enable clock for to the peripherals used by this application...
CMU_ClockEnable(cmuClock_HFPER, true);

View File

@ -167,15 +167,7 @@ void BSP_init(void) {
//
SystemCoreClockUpdate();
// configure the FPU usage by choosing one of the options...
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
// NOTE: The VFP (hardware Floating Point) unit is configured by QV
// enable clock for to the peripherals used by this application...
CMU_ClockEnable(cmuClock_HFPER, true);

View File

@ -3,7 +3,7 @@
// Model: game.qm
// File: ${.::ship.cpp}
//
// This code has been generated by QM 5.2.0 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -69,8 +69,8 @@ protected:
// Public-scope shared objects -----------------------------------------------
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: game.qm
// File: ${.::tunnel.cpp}
//
// This code has been generated by QM 5.2.0 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -84,8 +84,8 @@ protected:
// Public-scope shared objects -----------------------------------------------
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: low-power.qm
// File: ${.::blinky0.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -61,8 +61,8 @@ protected:
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: low-power.qm
// File: ${.::blinky1.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -59,8 +59,8 @@ protected:
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Low-Power example</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: low-power.qm
// File: ${.::low_power.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -102,10 +102,7 @@ void BSP_init(void) {
SYSCTL_XTAL_16MHZ);
SystemCoreClock = XTAL_HZ;
// FPU ( Floating Point Unit) configuration for QK
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
// NOTE: The VFP (hardware Floating Point) unit is configured by QK
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF

View File

@ -99,32 +99,7 @@ void BSP_init(void) {
SYSCTL_XTAL_16MHZ);
SystemCoreClock = XTAL_HZ;
// FPU ( Floating Point Unit) configuration for QV
// choose one of the options...
#if 1
// OPTION 1:
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in more than one task or
// in any ISRs. This setting is the safest and recommended, but requires
// extra stack space and CPU cycles.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
#else
// OPTION 2:
// Do NOT to use the automatic FPU state preservation and
// do NOT to use the FPU lazy stacking.
//
// NOTE:
// Use the following setting when FPU is used in ONE task only and not
// in any ISR. This setting is very efficient, but if more than one task
// (or ISR) start using the FPU, this can lead to corruption of the
// FPU registers. This option should be used with CAUTION.
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos)
| (1U << FPU_FPCCR_LSPEN_Pos));
#endif
// NOTE: The VFP (hardware Floating Point) unit is configured by QV
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF

View File

@ -103,10 +103,7 @@ void BSP_init(void) {
SYSCTL_XTAL_16MHZ);
SystemCoreClock = XTAL_HZ;
// FPU ( Floating Point Unit) configuration for QXK
// Use the automatic FPU state preservation and the FPU lazy stacking.
//
FPU->FPCCR |= (1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos);
// NOTE: The VFP (hardware Floating Point) unit is configured by QXK
// enable clock for to the peripherals used by this application...
SYSCTL->RCGCGPIO |= (1U << 5); // enable Run mode for GPIOF

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::dpp.hpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<model version="5.2.2" links="1">
<model version="5.2.4" links="1">
<documentation>Dining Philosopher Problem example with MSM state machines</documentation>
<!--${qpcpp}-->
<framework name="qpcpp"/>

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::philo.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ inline uint8_t PHILO_ID(Philo const * const me) {
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@
// Model: dpp.qm
// File: ${.::table.cpp}
//
// This code has been generated by QM 5.2.2 <www.state-machine.com/qm>.
// This code has been generated by QM 5.2.4 <www.state-machine.com/qm>.
// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
//
// SPDX-License-Identifier: GPL-3.0-or-later
@ -83,8 +83,8 @@ constexpr char const * const EATING = &"eating "[0];
//$skip${QP_VERSION} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// Check for the minimum required QP version
#if (QP_VERSION < 690U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 6.9.0 or higher required
#if (QP_VERSION < 700U) || (QP_VERSION != ((QP_RELEASE^4294967295U) % 0x3E8U))
#error qpcpp version 7.0.0 or higher required
#endif
//$endskip${QP_VERSION} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -161,7 +161,7 @@ void OS_Idle(void) {
b = QP::QS::getByte();
QF_INT_ENABLE();
if (b != QP::QS_EOD) { // not End-Of-Data?
if (b != QS_EOD) { // not End-Of-Data?
DPP::l_uartHandle.Instance->TDR = (b & 0xFFU); // put into TDR
}
}
@ -216,10 +216,7 @@ void BSP::init(void) {
__HAL_FLASH_ART_ENABLE();
#endif // ART_ACCLERATOR_ENABLE
// Explictily Disable the automatic FPU state preservation as well as
// the FPU lazy stacking
//
FPU->FPCCR &= ~((1U << FPU_FPCCR_ASPEN_Pos) | (1U << FPU_FPCCR_LSPEN_Pos));
// NOTE: The VFP (hardware Floating Point) unit is configured by RTOS
// Configure the LEDs
BSP_LED_Init(LED1);

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