From edb58c9794110dc798cd26e338b8661da475cea9 Mon Sep 17 00:00:00 2001 From: MMS Date: Thu, 14 Dec 2023 16:55:58 -0500 Subject: [PATCH] 7.3.2 --- 3rd_party | 2 +- .../arm-cm/dpp_efm32-slstk3401a/qk/bsp.cpp | 16 +- .../arm-cm/dpp_efm32-slstk3401a/qv/bsp.cpp | 15 +- .../arm-cm/dpp_efm32-slstk3401a/qxk/bsp.cpp | 15 +- examples/arm-cm/dpp_ek-tm4c123gxl/qk/bsp.cpp | 15 +- examples/arm-cm/dpp_ek-tm4c123gxl/qv/bsp.cpp | 14 +- examples/arm-cm/dpp_ek-tm4c123gxl/qxk/bsp.cpp | 15 +- examples/arm-cm/dpp_ek-tm4c123gxl_mpu/dpp.hpp | 5 + .../arm-cm/dpp_ek-tm4c123gxl_mpu/dpp_mpu.qm | 19 +- .../arm-cm/dpp_ek-tm4c123gxl_mpu/qk/bsp.cpp | 21 +- .../arm-cm/dpp_ek-tm4c123gxl_mpu/qv/bsp.cpp | 20 +- .../arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/bsp.cpp | 22 +-- .../dpp_ek-tm4c123gxl_mpu/qxk/xthread1.cpp | 21 +- .../dpp_ek-tm4c123gxl_mpu/qxk/xthread2.cpp | 5 - examples/arm-cm/dpp_mbed-lpc1768/qk/bsp.cpp | 17 +- examples/arm-cm/dpp_mbed-lpc1768/qv/bsp.cpp | 15 +- examples/arm-cm/dpp_mbed-lpc1768/qxk/bsp.cpp | 17 +- examples/arm-cm/dpp_nucleo-c031c6/qk/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-c031c6/qv/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-c031c6/qxk/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-c031c6_mpu/dpp.hpp | 5 + .../arm-cm/dpp_nucleo-c031c6_mpu/dpp_mpu.qm | 19 +- .../arm-cm/dpp_nucleo-c031c6_mpu/qk/bsp.cpp | 21 +- .../arm-cm/dpp_nucleo-c031c6_mpu/qv/bsp.cpp | 21 +- .../arm-cm/dpp_nucleo-c031c6_mpu/qxk/bsp.cpp | 22 +-- .../dpp_nucleo-c031c6_mpu/qxk/xthread1.cpp | 21 +- .../dpp_nucleo-c031c6_mpu/qxk/xthread2.cpp | 5 - examples/arm-cm/dpp_nucleo-h743zi/qk/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-h743zi/qv/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-h743zi/qxk/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-l053r8/qk/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-l053r8/qv/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-l053r8/qxk/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-l152re/qk/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-l152re/qv/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-l152re/qxk/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-l552ze/qk/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-l552ze/qv/bsp.cpp | 16 +- examples/arm-cm/dpp_nucleo-l552ze/qxk/bsp.cpp | 16 +- .../arm-cm/dpp_stm32f4-discovery/qk/bsp.cpp | 16 +- .../arm-cm/dpp_stm32f4-discovery/qv/bsp.cpp | 16 +- .../arm-cm/dpp_stm32f4-discovery/qxk/bsp.cpp | 16 +- .../arm-cm/game_efm32-slstk3401a/qk/bsp.cpp | 14 +- .../arm-cm/game_efm32-slstk3401a/qv/bsp.cpp | 14 +- .../arm-cr/dpp_launchxl2-tms57012/qk/bsp.cpp | 14 +- .../arm-cr/dpp_launchxl2-tms57012/qv/bsp.cpp | 16 +- .../embos/arm-cm/dpp_nucleo-h743zi/bsp.cpp | 18 +- .../freertos/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp | 18 +- .../freertos/arm-cm/dpp_nucleo-h743zi/bsp.cpp | 18 +- .../lwip/arm-cm/lwip_ek-lm3s6965/qk/bsp.cpp | 9 +- .../lwip/arm-cm/lwip_ek-lm3s6965/qv/bsp.cpp | 9 +- .../msp430/dpp_msp-exp430f5529lp/qk/bsp.cpp | 11 +- .../msp430/dpp_msp-exp430f5529lp/qv/bsp.cpp | 11 +- .../dpp_efm32-slstk3401a/qk/bsp.cpp | 28 +-- .../dpp_efm32-slstk3401a/qv/bsp.cpp | 28 +-- .../dpp_efm32-slstk3401a/qxk/bsp.cpp | 28 +-- .../dpp_efm32-slstk3401a/uc-os2/bsp.cpp | 32 ++- .../dpp_microstick2-pic32/qk/xc32/bsp.cpp | 25 ++- .../dpp_microstick2-pic32/qv/xc32/bsp.cpp | 25 ++- .../qutest/qhsmtst/test/test_qhsm-funct.py | 12 +- examples/qutest/qmsmtst/src/qmsmtst.cpp | 16 +- examples/qutest/qmsmtst/src/qmsmtst.hpp | 2 +- examples/qutest/qmsmtst/src/qmsmtst.qm | 20 +- .../qutest/qmsmtst/test/test_qmsm-funct.py | 14 +- examples/qutest/qmsmtst/test/test_qmsm.cpp | 2 +- .../threadx/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp | 12 +- .../arm-cm/dpp_stm32f429-discovery/bsp.cpp | 12 +- .../uc-os2/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp | 14 +- examples/zephyr/dpp/src/bsp.cpp | 4 +- include/qp.hpp | 23 ++- ports/posix-qv/qs_port.cpp | 12 +- ports/posix/qs_port.cpp | 12 +- ports/win32-qutest/qutest_port.cpp | 12 +- ports/win32-qv/qs_port.cpp | 24 +-- ports/win32/qs_port.cpp | 24 +-- qpcpp.md5 | 158 +++++++++++++++ qpcpp.qm | 76 ++++++- qpcpp.sha256 | 186 ------------------ qpcpp_md5.bat | 42 ++++ src/qf/qep_msm.cpp | 26 ++- src/qs/qs.cpp | 2 + src/qs/qutest.cpp | 13 +- zephyr/qutest_port.cpp | 7 +- 83 files changed, 782 insertions(+), 917 deletions(-) create mode 100644 qpcpp.md5 delete mode 100644 qpcpp.sha256 create mode 100644 qpcpp_md5.bat diff --git a/3rd_party b/3rd_party index 90b36151b..b2df302a9 160000 --- a/3rd_party +++ b/3rd_party @@ -1 +1 @@ -Subproject commit 90b36151b30c5e4b1cf8fa2ab7862568a75806e9 +Subproject commit b2df302a9ba285da0aea71e3def72f006ebf36c4 diff --git a/examples/arm-cm/dpp_efm32-slstk3401a/qk/bsp.cpp b/examples/arm-cm/dpp_efm32-slstk3401a/qk/bsp.cpp index 91066c2c2..5d2f7841c 100644 --- a/examples/arm-cm/dpp_efm32-slstk3401a/qk/bsp.cpp +++ b/examples/arm-cm/dpp_efm32-slstk3401a/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EFM32-SLSTK3401A board, QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -495,33 +495,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_USART0->TXDATA = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_efm32-slstk3401a/qv/bsp.cpp b/examples/arm-cm/dpp_efm32-slstk3401a/qv/bsp.cpp index 05b3024b8..eff944da9 100644 --- a/examples/arm-cm/dpp_efm32-slstk3401a/qv/bsp.cpp +++ b/examples/arm-cm/dpp_efm32-slstk3401a/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EFM32-SLSTK3401A board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -486,28 +486,23 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_USART0->TXDATA = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } diff --git a/examples/arm-cm/dpp_efm32-slstk3401a/qxk/bsp.cpp b/examples/arm-cm/dpp_efm32-slstk3401a/qxk/bsp.cpp index ca3812db3..bb431cc89 100644 --- a/examples/arm-cm/dpp_efm32-slstk3401a/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_efm32-slstk3401a/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EFM32-SLSTK3401A board, QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -510,28 +510,23 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_USART0->TXDATA = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl/qk/bsp.cpp b/examples/arm-cm/dpp_ek-tm4c123gxl/qk/bsp.cpp index c734e3596..f185a0c7a 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl/qk/bsp.cpp +++ b/examples/arm-cm/dpp_ek-tm4c123gxl/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EK-TM4C123GXL board, QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -479,28 +479,23 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return TIMER5->TAV; } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((UART0->FR & UART_FR_TXFE) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } UART0->DR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl/qv/bsp.cpp b/examples/arm-cm/dpp_ek-tm4c123gxl/qv/bsp.cpp index 4ff60c300..fe7c45396 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl/qv/bsp.cpp +++ b/examples/arm-cm/dpp_ek-tm4c123gxl/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EK-TM4C123GXL board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -466,22 +466,18 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return TIMER5->TAV; } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((UART0->FR & UART_FR_TXFE) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } UART0->DR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl/qxk/bsp.cpp b/examples/arm-cm/dpp_ek-tm4c123gxl/qxk/bsp.cpp index c3683b0b7..9543cf045 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_ek-tm4c123gxl/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EK-TM4C123GXL board, QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -492,28 +492,23 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return TIMER5->TAV; } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((UART0->FR & UART_FR_TXFE) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } UART0->DR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/dpp.hpp b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/dpp.hpp index 544e2fdc1..2b234a00b 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/dpp.hpp +++ b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/dpp.hpp @@ -140,6 +140,11 @@ extern QP::QXSemaphore TH_sema; // accessible to the threads. extern QP::QXMutex TH_mutex; +//${Shared-TH::TH_obj_dict} .................................................. +#ifdef Q_SPY +void TH_obj_dict(); +#endif // def Q_SPY + } // namespace APP //$enddecl${Shared-TH} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #endif // QXK_HPP_ diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/dpp_mpu.qm b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/dpp_mpu.qm index 4048ab044..1b189921a 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/dpp_mpu.qm +++ b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/dpp_mpu.qm @@ -135,6 +135,16 @@ me->setThread(mpu); // NOTE: kernel objects can be allocated outside any memory regions // accessible to the threads. + + + QS_OBJ_DICTIONARY(TH_XThread1); +QS_OBJ_DICTIONARY(TH_XThread1->getTimeEvt()); + +QS_OBJ_DICTIONARY(TH_XThread2); +QS_OBJ_DICTIONARY(TH_XThread2->getTimeEvt()); +QS_OBJ_DICTIONARY(&TH_sema); +QS_OBJ_DICTIONARY(&TH_mutex); + @@ -522,9 +532,6 @@ m_fork[n] = FREE; // downcast the generic thr pointer to the specific thread auto me = static_cast<XThread1 *>(thr); -QS_OBJ_DICTIONARY(TH_XThread1); -QS_OBJ_DICTIONARY(TH_XThread1->getTimeEvt()); - // subscribe to the EAT signal (from the application) me->subscribe(APP::EAT_SIG); @@ -568,11 +575,6 @@ for (;;) { // downcast the generic thr pointer to the specific thread //auto me = static_cast<XThread2 *>(thr); -QS_OBJ_DICTIONARY(TH_XThread2); -QS_OBJ_DICTIONARY(TH_XThread2->getTimeEvt()); -QS_OBJ_DICTIONARY(&TH_sema); -QS_OBJ_DICTIONARY(&TH_mutex); - // initialize the semaphore before using it // NOTE: Here the semaphore is initialized in the highest-priority thread // that uses it. Alternatively, the semaphore can be initialized @@ -702,6 +704,7 @@ $define ${Shared-TH::TH_mutex} $declare ${XThreads::XThread1} $define ${Shared-TH::XThread1_ctor} +$define ${Shared-TH::TH_obj_dict} $define ${XThreads::XThread1} diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qk/bsp.cpp b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qk/bsp.cpp index e12c87b2e..2011b99ed 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qk/bsp.cpp +++ b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EK-TM4C123GXL board, QK kernel, MPU isolation -// Last updated for version 7.3.0 -// Last updated on 2023-08-15 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -810,38 +810,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return TIMER5->TAV; } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); - QF_MEM_SYS(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((UART0->FR & UART_FR_TXFE) == 0U) { // while TXE not empty - QF_MEM_APP(); - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); - QF_MEM_SYS(); } UART0->DR = b; // put into the DR register - QF_MEM_APP(); - QF_INT_ENABLE(); } else { - QF_MEM_APP(); - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qv/bsp.cpp b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qv/bsp.cpp index 2680d9cc5..6d189a061 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qv/bsp.cpp +++ b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EK-TM4C123GXL board, QV kernel, MPU isolation -// Last updated for version 7.3.0 -// Last updated on 2023-08-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -799,33 +799,23 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return TIMER5->TAV; } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); - QF_MEM_SYS(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((UART0->FR & UART_FR_TXFE) == 0U) { // while TXE not empty - QF_MEM_APP(); - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); - QF_MEM_SYS(); } UART0->DR = b; // put into the DR register - QF_MEM_APP(); - QF_INT_ENABLE(); } else { - QF_MEM_APP(); - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/bsp.cpp b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/bsp.cpp index aa8240713..65061eb62 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EK-TM4C123GXL board, QXK kernel, MPU isolation -// Last updated for version 7.3.1 -// Last updated on 2023-12-04 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -633,6 +633,7 @@ void init() { QS_USR_DICTIONARY(PAUSED_STAT); QS_ONLY(APP::produce_sig_dict()); + QS_ONLY(APP::TH_obj_dict()); // setup the QS filters... QS_GLB_FILTER(QP::QS_ALL_RECORDS); // all records @@ -911,38 +912,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return TIMER5->TAV; } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); - QF_MEM_SYS(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((UART0->FR & UART_FR_TXFE) == 0U) { // while TXE not empty - QF_MEM_APP(); - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); - QF_MEM_SYS(); } UART0->DR = b; // put into the DR register - QF_MEM_APP(); - QF_INT_ENABLE(); } else { - QF_MEM_APP(); - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/xthread1.cpp b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/xthread1.cpp index b3d9587aa..ab3561ed7 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/xthread1.cpp +++ b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/xthread1.cpp @@ -101,6 +101,24 @@ void XThread1_ctor( } // namespace APP //$enddef${Shared-TH::XThread1_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +//$define${Shared-TH::TH_obj_dict} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv +namespace APP { + +//${Shared-TH::TH_obj_dict} .................................................. +#ifdef Q_SPY +void TH_obj_dict() { + QS_OBJ_DICTIONARY(TH_XThread1); + QS_OBJ_DICTIONARY(TH_XThread1->getTimeEvt()); + + QS_OBJ_DICTIONARY(TH_XThread2); + QS_OBJ_DICTIONARY(TH_XThread2->getTimeEvt()); + QS_OBJ_DICTIONARY(&TH_sema); + QS_OBJ_DICTIONARY(&TH_mutex); +} +#endif // def Q_SPY + +} // namespace APP +//$enddef${Shared-TH::TH_obj_dict} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //$define${XThreads::XThread1} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv namespace APP { @@ -116,9 +134,6 @@ void XThread1::run(QP::QXThread * const thr) { // downcast the generic thr pointer to the specific thread auto me = static_cast(thr); - QS_OBJ_DICTIONARY(TH_XThread1); - QS_OBJ_DICTIONARY(TH_XThread1->getTimeEvt()); - // subscribe to the EAT signal (from the application) me->subscribe(APP::EAT_SIG); diff --git a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/xthread2.cpp b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/xthread2.cpp index 25b7efc85..158cbb1ef 100644 --- a/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/xthread2.cpp +++ b/examples/arm-cm/dpp_ek-tm4c123gxl_mpu/qxk/xthread2.cpp @@ -100,11 +100,6 @@ void XThread2::run(QP::QXThread * const thr) { // downcast the generic thr pointer to the specific thread //auto me = static_cast(thr); - QS_OBJ_DICTIONARY(TH_XThread2); - QS_OBJ_DICTIONARY(TH_XThread2->getTimeEvt()); - QS_OBJ_DICTIONARY(&TH_sema); - QS_OBJ_DICTIONARY(&TH_mutex); - // initialize the semaphore before using it // NOTE: Here the semaphore is initialized in the highest-priority thread // that uses it. Alternatively, the semaphore can be initialized diff --git a/examples/arm-cm/dpp_mbed-lpc1768/qk/bsp.cpp b/examples/arm-cm/dpp_mbed-lpc1768/qk/bsp.cpp index 2cf7c3b82..9ed44a309 100644 --- a/examples/arm-cm/dpp_mbed-lpc1768/qk/bsp.cpp +++ b/examples/arm-cm/dpp_mbed-lpc1768/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NXP mbed-LPC1768 board, QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -492,34 +492,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); - QF_INT_ENABLE(); if (b != QS_EOD) { while ((LPC_UART0->LSR & 0x20U) == 0U) { // while THR empty... - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } LPC_UART0->THR = b; // put into the THR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_mbed-lpc1768/qv/bsp.cpp b/examples/arm-cm/dpp_mbed-lpc1768/qv/bsp.cpp index 2739e7a50..b402f601a 100644 --- a/examples/arm-cm/dpp_mbed-lpc1768/qv/bsp.cpp +++ b/examples/arm-cm/dpp_mbed-lpc1768/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NXP mbed-LPC1768 board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -481,23 +481,18 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); - QF_INT_ENABLE(); if (b != QS_EOD) { while ((LPC_UART0->LSR & 0x20U) == 0U) { // while THR empty... - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } LPC_UART0->THR = b; // put into the THR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } diff --git a/examples/arm-cm/dpp_mbed-lpc1768/qxk/bsp.cpp b/examples/arm-cm/dpp_mbed-lpc1768/qxk/bsp.cpp index 4c64a5dc3..eb2b6feaf 100644 --- a/examples/arm-cm/dpp_mbed-lpc1768/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_mbed-lpc1768/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NXP mbed-LPC1768 board, QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-09 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -506,34 +506,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); - QF_INT_ENABLE(); if (b != QS_EOD) { while ((LPC_UART0->LSR & 0x20U) == 0U) { // while THR empty... - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } LPC_UART0->THR = b; // put into the THR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-c031c6/qk/bsp.cpp b/examples/arm-cm/dpp_nucleo-c031c6/qk/bsp.cpp index 5bf380e3f..1f9c0caf4 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6/qk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-c031c6/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-C031C6 board, QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -475,33 +475,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->ISR & (1U << 7U)) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->TDR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-c031c6/qv/bsp.cpp b/examples/arm-cm/dpp_nucleo-c031c6/qv/bsp.cpp index 89a29c469..241a1c77b 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6/qv/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-c031c6/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-C031C6 board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-28 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -460,33 +460,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->ISR & (1U << 7U)) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->TDR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-c031c6/qxk/bsp.cpp b/examples/arm-cm/dpp_nucleo-c031c6/qxk/bsp.cpp index ba7c729d0..3d8389344 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-c031c6/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-C031C6 board, QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-15 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -493,33 +493,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->ISR & (1U << 7U)) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->TDR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-c031c6_mpu/dpp.hpp b/examples/arm-cm/dpp_nucleo-c031c6_mpu/dpp.hpp index 544e2fdc1..2b234a00b 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6_mpu/dpp.hpp +++ b/examples/arm-cm/dpp_nucleo-c031c6_mpu/dpp.hpp @@ -140,6 +140,11 @@ extern QP::QXSemaphore TH_sema; // accessible to the threads. extern QP::QXMutex TH_mutex; +//${Shared-TH::TH_obj_dict} .................................................. +#ifdef Q_SPY +void TH_obj_dict(); +#endif // def Q_SPY + } // namespace APP //$enddecl${Shared-TH} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #endif // QXK_HPP_ diff --git a/examples/arm-cm/dpp_nucleo-c031c6_mpu/dpp_mpu.qm b/examples/arm-cm/dpp_nucleo-c031c6_mpu/dpp_mpu.qm index 4048ab044..1b189921a 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6_mpu/dpp_mpu.qm +++ b/examples/arm-cm/dpp_nucleo-c031c6_mpu/dpp_mpu.qm @@ -135,6 +135,16 @@ me->setThread(mpu); // NOTE: kernel objects can be allocated outside any memory regions // accessible to the threads. + + + QS_OBJ_DICTIONARY(TH_XThread1); +QS_OBJ_DICTIONARY(TH_XThread1->getTimeEvt()); + +QS_OBJ_DICTIONARY(TH_XThread2); +QS_OBJ_DICTIONARY(TH_XThread2->getTimeEvt()); +QS_OBJ_DICTIONARY(&TH_sema); +QS_OBJ_DICTIONARY(&TH_mutex); + @@ -522,9 +532,6 @@ m_fork[n] = FREE; // downcast the generic thr pointer to the specific thread auto me = static_cast<XThread1 *>(thr); -QS_OBJ_DICTIONARY(TH_XThread1); -QS_OBJ_DICTIONARY(TH_XThread1->getTimeEvt()); - // subscribe to the EAT signal (from the application) me->subscribe(APP::EAT_SIG); @@ -568,11 +575,6 @@ for (;;) { // downcast the generic thr pointer to the specific thread //auto me = static_cast<XThread2 *>(thr); -QS_OBJ_DICTIONARY(TH_XThread2); -QS_OBJ_DICTIONARY(TH_XThread2->getTimeEvt()); -QS_OBJ_DICTIONARY(&TH_sema); -QS_OBJ_DICTIONARY(&TH_mutex); - // initialize the semaphore before using it // NOTE: Here the semaphore is initialized in the highest-priority thread // that uses it. Alternatively, the semaphore can be initialized @@ -702,6 +704,7 @@ $define ${Shared-TH::TH_mutex} $declare ${XThreads::XThread1} $define ${Shared-TH::XThread1_ctor} +$define ${Shared-TH::TH_obj_dict} $define ${XThreads::XThread1} diff --git a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qk/bsp.cpp b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qk/bsp.cpp index 4188b133e..3e96bdd56 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-C031C6 board, QK kernel, MPU isolation -// Last updated for version 7.3.0 -// Last updated on 2023-08-28 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -809,38 +809,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); - QF_MEM_SYS(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->ISR & (1U << 7U)) == 0U) { // while TXE not empty - QF_MEM_APP(); - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); - QF_MEM_SYS(); } USART2->TDR = b; // put into the DR register - QF_MEM_APP(); - QF_INT_ENABLE(); } else { - QF_MEM_APP(); - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qv/bsp.cpp b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qv/bsp.cpp index c3825acb2..26c2845a4 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qv/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-C031C6 board, QV kernel, MPU isolation -// Last updated for version 7.3.0 -// Last updated on 2023-08-28 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -802,38 +802,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); - QF_MEM_SYS(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->ISR & (1U << 7U)) == 0U) { // while TXE not empty - QF_MEM_APP(); - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); - QF_MEM_SYS(); } USART2->TDR = b; // put into the DR register - QF_MEM_APP(); - QF_INT_ENABLE(); } else { - QF_MEM_APP(); - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/bsp.cpp b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/bsp.cpp index 6cfeca71d..ac3ba3bc0 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-C031C6 board, QXK kernel, MPU isolation -// Last updated for version 7.3.1 -// Last updated on 2023-12-03 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -616,6 +616,7 @@ void init() { QS_USR_DICTIONARY(PAUSED_STAT); QS_ONLY(APP::produce_sig_dict()); + QS_ONLY(APP::TH_obj_dict()); // setup the QS filters... QS_GLB_FILTER(QP::QS_ALL_RECORDS); // all records @@ -900,38 +901,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); - QF_MEM_SYS(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->ISR & (1U << 7U)) == 0U) { // while TXE not empty - QF_MEM_APP(); - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); - QF_MEM_SYS(); } USART2->TDR = b; // put into the DR register - QF_MEM_APP(); - QF_INT_ENABLE(); } else { - QF_MEM_APP(); - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/xthread1.cpp b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/xthread1.cpp index b3d9587aa..ab3561ed7 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/xthread1.cpp +++ b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/xthread1.cpp @@ -101,6 +101,24 @@ void XThread1_ctor( } // namespace APP //$enddef${Shared-TH::XThread1_ctor} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +//$define${Shared-TH::TH_obj_dict} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv +namespace APP { + +//${Shared-TH::TH_obj_dict} .................................................. +#ifdef Q_SPY +void TH_obj_dict() { + QS_OBJ_DICTIONARY(TH_XThread1); + QS_OBJ_DICTIONARY(TH_XThread1->getTimeEvt()); + + QS_OBJ_DICTIONARY(TH_XThread2); + QS_OBJ_DICTIONARY(TH_XThread2->getTimeEvt()); + QS_OBJ_DICTIONARY(&TH_sema); + QS_OBJ_DICTIONARY(&TH_mutex); +} +#endif // def Q_SPY + +} // namespace APP +//$enddef${Shared-TH::TH_obj_dict} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //$define${XThreads::XThread1} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv namespace APP { @@ -116,9 +134,6 @@ void XThread1::run(QP::QXThread * const thr) { // downcast the generic thr pointer to the specific thread auto me = static_cast(thr); - QS_OBJ_DICTIONARY(TH_XThread1); - QS_OBJ_DICTIONARY(TH_XThread1->getTimeEvt()); - // subscribe to the EAT signal (from the application) me->subscribe(APP::EAT_SIG); diff --git a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/xthread2.cpp b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/xthread2.cpp index 25b7efc85..158cbb1ef 100644 --- a/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/xthread2.cpp +++ b/examples/arm-cm/dpp_nucleo-c031c6_mpu/qxk/xthread2.cpp @@ -100,11 +100,6 @@ void XThread2::run(QP::QXThread * const thr) { // downcast the generic thr pointer to the specific thread //auto me = static_cast(thr); - QS_OBJ_DICTIONARY(TH_XThread2); - QS_OBJ_DICTIONARY(TH_XThread2->getTimeEvt()); - QS_OBJ_DICTIONARY(&TH_sema); - QS_OBJ_DICTIONARY(&TH_mutex); - // initialize the semaphore before using it // NOTE: Here the semaphore is initialized in the highest-priority thread // that uses it. Alternatively, the semaphore can be initialized diff --git a/examples/arm-cm/dpp_nucleo-h743zi/qk/bsp.cpp b/examples/arm-cm/dpp_nucleo-h743zi/qk/bsp.cpp index 52ad428db..f857c09e9 100644 --- a/examples/arm-cm/dpp_nucleo-h743zi/qk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-h743zi/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-H743ZI board, QK kernel -// Last updated for version 7.3.1 -// Last updated on 2023-11-29 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -453,33 +453,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_uartHandle.Instance->ISR & UART_FLAG_TXE) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_uartHandle.Instance->TDR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-h743zi/qv/bsp.cpp b/examples/arm-cm/dpp_nucleo-h743zi/qv/bsp.cpp index 888a97fdc..320dca1e7 100644 --- a/examples/arm-cm/dpp_nucleo-h743zi/qv/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-h743zi/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-H743ZI board, QV kernel -// Last updated for version 7.3.1 -// Last updated on 2023-11-30 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -431,33 +431,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_uartHandle.Instance->ISR & UART_FLAG_TXE) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_uartHandle.Instance->TDR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-h743zi/qxk/bsp.cpp b/examples/arm-cm/dpp_nucleo-h743zi/qxk/bsp.cpp index 16cc41199..236923538 100644 --- a/examples/arm-cm/dpp_nucleo-h743zi/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-h743zi/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-H743ZI board, QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-15 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -464,33 +464,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_uartHandle.Instance->ISR & UART_FLAG_TXE) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_uartHandle.Instance->TDR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-l053r8/qk/bsp.cpp b/examples/arm-cm/dpp_nucleo-l053r8/qk/bsp.cpp index ca4d34265..dff44ea48 100644 --- a/examples/arm-cm/dpp_nucleo-l053r8/qk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-l053r8/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-L053R8 board, QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -473,33 +473,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->ISR & (1U << 7U)) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->TDR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-l053r8/qv/bsp.cpp b/examples/arm-cm/dpp_nucleo-l053r8/qv/bsp.cpp index b128f9dfa..bc5ca5ae0 100644 --- a/examples/arm-cm/dpp_nucleo-l053r8/qv/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-l053r8/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-L053R8 board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -456,33 +456,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->ISR & (1U << 7U)) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->TDR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-l053r8/qxk/bsp.cpp b/examples/arm-cm/dpp_nucleo-l053r8/qxk/bsp.cpp index 13e71801f..11214a044 100644 --- a/examples/arm-cm/dpp_nucleo-l053r8/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-l053r8/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-L053R8 board, QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -486,33 +486,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->ISR & (1U << 7U)) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->TDR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-l152re/qk/bsp.cpp b/examples/arm-cm/dpp_nucleo-l152re/qk/bsp.cpp index b73dd9740..3ee37fcd1 100644 --- a/examples/arm-cm/dpp_nucleo-l152re/qk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-l152re/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-L152RE board, QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -475,33 +475,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->SR & (1U << 7U)) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->DR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-l152re/qv/bsp.cpp b/examples/arm-cm/dpp_nucleo-l152re/qv/bsp.cpp index a00bfb240..400659d56 100644 --- a/examples/arm-cm/dpp_nucleo-l152re/qv/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-l152re/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-L152RE board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -458,33 +458,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->SR & (1U << 7U)) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->DR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-l152re/qxk/bsp.cpp b/examples/arm-cm/dpp_nucleo-l152re/qxk/bsp.cpp index f0b362776..56be0c822 100644 --- a/examples/arm-cm/dpp_nucleo-l152re/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-l152re/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-L152RE board, QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -489,33 +489,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->SR & (1U << 7U)) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->DR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-l552ze/qk/bsp.cpp b/examples/arm-cm/dpp_nucleo-l552ze/qk/bsp.cpp index ff70c8ecd..0dbf2c168 100644 --- a/examples/arm-cm/dpp_nucleo-l552ze/qk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-l552ze/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-L552ZE board, QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -482,33 +482,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_uartHandle.Instance->ISR & UART_FLAG_TXE) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_uartHandle.Instance->TDR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-l552ze/qv/bsp.cpp b/examples/arm-cm/dpp_nucleo-l552ze/qv/bsp.cpp index 39b5db8c0..bc39ad014 100644 --- a/examples/arm-cm/dpp_nucleo-l552ze/qv/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-l552ze/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-L552ZE board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -461,33 +461,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_uartHandle.Instance->ISR & UART_FLAG_TXE) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_uartHandle.Instance->TDR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_nucleo-l552ze/qxk/bsp.cpp b/examples/arm-cm/dpp_nucleo-l552ze/qxk/bsp.cpp index 2f9347b16..cab68b43c 100644 --- a/examples/arm-cm/dpp_nucleo-l552ze/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_nucleo-l552ze/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-L552ZE board, QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -496,33 +496,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_uartHandle.Instance->ISR & UART_FLAG_TXE) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_uartHandle.Instance->TDR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_stm32f4-discovery/qk/bsp.cpp b/examples/arm-cm/dpp_stm32f4-discovery/qk/bsp.cpp index 9fecb024b..28fabcedd 100644 --- a/examples/arm-cm/dpp_stm32f4-discovery/qk/bsp.cpp +++ b/examples/arm-cm/dpp_stm32f4-discovery/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, STM32F4-Discovery board, QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -505,33 +505,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->SR & USART_FLAG_TXE) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->DR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_stm32f4-discovery/qv/bsp.cpp b/examples/arm-cm/dpp_stm32f4-discovery/qv/bsp.cpp index 35df17d6a..b9275ed8c 100644 --- a/examples/arm-cm/dpp_stm32f4-discovery/qv/bsp.cpp +++ b/examples/arm-cm/dpp_stm32f4-discovery/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, STM32F4-Discovery board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -502,33 +502,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->SR & USART_FLAG_TXE) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->DR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/dpp_stm32f4-discovery/qxk/bsp.cpp b/examples/arm-cm/dpp_stm32f4-discovery/qxk/bsp.cpp index d97100d1b..b9356ea57 100644 --- a/examples/arm-cm/dpp_stm32f4-discovery/qxk/bsp.cpp +++ b/examples/arm-cm/dpp_stm32f4-discovery/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, STM32F4-Discovery board, QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -519,33 +519,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((USART2->SR & USART_FLAG_TXE) == 0U) { // while TXE not empty - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } USART2->DR = b; // put into the DR register - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/game_efm32-slstk3401a/qk/bsp.cpp b/examples/arm-cm/game_efm32-slstk3401a/qk/bsp.cpp index 5ceca1661..8782eabb4 100644 --- a/examples/arm-cm/game_efm32-slstk3401a/qk/bsp.cpp +++ b/examples/arm-cm/game_efm32-slstk3401a/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: "Fly 'n' Shoot" game example, EFM32-SLSTK3401A board, QK kernel -// Last updated for: @qpcpp_7_3_0 -// Last updated on 2023-07-19 +// Last updated for: @qpcpp_7_3_2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -858,33 +858,25 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +//! callback function to execute a user command void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_USART0->TXDATA = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cm/game_efm32-slstk3401a/qv/bsp.cpp b/examples/arm-cm/game_efm32-slstk3401a/qv/bsp.cpp index 1d5a34120..634202654 100644 --- a/examples/arm-cm/game_efm32-slstk3401a/qv/bsp.cpp +++ b/examples/arm-cm/game_efm32-slstk3401a/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: "Fly 'n' Shoot" game example, EFM32-SLSTK3401A board, QV kernel -// Last updated for: @qpcpp_7_3_0 -// Last updated on 2023-09-08 +// Last updated for: @qpcpp_7_3_2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -855,33 +855,25 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +//! callback function to execute a user command void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } l_USART0->TXDATA = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cr/dpp_launchxl2-tms57012/qk/bsp.cpp b/examples/arm-cr/dpp_launchxl2-tms57012/qk/bsp.cpp index 23710e1f0..ef587eed9 100644 --- a/examples/arm-cr/dpp_launchxl2-tms57012/qk/bsp.cpp +++ b/examples/arm-cr/dpp_launchxl2-tms57012/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: "DPP" on LAUCHXL2-TMS570LS12 board, preemptive QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-15 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -409,33 +409,25 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return rtiREG1->CNT[0].FRCx; // free running RTI counter0 } //............................................................................ +//! callback function to execute a user command void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((scilinREG->FLR & (uint32)SCI_TX_INT) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } scilinREG->TD = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { systemREG1->SYSECR = 0U; // perform system reset } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/arm-cr/dpp_launchxl2-tms57012/qv/bsp.cpp b/examples/arm-cr/dpp_launchxl2-tms57012/qv/bsp.cpp index 0601e26e0..6c91d8817 100644 --- a/examples/arm-cr/dpp_launchxl2-tms57012/qv/bsp.cpp +++ b/examples/arm-cr/dpp_launchxl2-tms57012/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: "DPP" on LAUCHXL2-TMS570LS12 board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-15 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -389,33 +389,27 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return rtiREG1->CNT[0].FRCx; // free running RTI counter0 } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); if (b != QS_EOD) { while ((scilinREG->FLR & (uint32)SCI_TX_INT) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } scilinREG->TD = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { systemREG1->SYSECR = 0U; // perform system reset } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/embos/arm-cm/dpp_nucleo-h743zi/bsp.cpp b/examples/embos/arm-cm/dpp_nucleo-h743zi/bsp.cpp index 29077e25b..48f51ecdc 100644 --- a/examples/embos/arm-cm/dpp_nucleo-h743zi/bsp.cpp +++ b/examples/embos/arm-cm/dpp_nucleo-h743zi/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-H743ZI board, embOS RTOS kernel -// Last updated for version 7.3.1 -// Last updated on 2023-11-15 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -434,37 +434,29 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); - QF_INT_ENABLE(); - if (b != QS_EOD) { // NOT end-of-data // busy-wait as long as TX FIFO has data to transmit while ((l_uartHandle.Instance->ISR & UART_FLAG_TXE) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } // place the byte in the UART TDR register l_uartHandle.Instance->TDR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; // break out of the loop } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/freertos/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp b/examples/freertos/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp index 8398123dd..6ab7a49b8 100644 --- a/examples/freertos/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp +++ b/examples/freertos/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EK-TM4C123GXL board, FreeRTOS kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-29 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -512,37 +512,29 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return TIMER5->TAV; } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); - QF_INT_ENABLE(); - if (b != QS_EOD) { // NOT end-of-data // busy-wait as long as TXF has data to transmit while ((UART0->FR & UART_FR_TXFE) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } // place the byte in the UART DR register UART0->DR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; // break out of the loop } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/freertos/arm-cm/dpp_nucleo-h743zi/bsp.cpp b/examples/freertos/arm-cm/dpp_nucleo-h743zi/bsp.cpp index a84d7d344..ad27261f6 100644 --- a/examples/freertos/arm-cm/dpp_nucleo-h743zi/bsp.cpp +++ b/examples/freertos/arm-cm/dpp_nucleo-h743zi/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, NUCLEO-H743ZI board, FreeRTOS kernel -// Last updated for version 7.3.1 -// Last updated on 2023-11-15 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -500,37 +500,29 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); - QF_INT_ENABLE(); - if (b != QS_EOD) { // NOT end-of-data // busy-wait as long as TX FIFO has data to transmit while ((l_uartHandle.Instance->ISR & UART_FLAG_TXE) == 0U) { - QF_INT_ENABLE(); - QF_CRIT_EXIT_NOP(); - - QF_INT_DISABLE(); } // place the byte in the UART TDR register l_uartHandle.Instance->TDR = b; - QF_INT_ENABLE(); } else { - QF_INT_ENABLE(); break; // break out of the loop } } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/lwip/arm-cm/lwip_ek-lm3s6965/qk/bsp.cpp b/examples/lwip/arm-cm/lwip_ek-lm3s6965/qk/bsp.cpp index c02e0282a..f9a755021 100644 --- a/examples/lwip/arm-cm/lwip_ek-lm3s6965/qk/bsp.cpp +++ b/examples/lwip/arm-cm/lwip_ek-lm3s6965/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: BSP for DPP with lwIP on EK-LM3S9665 board, QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-06 +// Last updated for version 7.3.3 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -299,6 +299,9 @@ QSTimeCtr QS::onGetTime(void) { // invoked with interrupts locked } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { uint16_t fifo = UART_TXFIFO_DEPTH; // Tx FIFO depth uint8_t const *block; @@ -314,12 +317,10 @@ void QS::onFlush(void) { } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void QS::onReset(void) { //TBD } //............................................................................ -//! callback function to execute a uesr command (to be implemented in BSP) void QS::onCommand(uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3) { diff --git a/examples/lwip/arm-cm/lwip_ek-lm3s6965/qv/bsp.cpp b/examples/lwip/arm-cm/lwip_ek-lm3s6965/qv/bsp.cpp index a3f9679df..3a69c94b4 100644 --- a/examples/lwip/arm-cm/lwip_ek-lm3s6965/qv/bsp.cpp +++ b/examples/lwip/arm-cm/lwip_ek-lm3s6965/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: BSP for DPP with lwIP on EK-LM3S9665 board, QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-06 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -296,6 +296,9 @@ QSTimeCtr QS::onGetTime(void) { // invoked with interrupts locked } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { uint16_t fifo = UART_TXFIFO_DEPTH; // Tx FIFO depth uint8_t const *block; @@ -311,12 +314,10 @@ void QS::onFlush(void) { } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void QS::onReset(void) { //TBD } //............................................................................ -//! callback function to execute a uesr command (to be implemented in BSP) void QS::onCommand(uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3) { diff --git a/examples/msp430/dpp_msp-exp430f5529lp/qk/bsp.cpp b/examples/msp430/dpp_msp-exp430f5529lp/qk/bsp.cpp index c853968be..0ad770e08 100644 --- a/examples/msp430/dpp_msp-exp430f5529lp/qk/bsp.cpp +++ b/examples/msp430/dpp_msp-exp430f5529lp/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // DPP example on MSP-EXP430F5529LP board, preemptive QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-31 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -385,11 +385,12 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); - QF_INT_ENABLE(); if (b != QS_EOD) { while ((UCA1STAT & UCBUSY) != 0U) { // TX busy? } @@ -401,12 +402,10 @@ void onFlush() { } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { WDTCTL = 0xDEAD; } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/msp430/dpp_msp-exp430f5529lp/qv/bsp.cpp b/examples/msp430/dpp_msp-exp430f5529lp/qv/bsp.cpp index 859198570..3c4c18264 100644 --- a/examples/msp430/dpp_msp-exp430f5529lp/qv/bsp.cpp +++ b/examples/msp430/dpp_msp-exp430f5529lp/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // DPP example on MSP-EXP430F5529LP board, preemptive QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-08-31 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -379,11 +379,12 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_INT_DISABLE(); std::uint16_t b = getByte(); - QF_INT_ENABLE(); if (b != QS_EOD) { while ((UCA1STAT & UCBUSY) != 0U) { // TX busy? } @@ -395,12 +396,10 @@ void onFlush() { } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { WDTCTL = 0xDEAD; } //............................................................................ -// callback function to execute a user command void onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/performance/dpp_efm32-slstk3401a/qk/bsp.cpp b/examples/performance/dpp_efm32-slstk3401a/qk/bsp.cpp index d306b8ebf..768218f5a 100644 --- a/examples/performance/dpp_efm32-slstk3401a/qk/bsp.cpp +++ b/examples/performance/dpp_efm32-slstk3401a/qk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EFM32-SLSTK3401A board, preemptive QK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -413,27 +413,27 @@ QSTimeCtr QS::onGetTime(void) { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { - uint16_t b; - - QF_INT_DISABLE(); - while ((b = getByte()) != QS_EOD) { // while not End-Of-Data... - QF_INT_ENABLE(); - // while TXE not empty - while ((DPP::l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { + for (;;) { + std::uint16_t b = getByte(); + if (b != QS_EOD) { + while ((DPP::l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { + } + DPP::l_USART0->TXDATA = b; + } + else { + break; } - DPP::l_USART0->TXDATA = (b & 0xFFU); // put into the DR register - QF_INT_DISABLE(); } - QF_INT_ENABLE(); } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void QS::onReset(void) { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command (to be implemented in BSP) void QS::onCommand(uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3) { diff --git a/examples/performance/dpp_efm32-slstk3401a/qv/bsp.cpp b/examples/performance/dpp_efm32-slstk3401a/qv/bsp.cpp index d96ca3942..1c76b38dc 100644 --- a/examples/performance/dpp_efm32-slstk3401a/qv/bsp.cpp +++ b/examples/performance/dpp_efm32-slstk3401a/qv/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EFM32-SLSTK3401A board, cooperative QV kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -404,27 +404,27 @@ QSTimeCtr QS::onGetTime(void) { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { - uint16_t b; - - QF_INT_DISABLE(); - while ((b = getByte()) != QS_EOD) { // while not End-Of-Data... - QF_INT_ENABLE(); - // while TXE not empty - while ((DPP::l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { + for (;;) { + std::uint16_t b = getByte(); + if (b != QS_EOD) { + while ((DPP::l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { + } + DPP::l_USART0->TXDATA = b; + } + else { + break; } - DPP::l_USART0->TXDATA = (b & 0xFFU); // put into the DR register - QF_INT_DISABLE(); } - QF_INT_ENABLE(); } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void QS::onReset(void) { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command (to be implemented in BSP) void QS::onCommand(uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3) { diff --git a/examples/performance/dpp_efm32-slstk3401a/qxk/bsp.cpp b/examples/performance/dpp_efm32-slstk3401a/qxk/bsp.cpp index 2f013152c..d1b62f0ca 100644 --- a/examples/performance/dpp_efm32-slstk3401a/qxk/bsp.cpp +++ b/examples/performance/dpp_efm32-slstk3401a/qxk/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EFM32-SLSTK3401A board, preemptive QXK kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -434,27 +434,27 @@ QSTimeCtr QS::onGetTime(void) { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { - uint16_t b; - - QF_INT_DISABLE(); - while ((b = getByte()) != QS_EOD) { // while not End-Of-Data... - QF_INT_ENABLE(); - // while TXE not empty - while ((DPP::l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { + for (;;) { + std::uint16_t b = getByte(); + if (b != QS_EOD) { + while ((DPP::l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { + } + DPP::l_USART0->TXDATA = b; + } + else { + break; } - DPP::l_USART0->TXDATA = (b & 0xFFU); // put into the DR register - QF_INT_DISABLE(); } - QF_INT_ENABLE(); } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void QS::onReset(void) { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command (to be implemented in BSP) void QS::onCommand(uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3) { diff --git a/examples/performance/dpp_efm32-slstk3401a/uc-os2/bsp.cpp b/examples/performance/dpp_efm32-slstk3401a/uc-os2/bsp.cpp index 5ca48faa9..124b7367a 100644 --- a/examples/performance/dpp_efm32-slstk3401a/uc-os2/bsp.cpp +++ b/examples/performance/dpp_efm32-slstk3401a/uc-os2/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EFM32-SLSTK3401A board, uC/OS-II kernel -// Last updated for version 7.3.0 -// Last updated on 2023-09-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -445,31 +445,27 @@ QSTimeCtr QS::onGetTime(void) { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { -#if OS_CRITICAL_METHOD == 3u // Allocate storage for CPU status register - OS_CPU_SR cpu_sr; -#endif - uint16_t b; - - OS_ENTER_CRITICAL(); - while ((b = getByte()) != QS_EOD) { // while not End-Of-Data... - OS_EXIT_CRITICAL(); - // while TXE not empty - while ((DPP::l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { + for (;;) { + std::uint16_t b = getByte(); + if (b != QS_EOD) { + while ((DPP::l_USART0->STATUS & USART_STATUS_TXBL) == 0U) { + } + DPP::l_USART0->TXDATA = (b & 0xFFU); // put into the DR register + } + else { + break; } - DPP::l_USART0->TXDATA = (b & 0xFFU); // put into the DR register - OS_ENTER_CRITICAL(); } - OS_EXIT_CRITICAL(); -; } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void QS::onReset(void) { NVIC_SystemReset(); } //............................................................................ -//! callback function to execute a user command (to be implemented in BSP) void QS::onCommand(uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3) { diff --git a/examples/pic32/dpp_microstick2-pic32/qk/xc32/bsp.cpp b/examples/pic32/dpp_microstick2-pic32/qk/xc32/bsp.cpp index 78094cfb8..990e26d3e 100644 --- a/examples/pic32/dpp_microstick2-pic32/qk/xc32/bsp.cpp +++ b/examples/pic32/dpp_microstick2-pic32/qk/xc32/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // BSP for DPP example, Microstick II board, preemptive QK kernel, XC32 -// Last updated for version 7.3.0 -// Last updated on 2023-08-31 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -339,21 +339,27 @@ bool QS::onStartup(void const *arg) { void QS::onCleanup() { } //............................................................................ -void QS::onFlush() { - std::uint16_t b; - while ((b = getByte()) != QS_EOD) { // next QS trace byte available? - while (U2STAbits.UTXBF) { // TX Buffer full? +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). +void QS::onFlush(void) { + for (;;) { + std::uint16_t b = getByte(); + if (b != QS_EOD) { + while (U2STAbits.UTXBF) { // TX Buffer full? + } + U2TXREG = b; // stick the byte to TXREG for transmission + } + else { + break; } - U2TXREG = b; // stick the byte to TXREG for transmission } } //............................................................................ -// NOTE: works properly with interrupts enabled or disabled QSTimeCtr QS::onGetTime() { return __builtin_mfc0(_CP0_COUNT, _CP0_COUNT_SELECT); } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void QS::onReset() { // perform a system unlock sequence ,starting critical sequence SYSKEY = 0x00000000; //write invalid key to force lock @@ -366,7 +372,6 @@ void QS::onReset() { // prevent any unwanted code execution until reset occurs } //............................................................................ -//! callback function to execute a user command (to be implemented in BSP) void QS::onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/pic32/dpp_microstick2-pic32/qv/xc32/bsp.cpp b/examples/pic32/dpp_microstick2-pic32/qv/xc32/bsp.cpp index 02782d10f..3f248c193 100644 --- a/examples/pic32/dpp_microstick2-pic32/qv/xc32/bsp.cpp +++ b/examples/pic32/dpp_microstick2-pic32/qv/xc32/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // BSP for DPP example, Microstick II board, preemptive QV kernel, XC32 -// Last updated for version 7.3.0 -// Last updated on 2023-08-31 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -329,21 +329,27 @@ bool QS::onStartup(void const *arg) { void QS::onCleanup() { } //............................................................................ -void QS::onFlush() { - std::uint16_t b; - while ((b = getByte()) != QS_EOD) { // next QS trace byte available? - while (U2STAbits.UTXBF) { // TX Buffer full? +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). +void QS::onFlush(void) { + for (;;) { + std::uint16_t b = getByte(); + if (b != QS_EOD) { + while (U2STAbits.UTXBF) { // TX Buffer full? + } + U2TXREG = b; // stick the byte to TXREG for transmission + } + else { + break; } - U2TXREG = b; // stick the byte to TXREG for transmission } } //............................................................................ -// NOTE: works properly with interrupts enabled or disabled QSTimeCtr QS::onGetTime() { return __builtin_mfc0(_CP0_COUNT, _CP0_COUNT_SELECT); } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void QS::onReset() { // perform a system unlock sequence ,starting critical sequence SYSKEY = 0x00000000; //write invalid key to force lock @@ -356,7 +362,6 @@ void QS::onReset() { // prevent any unwanted code execution until reset occurs } //............................................................................ -//! callback function to execute a user command (to be implemented in BSP) void QS::onCommand(std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) { diff --git a/examples/qutest/qhsmtst/test/test_qhsm-funct.py b/examples/qutest/qhsmtst/test/test_qhsm-funct.py index 63338fd90..263fd41ff 100644 --- a/examples/qutest/qhsmtst/test/test_qhsm-funct.py +++ b/examples/qutest/qhsmtst/test/test_qhsm-funct.py @@ -19,14 +19,14 @@ def on_reset(): expect("@timestamp Trg-Done QS_RX_EVENT") test("QHsmTst isIn", NORESET) -command(1, 1) -expect("@timestamp CMD 0 1"); +command(1, 1) # is in state s1 +expect("@timestamp CMD 0 1"); # NOT in s1 expect("@timestamp Trg-Done QS_RX_COMMAND") -command(1, 21) -expect("@timestamp CMD 1 21"); +command(1, 21) # is in state s21 +expect("@timestamp CMD 1 21"); # YES, in s21 expect("@timestamp Trg-Done QS_RX_COMMAND") -command(1, 211) -expect("@timestamp CMD 1 211"); +command(1, 211) # is in state s211 +expect("@timestamp CMD 1 211"); # YES, in s211 expect("@timestamp Trg-Done QS_RX_COMMAND") test("QHsmTst dispatch", NORESET) diff --git a/examples/qutest/qmsmtst/src/qmsmtst.cpp b/examples/qutest/qmsmtst/src/qmsmtst.cpp index 3518aad88..6af3edc0f 100644 --- a/examples/qutest/qmsmtst/src/qmsmtst.cpp +++ b/examples/qutest/qmsmtst/src/qmsmtst.cpp @@ -45,7 +45,7 @@ class QMsmTst : public QP::QMsm { bool m_foo; public: - friend bool QMsmTst_isInState(std::uint32_t const state_num); + friend bool QMsmTst_isIn(std::uint32_t const state_num); public: QMsmTst() @@ -741,27 +741,27 @@ QM_STATE_DEF(QMsmTst, s211) { } //$enddef${SMs::QMsmTst} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -bool QMsmTst_isInState(std::uint32_t const state_num) { +bool QMsmTst_isIn(std::uint32_t const state_num) { QP::QMsm * const me = &l_msmtst; bool stat = false; switch (state_num) { case 0: - stat = me->isInState(&QMsmTst::s_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s)); break; case 1: - stat = me->isInState(&QMsmTst::s1_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s1)); break; case 11: - stat = me->isInState(&QMsmTst::s11_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s11)); break; case 2: - stat = me->isInState(&QMsmTst::s21_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s2)); break; case 21: - stat = me->isInState(&QMsmTst::s21_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s21)); break; case 211: - stat = me->isInState(&QMsmTst::s211_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s211)); break; default: Q_ERROR(); diff --git a/examples/qutest/qmsmtst/src/qmsmtst.hpp b/examples/qutest/qmsmtst/src/qmsmtst.hpp index 5fd167da4..2dccc6062 100644 --- a/examples/qutest/qmsmtst/src/qmsmtst.hpp +++ b/examples/qutest/qmsmtst/src/qmsmtst.hpp @@ -50,7 +50,7 @@ enum QMsmTstSignals { extern QP::QAsm * const the_sm; // opaque pointer to the test SM -bool QMsmTst_isInState(std::uint32_t const state_num); +bool QMsmTst_isIn(std::uint32_t const state_num); // BSP functions to display a message and exit void BSP_display(char const *msg); diff --git a/examples/qutest/qmsmtst/src/qmsmtst.qm b/examples/qutest/qmsmtst/src/qmsmtst.qm index 4649b716a..33bcebe00 100644 --- a/examples/qutest/qmsmtst/src/qmsmtst.qm +++ b/examples/qutest/qmsmtst/src/qmsmtst.qm @@ -10,8 +10,8 @@ Test State Machine - - + + : QMsm(&initial) @@ -324,7 +324,7 @@ enum QMsmTstSignals { extern QP::QAsm * const the_sm; // opaque pointer to the test SM -bool QMsmTst_isInState(std::uint32_t const state_num); +bool QMsmTst_isIn(std::uint32_t const state_num); // BSP functions to display a message and exit void BSP_display(char const *msg); @@ -354,27 +354,27 @@ QP::QAsm * const the_sm = &l_msmtst; // the opaque pointer $define ${SMs::QMsmTst} -bool QMsmTst_isInState(std::uint32_t const state_num) { +bool QMsmTst_isIn(std::uint32_t const state_num) { QP::QMsm * const me = &l_msmtst; bool stat = false; switch (state_num) { case 0: - stat = me->isInState(&QMsmTst::s_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s)); break; case 1: - stat = me->isInState(&QMsmTst::s1_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s1)); break; case 11: - stat = me->isInState(&QMsmTst::s11_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s11)); break; case 2: - stat = me->isInState(&QMsmTst::s21_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s2)); break; case 21: - stat = me->isInState(&QMsmTst::s21_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s21)); break; case 211: - stat = me->isInState(&QMsmTst::s211_s); + stat = me->isIn(Q_STATE_CAST(&QMsmTst::s211)); break; default: Q_ERROR(); diff --git a/examples/qutest/qmsmtst/test/test_qmsm-funct.py b/examples/qutest/qmsmtst/test/test_qmsm-funct.py index f5311ae03..f755c02fe 100644 --- a/examples/qutest/qmsmtst/test/test_qmsm-funct.py +++ b/examples/qutest/qmsmtst/test/test_qmsm-funct.py @@ -18,15 +18,15 @@ def on_reset(): expect("@timestamp BSP_DISPLAY s211-ENTRY;") expect("@timestamp Trg-Done QS_RX_EVENT") -test("QMsmTst isInState", NORESET) -command(1, 1) -expect("@timestamp CMD 0 1"); +test("QMsmTst isIn", NORESET) +command(1, 1) # is in state s1 +expect("@timestamp CMD 0 1"); # NOT in s1 expect("@timestamp Trg-Done QS_RX_COMMAND") -command(1, 21) -expect("@timestamp CMD 1 21"); +command(1, 21) # is in state s21 +expect("@timestamp CMD 1 21"); # YES, in s21 expect("@timestamp Trg-Done QS_RX_COMMAND") -command(1, 211) -expect("@timestamp CMD 1 211"); +command(1, 211) # is in state s211 +expect("@timestamp CMD 1 211"); # YES, in s211 expect("@timestamp Trg-Done QS_RX_COMMAND") test("QMsmTst dispatch", NORESET) diff --git a/examples/qutest/qmsmtst/test/test_qmsm.cpp b/examples/qutest/qmsmtst/test/test_qmsm.cpp index bdb51c980..ac34e69d6 100644 --- a/examples/qutest/qmsmtst/test/test_qmsm.cpp +++ b/examples/qutest/qmsmtst/test/test_qmsm.cpp @@ -81,7 +81,7 @@ void QS::onCommand(std::uint8_t cmdId, std::uint32_t param1, break; } case 1U: { - bool ret = APP::QMsmTst_isInState(param1); + bool ret = APP::QMsmTst_isIn(param1); QS_BEGIN_ID(APP::CMD, 0U) // app-specific record QS_U8(0U, ret ? 1 : 0); QS_U8(0U, (uint8_t)param1); diff --git a/examples/threadx/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp b/examples/threadx/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp index c185c0897..be07a2756 100644 --- a/examples/threadx/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp +++ b/examples/threadx/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // DPP example, EK-TM4C123GXL board, ThreadX RTOS -// Last updated for version 7.3.0 -// Last updated on 2023-08-30 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -400,13 +400,12 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return TIMER5->TAV; } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_CRIT_STAT - QF_CRIT_ENTRY(); std::uint16_t b = getByte(); - QF_CRIT_EXIT(); - if (b != QS_EOD) { // NOT end-of-data // busy-wait as long as TXE not set while ((UART0->FR & UART_FR_TXFE) == 0U) { @@ -420,7 +419,6 @@ void onFlush() { } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } diff --git a/examples/threadx/arm-cm/dpp_stm32f429-discovery/bsp.cpp b/examples/threadx/arm-cm/dpp_stm32f429-discovery/bsp.cpp index 632670a89..18fc44ed9 100644 --- a/examples/threadx/arm-cm/dpp_stm32f429-discovery/bsp.cpp +++ b/examples/threadx/arm-cm/dpp_stm32f429-discovery/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // DPP example, STM32F429 Discovery, ThreadX RTOS -// Last updated for version 7.3.0 -// Last updated on 2023-08-30 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -434,13 +434,12 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED } } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_CRIT_STAT - QF_CRIT_ENTRY(); std::uint16_t b = getByte(); - QF_CRIT_EXIT(); - if (b != QS_EOD) { // NOT end-of-data // busy-wait as long as TXE not set while ((USART2->SR & USART_FLAG_TXE) == 0U) { @@ -454,7 +453,6 @@ void onFlush() { } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } diff --git a/examples/uc-os2/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp b/examples/uc-os2/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp index 0d24f34f1..496926e37 100644 --- a/examples/uc-os2/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp +++ b/examples/uc-os2/arm-cm/dpp_ek-tm4c123gxl/bsp.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: DPP example, EK-TM4C123GXL board, uC-OS2 RTOS kernel -// Last updated for @ref qpcpp_7_3_1 -// Last updated on 2023-12-04 +// Last updated for @ref qpcpp_7_3_2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -453,15 +453,12 @@ QSTimeCtr onGetTime() { // NOTE: invoked with interrupts DISABLED return TIMER5->TAV; } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void onFlush() { for (;;) { - QF_CRIT_STAT - - // try to get next byte to transmit - QF_CRIT_ENTRY(); std::uint16_t b = getByte(); - QF_CRIT_EXIT(); - if (b != QS_EOD) { // NOT end-of-data // busy-wait as long as TX FIFO has data to transmit while ((UART0->FR & UART_FR_TXFE) == 0U) { @@ -474,7 +471,6 @@ void onFlush() { } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void onReset() { NVIC_SystemReset(); } diff --git a/examples/zephyr/dpp/src/bsp.cpp b/examples/zephyr/dpp/src/bsp.cpp index 901138be2..78af3dbbc 100644 --- a/examples/zephyr/dpp/src/bsp.cpp +++ b/examples/zephyr/dpp/src/bsp.cpp @@ -294,6 +294,9 @@ QSTimeCtr QS::onGetTime(void) { // NOTE: invoked with interrupts DISABLED return k_cycle_get_32(); } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { std::uint16_t len = 0xFFFFU; // to get as many bytes as available std::uint8_t const *buf; @@ -319,7 +322,6 @@ void QS::doOutput(void) { } } //............................................................................ -//! callback function to reset the target (to be implemented in the BSP) void QS::onReset(void) { sys_reboot(SYS_REBOOT_COLD); } diff --git a/include/qp.hpp b/include/qp.hpp index f6399ba65..321853ebe 100644 --- a/include/qp.hpp +++ b/include/qp.hpp @@ -44,11 +44,11 @@ #define QP_HPP_ //============================================================================ -#define QP_VERSION 731U -#define QP_VERSION_STR "7.3.1" +#define QP_VERSION 732U +#define QP_VERSION_STR "7.3.2" -//! Encrypted current QP release (7.3.1) and date (2023-12-05) -#define QP_RELEASE 0x7630E7D4U +//! Encrypted current QP release (7.3.2) and date (2023-12-14) +#define QP_RELEASE 0x762F8843U //============================================================================ //! @cond INTERNAL @@ -292,6 +292,10 @@ class QAsm { virtual void dispatch( QEvt const * const e, std::uint_fast8_t const qs_id) = 0; + virtual bool isIn(QStateHandler const state) noexcept { + static_cast(state); + return false; + } #ifdef Q_SPY virtual QStateHandler getStateHandler() noexcept { @@ -404,7 +408,7 @@ class QHsm : public QP::QAsm { void dispatch( QEvt const * const e, std::uint_fast8_t const qs_id) override; - bool isIn(QStateHandler const state) noexcept; + bool isIn(QStateHandler const state) noexcept override; QStateHandler state() const noexcept { return m_state.fun; } @@ -443,6 +447,9 @@ class QMsm : public QP::QAsm { return m_state.obj->stateHandler; } #endif // def Q_SPY + bool isIn(QStateHandler const state) noexcept override; + + //! @deprecated instead use: QMsm::isIn() bool isInState(QMState const * const stateObj) const noexcept; QMState const * stateObj() const noexcept { return m_state.obj; @@ -794,6 +801,9 @@ class QActive : public QP::QAsm { { reinterpret_cast(this)->QHsm::dispatch(e, qs_id); } + bool isIn(QStateHandler const state) noexcept override { + return reinterpret_cast(this)->QHsm::isIn(state); + } void setAttr( std::uint32_t attr1, void const * attr2 = nullptr); @@ -922,6 +932,9 @@ class QMActive : public QP::QActive { { reinterpret_cast(this)->QMsm::dispatch(e, qs_id); } + bool isIn(QStateHandler const state) noexcept override { + return reinterpret_cast(this)->QMsm::isIn(state); + } #ifdef Q_SPY QStateHandler getStateHandler() noexcept override { diff --git a/ports/posix-qv/qs_port.cpp b/ports/posix-qv/qs_port.cpp index c00f24538..0f06e8df6 100644 --- a/ports/posix-qv/qs_port.cpp +++ b/ports/posix-qv/qs_port.cpp @@ -22,8 +22,8 @@ // // //============================================================================ -//! @date Last updated on: 2023-08-20 -//! @version Last updated for: @ref qpcpp_7_3_0 +//! @date Last updated on: 2023-12-13 +//! @version Last updated for: @ref qpcpp_7_3_2 //! //! @file //! @brief QS/C++ port to POSIX @@ -191,6 +191,9 @@ void QS::onReset() { exit(0); } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush() { if (l_sock == INVALID_SOCKET) { // socket NOT initialized? FPRINTF_S(stderr, " ERROR %s\n", @@ -199,12 +202,9 @@ void QS::onFlush() { return; } - QS_CRIT_STAT - QS_CRIT_ENTRY(); std::uint16_t nBytes = QS_TX_CHUNK; std::uint8_t const *data; while ((data = getBlock(&nBytes)) != nullptr) { - QS_CRIT_EXIT(); for (;;) { // for-ever until break or return int nSent = send(l_sock, (char const *)data, (int)nBytes, 0); if (nSent == SOCKET_ERROR) { // sending failed? @@ -232,9 +232,7 @@ void QS::onFlush() { } // set nBytes for the next call to QS::getBlock() nBytes = QS_TX_CHUNK; - QS_CRIT_ENTRY(); } - QS_CRIT_EXIT(); } //............................................................................ QSTimeCtr QS::onGetTime() { diff --git a/ports/posix/qs_port.cpp b/ports/posix/qs_port.cpp index c00f24538..0f06e8df6 100644 --- a/ports/posix/qs_port.cpp +++ b/ports/posix/qs_port.cpp @@ -22,8 +22,8 @@ // // //============================================================================ -//! @date Last updated on: 2023-08-20 -//! @version Last updated for: @ref qpcpp_7_3_0 +//! @date Last updated on: 2023-12-13 +//! @version Last updated for: @ref qpcpp_7_3_2 //! //! @file //! @brief QS/C++ port to POSIX @@ -191,6 +191,9 @@ void QS::onReset() { exit(0); } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush() { if (l_sock == INVALID_SOCKET) { // socket NOT initialized? FPRINTF_S(stderr, " ERROR %s\n", @@ -199,12 +202,9 @@ void QS::onFlush() { return; } - QS_CRIT_STAT - QS_CRIT_ENTRY(); std::uint16_t nBytes = QS_TX_CHUNK; std::uint8_t const *data; while ((data = getBlock(&nBytes)) != nullptr) { - QS_CRIT_EXIT(); for (;;) { // for-ever until break or return int nSent = send(l_sock, (char const *)data, (int)nBytes, 0); if (nSent == SOCKET_ERROR) { // sending failed? @@ -232,9 +232,7 @@ void QS::onFlush() { } // set nBytes for the next call to QS::getBlock() nBytes = QS_TX_CHUNK; - QS_CRIT_ENTRY(); } - QS_CRIT_EXIT(); } //............................................................................ QSTimeCtr QS::onGetTime() { diff --git a/ports/win32-qutest/qutest_port.cpp b/ports/win32-qutest/qutest_port.cpp index 2a950503e..48a5fca6d 100644 --- a/ports/win32-qutest/qutest_port.cpp +++ b/ports/win32-qutest/qutest_port.cpp @@ -22,8 +22,8 @@ // // //============================================================================ -//! @date Last updated on: 2023-08-21 -//! @version Last updated for: @ref qpcpp_7_3_0 +//! @date Last updated on: 2023-12-13 +//! @version Last updated for: @ref qpcpp_7_3_2 //! //! @file //! @brief QUTEST port for Windows, GNU or Visual C++ @@ -199,6 +199,9 @@ void QS::onReset() { exit(0); } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush() { if (l_sock == INVALID_SOCKET) { // socket NOT initialized? FPRINTF_S(stderr, " ERROR %s\n", @@ -207,12 +210,9 @@ void QS::onFlush() { return; } - QS_CRIT_STAT - QS_CRIT_ENTRY(); std::uint16_t nBytes = QS_TX_CHUNK; std::uint8_t const *data; while ((data = getBlock(&nBytes)) != nullptr) { - QS_CRIT_EXIT(); for (;;) { // for-ever until break or return int nSent = send(l_sock, (char const *)data, (int)nBytes, 0); if (nSent == SOCKET_ERROR) { // sending failed? @@ -242,9 +242,7 @@ void QS::onFlush() { } // set nBytes for the next call to QS::getBlock() nBytes = QS_TX_CHUNK; - QS_CRIT_ENTRY(); } - QS_CRIT_EXIT(); } //............................................................................ void QS::onTestLoop() { diff --git a/ports/win32-qv/qs_port.cpp b/ports/win32-qv/qs_port.cpp index aeb161db8..e72a6b4ce 100644 --- a/ports/win32-qv/qs_port.cpp +++ b/ports/win32-qv/qs_port.cpp @@ -22,8 +22,8 @@ // // //============================================================================ -//! @date Last updated on: 2023-08-18 -//! @version Last updated for: @ref qpcpp_7_3_0 +//! @date Last updated on: 2023-12-13 +//! @version Last updated for: @ref qpcpp_7_3_2 //! //! @file //! @brief QS/C++ port to Win32 API @@ -197,20 +197,19 @@ void QS::onReset(void) { exit(0); } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { - uint16_t nBytes; - uint8_t const *data; - QS_CRIT_STAT if (l_sock == INVALID_SOCKET) { // socket NOT initialized? FPRINTF_S(stderr, "%s\n", " ERROR invalid TCP socket"); return; } - nBytes = QS_TX_CHUNK; - QS_CRIT_ENTRY(); + std::uint16_t nBytes = QS_TX_CHUNK; + std::uint8_t const *data; while ((data = getBlock(&nBytes)) != (uint8_t *)0) { - QS_CRIT_EXIT(); for (;;) { // for-ever until break or return int nSent = send(l_sock, (char const *)data, (int)nBytes, 0); if (nSent == SOCKET_ERROR) { // sending failed? @@ -240,9 +239,7 @@ void QS::onFlush(void) { } // set nBytes for the next call to QS::getBlock() nBytes = QS_TX_CHUNK; - QS_CRIT_ENTRY(); } - QS_CRIT_EXIT(); } //............................................................................ QSTimeCtr QS::onGetTime(void) { @@ -253,16 +250,15 @@ QSTimeCtr QS::onGetTime(void) { //............................................................................ void QS::doOutput(void) { - uint16_t nBytes; - uint8_t const *data; - QS_CRIT_STAT if (l_sock == INVALID_SOCKET) { // socket NOT initialized? FPRINTF_S(stderr, "%s\n", " ERROR invalid TCP socket"); return; } - nBytes = QS_TX_CHUNK; + std::uint16_t nBytes = QS_TX_CHUNK; + std::uint8_t const *data; + QS_CRIT_STAT QS_CRIT_ENTRY(); if ((data = QS::getBlock(&nBytes)) != (uint8_t *)0) { QS_CRIT_EXIT(); diff --git a/ports/win32/qs_port.cpp b/ports/win32/qs_port.cpp index aeb161db8..e72a6b4ce 100644 --- a/ports/win32/qs_port.cpp +++ b/ports/win32/qs_port.cpp @@ -22,8 +22,8 @@ // // //============================================================================ -//! @date Last updated on: 2023-08-18 -//! @version Last updated for: @ref qpcpp_7_3_0 +//! @date Last updated on: 2023-12-13 +//! @version Last updated for: @ref qpcpp_7_3_2 //! //! @file //! @brief QS/C++ port to Win32 API @@ -197,20 +197,19 @@ void QS::onReset(void) { exit(0); } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { - uint16_t nBytes; - uint8_t const *data; - QS_CRIT_STAT if (l_sock == INVALID_SOCKET) { // socket NOT initialized? FPRINTF_S(stderr, "%s\n", " ERROR invalid TCP socket"); return; } - nBytes = QS_TX_CHUNK; - QS_CRIT_ENTRY(); + std::uint16_t nBytes = QS_TX_CHUNK; + std::uint8_t const *data; while ((data = getBlock(&nBytes)) != (uint8_t *)0) { - QS_CRIT_EXIT(); for (;;) { // for-ever until break or return int nSent = send(l_sock, (char const *)data, (int)nBytes, 0); if (nSent == SOCKET_ERROR) { // sending failed? @@ -240,9 +239,7 @@ void QS::onFlush(void) { } // set nBytes for the next call to QS::getBlock() nBytes = QS_TX_CHUNK; - QS_CRIT_ENTRY(); } - QS_CRIT_EXIT(); } //............................................................................ QSTimeCtr QS::onGetTime(void) { @@ -253,16 +250,15 @@ QSTimeCtr QS::onGetTime(void) { //............................................................................ void QS::doOutput(void) { - uint16_t nBytes; - uint8_t const *data; - QS_CRIT_STAT if (l_sock == INVALID_SOCKET) { // socket NOT initialized? FPRINTF_S(stderr, "%s\n", " ERROR invalid TCP socket"); return; } - nBytes = QS_TX_CHUNK; + std::uint16_t nBytes = QS_TX_CHUNK; + std::uint8_t const *data; + QS_CRIT_STAT QS_CRIT_ENTRY(); if ((data = QS::getBlock(&nBytes)) != (uint8_t *)0) { QS_CRIT_EXIT(); diff --git a/qpcpp.md5 b/qpcpp.md5 new file mode 100644 index 000000000..6de0e8f18 --- /dev/null +++ b/qpcpp.md5 @@ -0,0 +1,158 @@ +1687008692321ec5c5c6bd72a5cd0a2d *qpcpp.qm +8c56cbec8ad684a215f0c679cd181bb3 *include/qequeue.hpp +dc22fbc74f8e07f03951488cc8aa307a *include/qk.hpp +313e6b751fa629b8a775ee3e9a09d61d *include/qmpool.hpp +b4b84b07c4f1db4cf3b22cf87273d946 *include/qp.hpp +b945611a0840d852d6c4df4019eca24c *include/qp_pkg.hpp +5e1bf9b2f7ec458d5f8c4e65f2ead70d *include/qpcpp.hpp +f67e62d83825a68ba058de02b02e1521 *include/qs.hpp +7c1363d76903987e8911da55b293af7b *include/qs_dummy.hpp +36ab7ac838e149ce1eb12396a6096a2e *include/qs_pkg.hpp +2a36b08d4f3ec92da6ae6f7c18ad83ca *include/qsafe.h +b74365362ab9d3bbd739f57ecee0e59a *include/qstamp.hpp +9fb1046d76df39e4c4e375e86a9bd5e5 *include/qv.hpp +a1326d0c395559edd19efe51ff2a62c5 *include/qxk.hpp +a4ede47779e55dde35c6741b75be8d12 *src/qf/qep_hsm.cpp +20e1f9a35a81e2a59e19a46e06e7f0f7 *src/qf/qep_msm.cpp +7f75450831b0f982650ec7f523b317b7 *src/qf/qf_act.cpp +ed78c34c873544bd572e9c5aa3117f62 *src/qf/qf_actq.cpp +a76d5a1c9d9ece960a495692488bbbc1 *src/qf/qf_defer.cpp +7a0fb3ba798e0e760d60b0d397506099 *src/qf/qf_dyn.cpp +b43063c263a9b3736f317560147ca496 *src/qf/qf_mem.cpp +3d3af518f96226050b48a8a4238c46a0 *src/qf/qf_ps.cpp +3d1f2ab6f6efed18d6ce053d0aef9f85 *src/qf/qf_qact.cpp +f693b2b8601e6f9d815f456b4201eda1 *src/qf/qf_qeq.cpp +dbbf35eaffde7d9f2e9b612bdcbc61e5 *src/qf/qf_qmact.cpp +3e20c026f5496914561afcf9b33c1ff1 *src/qf/qf_time.cpp +f524f3374a3d2be94ec9cd471a4d7bcb *src/qk/qk.cpp +6011731d6a7305593e8d6ee5f98dc08e *src/qs/qs.cpp +dc13320957a6ef9d3d206cb1802d9d21 *src/qs/qs_64bit.cpp +8e4a588a04cc791fe9176c93a54c3dbd *src/qs/qs_fp.cpp +829a7bb323276b470194c26ee5c85463 *src/qs/qs_rx.cpp +55715d269c8201e27ca7aea2f742acd6 *src/qs/qstamp.cpp +9511a417eac945533d7af4536fb50754 *src/qs/qutest.cpp +2c246bb366fdb00d8c6a90130017e5bd *src/qv/qv.cpp +44196c35058d51a3a7672fb92cd01341 *src/qxk/qxk.cpp +6460b5c254e14451441cfbf233f1223d *src/qxk/qxk_mutex.cpp +029486f9e8886c170e291d5db590578f *src/qxk/qxk_sema.cpp +4d1c68956ce8eb3f8af5dcb4ca9b5458 *src/qxk/qxk_xthr.cpp +5e2bdf8604746e32da50fd498c45a20e *ports/arm-cm/qk/armclang/qk_port.cpp +aba379ac6a39b1f21057bed8156f0516 *ports/arm-cm/qk/armclang/qp_port.hpp +91a3b66c3f12a98bef48b00640ed5e6d *ports/arm-cm/qk/armclang/qs_port.hpp +55c02994a2d901c45e404bdf04753ccb *ports/arm-cm/qk/config/qp_config.hpp +4a7084a64a1c812dc7dc168239218d29 *ports/arm-cm/qk/gnu/qk_port.cpp +c6227ba01b71184c9e03ee6c8137ffc2 *ports/arm-cm/qk/gnu/qp_port.hpp +91a3b66c3f12a98bef48b00640ed5e6d *ports/arm-cm/qk/gnu/qs_port.hpp +989722a3dab06f8fb513428339c0430a *ports/arm-cm/qk/iar/qk_port.cpp +98e1649f0c8fb4efc200767a32514ea4 *ports/arm-cm/qk/iar/qp_port.hpp +91a3b66c3f12a98bef48b00640ed5e6d *ports/arm-cm/qk/iar/qs_port.hpp +1b7ab4c3d54bd187f07b7f24527f95d8 *ports/arm-cm/qv/armclang/qp_port.hpp +91a3b66c3f12a98bef48b00640ed5e6d *ports/arm-cm/qv/armclang/qs_port.hpp +b5279638488fde3eeade7b405cec309f *ports/arm-cm/qv/armclang/qv_port.cpp +7131831919142978b23d1a7a6d22d5c5 *ports/arm-cm/qv/config/qp_config.hpp +03aa01a02561593169bfb4b563c7fc29 *ports/arm-cm/qv/gnu/qp_port.hpp +91a3b66c3f12a98bef48b00640ed5e6d *ports/arm-cm/qv/gnu/qs_port.hpp +66c2d27aa8c654339f6fd8e2857b4d34 *ports/arm-cm/qv/gnu/qv_port.cpp +342f4a28c22e1d092b135636456b6400 *ports/arm-cm/qv/iar/qp_port.hpp +91a3b66c3f12a98bef48b00640ed5e6d *ports/arm-cm/qv/iar/qs_port.hpp +bd3a49d05d2349326e223372605094eb *ports/arm-cm/qv/iar/qv_port.cpp +fbab3cb88a019df3a12ee56a4a6f90b2 *ports/arm-cm/qxk/armclang/qp_port.hpp +91a3b66c3f12a98bef48b00640ed5e6d *ports/arm-cm/qxk/armclang/qs_port.hpp +a5bc3e6b6cfbd5e9e855e0eee7917671 *ports/arm-cm/qxk/armclang/qxk_port.cpp +975f7902ace20b4daea7c6071c183fd2 *ports/arm-cm/qxk/config/qp_config.hpp +246d7b72e2f0c1e3ba6e699740dbe390 *ports/arm-cm/qxk/gnu/qp_port.hpp +91a3b66c3f12a98bef48b00640ed5e6d *ports/arm-cm/qxk/gnu/qs_port.hpp +3632ed7919d6378f566431945b30f2a8 *ports/arm-cm/qxk/gnu/qxk_port.cpp +55b897c657e225d775cf6121d6278585 *ports/arm-cm/qxk/iar/qp_port.hpp +91a3b66c3f12a98bef48b00640ed5e6d *ports/arm-cm/qxk/iar/qs_port.hpp +c64081de4caddf0260c4831b7732cf2f *ports/arm-cm/qxk/iar/qxk_port.cpp +97b36f1808bc430693725a4a0c4dffdc *ports/arm-cm/qutest/qp_port.hpp +4c0ab6f6ad804f0bd70f146d53a1d197 *ports/arm-cm/qutest/qs_port.hpp +e31e3e43f1e5c49d94a1c34331ba0e3a *ports/arm-cr/qk/config/qp_config.hpp +0d2162273e16e4d6ad3e71b19ec7ca45 *ports/arm-cr/qk/gnu/qp_port.hpp +4c0ab6f6ad804f0bd70f146d53a1d197 *ports/arm-cr/qk/gnu/qs_port.hpp +b752ce288855bf410176fa39a6dffb27 *ports/arm-cr/qk/iar/qp_port.hpp +4c0ab6f6ad804f0bd70f146d53a1d197 *ports/arm-cr/qk/iar/qs_port.hpp +8dc7c7e3e4c9d65299030b2769381f1a *ports/arm-cr/qk/ti/qp_port.hpp +4c0ab6f6ad804f0bd70f146d53a1d197 *ports/arm-cr/qk/ti/qs_port.hpp +a2b9a032a510488006b8ad612e061fc6 *ports/arm-cr/qv/gnu/qp_port.hpp +4c0ab6f6ad804f0bd70f146d53a1d197 *ports/arm-cr/qv/gnu/qs_port.hpp +526e806ca856fef6f16e44a58ab3d89d *ports/arm-cr/qv/iar/qp_port.hpp +4c0ab6f6ad804f0bd70f146d53a1d197 *ports/arm-cr/qv/iar/qs_port.hpp +0b426a92acaee631bad6c87e6623612a *ports/arm-cr/qv/ti/qp_port.hpp +4c0ab6f6ad804f0bd70f146d53a1d197 *ports/arm-cr/qv/ti/qs_port.hpp +3dc3f0903feca56ec1075f412a33ce93 *ports/msp430/qk/qp_port.hpp +4298e1795a43964162145ce02971f27a *ports/msp430/qk/qs_port.hpp +4bbd4f9996670ccabb7da4a47bad6c20 *ports/msp430/qv/qp_port.hpp +4298e1795a43964162145ce02971f27a *ports/msp430/qv/qs_port.hpp +3317af7ac80bd3e29082066c1accf3d6 *ports/msp430/qutest/qp_port.hpp +4298e1795a43964162145ce02971f27a *ports/msp430/qutest/qs_port.hpp +d809c9959305c9535ebd422edbee6ff6 *ports/pic32/qk/xc32/qk_port.cpp +77dc85dd965856b92713b053a9e5456c *ports/pic32/qk/xc32/qp_port.hpp +593f647601a840935442920b371cbb8f *ports/pic32/qk/xc32/qs_port.hpp +c40714b55d55e955163ba501bc76486b *ports/pic32/qv/xc32/qp_port.hpp +593f647601a840935442920b371cbb8f *ports/pic32/qv/xc32/qs_port.hpp +0e5546fb2c1b78c7a4515fda95b4a367 *ports/pic32/qutest/xc32/qp_port.hpp +8769dc506ab52067b0a374e5765525d3 *ports/pic32/qutest/xc32/qs_port.hpp +c10ade14226ad191d6abc2dbb78bf6cc *ports/config/qp_config.hpp +c0888baf6c4ee7328d2a0ee70a88920e *ports/embos/qf_port.cpp +519b319359d1d7bdc19dd9c3b8055690 *ports/embos/qp_port.hpp +5f098b1f50529ede0aff7e065d1234ef *ports/embos/qs_port.hpp +1da540efffaf0b7f4c82f0266739cc61 *ports/freertos/qf_port.cpp +4a58bfcc58abfaaa3f3097d474fb904b *ports/freertos/qp_port.hpp +f1d2ad95d14899edf65a236f1df4cfce *ports/freertos/qs_port.hpp +4cf69da77c8f0c208011d457c9554e91 *ports/threadx/qf_port.cpp +f4d112647f4a4bd8a3631e7e9393d17e *ports/threadx/qp_port.hpp +5f098b1f50529ede0aff7e065d1234ef *ports/threadx/qs_port.hpp +23b496a982c574af2a47d01eb79e47f2 *ports/threadx/README.md +91b86f32bfb4a6e45e5c752c8cb9a290 *ports/uc-os2/qf_port.cpp +3e134ca884ec2baa7f62394704601d02 *ports/uc-os2/qp_port.hpp +5f098b1f50529ede0aff7e065d1234ef *ports/uc-os2/qs_port.hpp +ec8563c61bcb8cb4682b7bc4ffc67d0a *ports/qep-only/qp_port.hpp +7955fc33c291eb6b8ebabaae0d6bd0da *ports/qep-only/safe_std.h +32c55f2073063597225d7d71ac8508b0 *ports/posix/qf_port.cpp +8dd4d0242efa3940cb617ece419f17c6 *ports/posix/qp_port.hpp +ae25ce9cf24260ec8affa08170f9d15a *ports/posix/qs_port.cpp +dab4a85af98e1c67aa8de87b22e048c1 *ports/posix/qs_port.hpp +f45c6f63edac95fd0b5d9cbeaa1f3926 *ports/posix/README.md +7955fc33c291eb6b8ebabaae0d6bd0da *ports/posix/safe_std.h +8336707fde8e22858886e7d0bdbe8567 *ports/posix-qv/qf_port.cpp +cd32d689475bff84bff92a42c548ae25 *ports/posix-qv/qp_port.hpp +ae25ce9cf24260ec8affa08170f9d15a *ports/posix-qv/qs_port.cpp +dab4a85af98e1c67aa8de87b22e048c1 *ports/posix-qv/qs_port.hpp +72ee0355e2e9b6bd2a1e4c32480f361a *ports/posix-qv/README.md +7955fc33c291eb6b8ebabaae0d6bd0da *ports/posix-qv/safe_std.h +0b48b37fbc4f43cf11d4dcfe49cab7f3 *ports/posix-qutest/qp_port.hpp +e898e8f446a8fcfd84b5092144b21ef3 *ports/posix-qutest/qs_port.hpp +7d96b643ff89c259f5ae8e321e7c3534 *ports/posix-qutest/qutest_port.cpp +0ac7e3d28e684d07baacdcd0d3e65c4a *ports/posix-qutest/README.md +7955fc33c291eb6b8ebabaae0d6bd0da *ports/posix-qutest/safe_std.h +ccec9e69c078e6b6889b7cba2e6195dd *ports/win32/Makefile +97440771ec5d1db0452a85963b52e7da *ports/win32/qf_port.cpp +5577b3b91b9bc2c9123b5f95f4efd73b *ports/win32/qp_port.hpp +b53aafe66b369a2e54344c792e481c1c *ports/win32/qs_port.cpp +7fb4d8aa04a203af95a365f6a56f89b3 *ports/win32/qs_port.hpp +a1c6143aa627599750360c58f4740129 *ports/win32/qwin_gui.c +64172552524a5e6449168adedfd858b0 *ports/win32/qwin_gui.h +84d25d92b6521b22736719d3ed33c289 *ports/win32/README.md +7955fc33c291eb6b8ebabaae0d6bd0da *ports/win32/safe_std.h +e79933d81e497e91c959d436fbe55400 *ports/win32-qv/qf_port.cpp +3ff89d0f44b9860a4fad738179f03e96 *ports/win32-qv/qp_port.hpp +b53aafe66b369a2e54344c792e481c1c *ports/win32-qv/qs_port.cpp +7fb4d8aa04a203af95a365f6a56f89b3 *ports/win32-qv/qs_port.hpp +a1c6143aa627599750360c58f4740129 *ports/win32-qv/qwin_gui.c +64172552524a5e6449168adedfd858b0 *ports/win32-qv/qwin_gui.h +4b910f53af0a91e12da39391840e396d *ports/win32-qv/README.md +7955fc33c291eb6b8ebabaae0d6bd0da *ports/win32-qv/safe_std.h +eb159689e6e4b4bd4a800a6791ff6d76 *ports/win32-qutest/qp_port.hpp +7fb4d8aa04a203af95a365f6a56f89b3 *ports/win32-qutest/qs_port.hpp +f0486e29b189059a11b1172ef72bb064 *ports/win32-qutest/qutest_port.cpp +7955fc33c291eb6b8ebabaae0d6bd0da *ports/win32-qutest/safe_std.h +1595522f609b1198a88aff4523334557 *zephyr/CMakeLists.txt +34e76b00e1368216110b5d52d4f11a25 *zephyr/Kconfig +2140500a5b230057a2a6ed4b613f6353 *zephyr/module.yml +9682de225e54a01a44f90ece297ad16c *zephyr/qf_port.cpp +feafc89deb1a1d8f02fe63515950e0c3 *zephyr/qp_port.hpp +0c3ef4ec33d22d9d35913de60f500852 *zephyr/qs_port.hpp +dec11c2771f6365fe7e577756ed2d78e *zephyr/qutest_port.cpp +e256cfb6fd04838f386c2361215e76f5 *zephyr/README.md diff --git a/qpcpp.qm b/qpcpp.qm index 895e81434..551eee7c2 100644 --- a/qpcpp.qm +++ b/qpcpp.qm @@ -251,6 +251,14 @@ Contact information: + + + noexcept + + + static_cast<void>(state); +return false; + noexcept @@ -715,7 +723,7 @@ m_temp.uint = ~m_state.uint; - noexcept + noexcept override QF_CRIT_STAT @@ -1224,9 +1232,36 @@ m_temp.uint = ~m_state.uint; noexcept override return m_state.obj->stateHandler; + + + noexcept override + + + bool inState = false; // assume that this MSM is not in 'state' + +QMState const *s = m_state.obj; +std::int_fast8_t limit = 6; // loop hard limit +for (; (s != nullptr) && (limit > 0); --limit) { + if (s->stateHandler == state) { // match found? + inState = true; + break; + } + else { + s = s->superstate; // advance to the superstate + } +} + +QF_CRIT_STAT +QF_CRIT_ENTRY(); +Q_ENSURE_INCRIT(690, limit > 0); +QF_CRIT_EXIT(); + +return inState; + const noexcept + //! @deprecated instead use: QMsm::isIn() bool inState = false; // assume that this MSM is not in 'state' @@ -1245,7 +1280,7 @@ for (; (s != nullptr) && (limit > 0); --limit) { QF_CRIT_STAT QF_CRIT_ENTRY(); -Q_ENSURE_INCRIT(690, limit > 0); +Q_ENSURE_INCRIT(790, limit > 0); QF_CRIT_EXIT(); return inState; @@ -1912,6 +1947,13 @@ m_pthre_dis = static_cast<std::uint8_t>(~m_pthre); reinterpret_cast<QHsm *>(this)->QHsm::dispatch(e, qs_id); + + + noexcept override + + + return reinterpret_cast<QHsm *>(this)->QHsm::isIn(state); + @@ -2744,6 +2786,13 @@ m_temp.fun = initial; reinterpret_cast<QMsm *>(this)->QMsm::dispatch(e, qs_id); + + + noexcept override + + + return reinterpret_cast<QMsm *>(this)->QMsm::isIn(state); + noexcept override @@ -8299,11 +8348,11 @@ if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \ #define QP_HPP_ //============================================================================ -#define QP_VERSION 731U -#define QP_VERSION_STR "7.3.1" +#define QP_VERSION 732U +#define QP_VERSION_STR "7.3.2" -//! Encrypted current QP release (7.3.1) and date (2023-12-05) -#define QP_RELEASE 0x7630E7D4U +//! Encrypted current QP release (7.3.2) and date (2023-12-14) +#define QP_RELEASE 0x762F8843U //============================================================================ //! @cond INTERNAL @@ -10580,6 +10629,8 @@ void assertion_pre_( QS_STR_PRE_((module != nullptr) ? module : "?"); endRec_(); onFlush(); + + // busy-wait until all QS data makes it over to the host for (std::uint32_t volatile ctr = delay; ctr > 0U; ) { ctr = (ctr - 1U); } @@ -12093,14 +12144,19 @@ QSTimeCtr onGetTime() { //............................................................................ extern "C" { -Q_NORETURN Q_onError(char const * const module, int_t const location) { +Q_NORETURN Q_onError( + char const * const module, + int_t const id) +{ + // NOTE: called in a critical section + QP::QS::beginRec_(static_cast<std::uint_fast8_t>(QP::QS_ASSERT_FAIL)); QS_TIME_PRE_(); - QS_U16_PRE_(location); + QS_U16_PRE_(id); QS_STR_PRE_((module != nullptr) ? module : "?"); QP::QS::endRec_(); - QP::QS::onFlush(); // flush the assertion record to the host + QP::QS::onCleanup(); // cleanup after the failure QP::QS::onReset(); // reset the target to prevent it from continuing for (;;) { // onReset() should not return, but to ensure no-return... @@ -12144,7 +12200,7 @@ void processTestEvts_() { if (a->getEQueue().isEmpty()) { // empty queue? tstPriv_.readySet.remove(p); #ifndef Q_UNSAFE - tstPriv_.readySet.verify_(&tstPriv_.readySet_dis); + tstPriv_.readySet.update_(&tstPriv_.readySet_dis); #endif } } diff --git a/qpcpp.sha256 b/qpcpp.sha256 deleted file mode 100644 index 60cb23fde..000000000 --- a/qpcpp.sha256 +++ /dev/null @@ -1,186 +0,0 @@ -c74b952eb659c63c518cfc0481a0658f0ae78b36a49d38b4eb9c2dff7c41749e include/qequeue.hpp -78c391dd15ad21a2a61728dea0d3c809298bc4643ddae850c7f1a66715f9a9b1 include/qk.hpp -692bf2e0d7cecc66b525bba68c1eb43fc1ba29936cea0b1e20e73a2f80918142 include/qmpool.hpp -0788c00f0bf6c6ca41d74ac2b202d3d0693ceebc5aa698fc33dff99076faee9c include/qp.hpp -49600e5f92e1472fcea35715d085a139de1889873cba979c5fde67cf74502c3a include/qpcpp.hpp -e731612b0db07e7e5bde9223be69380789df547553815b03395c65860d3a4845 include/qp_pkg.hpp -ab8b7b629a3886e6ae8df53edf88834aa4cbb0617f4d8acbfb54572a62cf8701 include/qs.hpp -0b753874088d6483a6d7c52d482d07f631fcfddd873a12ba947f50327f68851b include/qsafe.h -3b28a896302e514091476f5194613713f66bb89e8ed4e4c862bcdbdac8b58f26 include/qstamp.hpp -c686a88bd4f9cb672008abf98cd3cbabc6c44f7611ffad95f5b890d42b761e55 include/qs_dummy.hpp -e877ebf413ee91e6b42eb273dda7cb80768482cef6ba54c18ec4393d6f5e403a include/qs_pkg.hpp -39941cada061b72ac029b28ac76c884dc32dbf9d016fe5a6701031c5b0c5842f include/qv.hpp -d2abb10096ad443010596a38eabc2a0fcd07fb961af2698ea4b59c9101f4c2b8 include/qxk.hpp -80e88e7eb1856d788b4c249f7030a0e4f426ab5edf0a1e9ff0ac091d22d16b61 ports/arm-cm/qk/armclang/qk_port.cpp -69754f124b3ba6d8759f78e7f60fc31f3f275afe1798ed325dce02d3bed0e844 ports/arm-cm/qk/armclang/qp_port.hpp -14709f743661a0aadc801954144431213c30fdc24379cecb55b628f60b56e6d3 ports/arm-cm/qk/armclang/qs_port.hpp -0023576f9e385e7b9162ac5b34691b51cb7d057751e1d358b61a09bb6e297802 ports/arm-cm/qk/config/qp_config.hpp -40a34be8ab87af94e3ed35a87d8afce960ac2e85406eb4801ff18204c72f7196 ports/arm-cm/qk/gnu/qk_port.cpp -489f668741e954ebfe5b72de2e0ce5496b90abab57d5de85125e2f305f73c865 ports/arm-cm/qk/gnu/qp_port.hpp -14709f743661a0aadc801954144431213c30fdc24379cecb55b628f60b56e6d3 ports/arm-cm/qk/gnu/qs_port.hpp -11fec352b0add0798f0d684e042b4bcdd020190fa13fd0b55c505d4bd6e5f659 ports/arm-cm/qk/iar/qk_port.cpp -08fb40da99acfe69d8dcfbf5ff56cc5843da25579fe9510694c58a94f5549b97 ports/arm-cm/qk/iar/qp_port.hpp -14709f743661a0aadc801954144431213c30fdc24379cecb55b628f60b56e6d3 ports/arm-cm/qk/iar/qs_port.hpp -5b3152b533702df7c96c2a63a9fd47583dee7fd9b2792e12a0032ac394c047fa ports/arm-cm/qutest/qp_port.hpp -3458b418318d5c51e533296d92ac4c9a4866166a4b12d95e5b99d88de8ddb154 ports/arm-cm/qutest/qs_port.hpp -22f3a22474284f3be127af2e3496bf92e7c6b6a60aa0cc29fc25648d5c6260cc ports/arm-cm/qv/armclang/qp_port.hpp -14709f743661a0aadc801954144431213c30fdc24379cecb55b628f60b56e6d3 ports/arm-cm/qv/armclang/qs_port.hpp -eb547142114df7a9be81b44e0236d615e5f2ce1cc909659ec066fbbdc60044ab ports/arm-cm/qv/armclang/qv_port.cpp -f1b9a8b82ca4c26ea2c05c8636cd43fc86741e16a55ae2865ff93b395bec7a34 ports/arm-cm/qv/config/qp_config.hpp -4758a1bb53e50b1ec5533d6a8b26947e9356e13e0c3d0c5288fa25a24e1db1f8 ports/arm-cm/qv/gnu/qp_port.hpp -14709f743661a0aadc801954144431213c30fdc24379cecb55b628f60b56e6d3 ports/arm-cm/qv/gnu/qs_port.hpp -351bae8cf2aa553caf289856e937b15a9400398af6abc7406a085d65927b8ff1 ports/arm-cm/qv/gnu/qv_port.cpp -5c0ee5af6fd7a9c3db2af7b192c23463c34d21055a9cb60d82fc985e10dba143 ports/arm-cm/qv/iar/qp_port.hpp -14709f743661a0aadc801954144431213c30fdc24379cecb55b628f60b56e6d3 ports/arm-cm/qv/iar/qs_port.hpp -6195c5af066c4a5b6efe6c5adb9c28c208319f002c30526ec8b0c893478a0c3b ports/arm-cm/qv/iar/qv_port.cpp -fdcad75d633666a74d744a1a557607a4d03220e4c0175562e8ae91062ef6d5e6 ports/arm-cm/qxk/armclang/qp_port.hpp -14709f743661a0aadc801954144431213c30fdc24379cecb55b628f60b56e6d3 ports/arm-cm/qxk/armclang/qs_port.hpp -418607a53aafe12c2c55a81f3579ab8eb82154f65ecf6fe302d19f909f53e630 ports/arm-cm/qxk/armclang/qxk_port.cpp -73d5bc22b3e3418319a8d84072c67edb4f0fde4a4db01d081fe9ce713d2cbb48 ports/arm-cm/qxk/config/qp_config.hpp -a9b5b0e7fd92f431fb8c1a90693c94fd151a20d307036ce31b3369dbf3430190 ports/arm-cm/qxk/gnu/qp_port.hpp -14709f743661a0aadc801954144431213c30fdc24379cecb55b628f60b56e6d3 ports/arm-cm/qxk/gnu/qs_port.hpp -da011cbcd43c51602eb8bc16622572ed629b8d08b782c00d386e767fcd80d143 ports/arm-cm/qxk/gnu/qxk_port.cpp -4f90d85899caf56f2e4773ae8c2c44b4ff7c1e65dd4b38a72f0ca49dea2fe719 ports/arm-cm/qxk/iar/qp_port.hpp -14709f743661a0aadc801954144431213c30fdc24379cecb55b628f60b56e6d3 ports/arm-cm/qxk/iar/qs_port.hpp -5d88b84db75b4ea1182212574fccc20ffb0cd65ae7179ded9e5ee14ca5abaa44 ports/arm-cm/qxk/iar/qxk_port.cpp -61d36fed7425ed8f03c833e5f5d5b0da36495bbad45b90893bcd29a3a432f0bb ports/arm-cm/qxk/llvm/README.txt -53d13f467aeb9cacca5d3d6b51e48caa01c15acf503baa8c26890dfcdcff0609 ports/arm-cm/README.md -984a706a3843f23837c25544270158fee56082eb7ae5607d70208a1265e8e9a5 ports/arm-cr/qk/config/qp_config.hpp -1d5ffe732a8c587af4860b8be9917fc3ae24198cc1e19ce9304b81401c3e226d ports/arm-cr/qk/gnu/qp_port.hpp -3458b418318d5c51e533296d92ac4c9a4866166a4b12d95e5b99d88de8ddb154 ports/arm-cr/qk/gnu/qs_port.hpp -b075f7ce1cf7a5551869965f72bade5a208b9377d471961e7ab459e2d9826305 ports/arm-cr/qk/iar/qp_port.hpp -3458b418318d5c51e533296d92ac4c9a4866166a4b12d95e5b99d88de8ddb154 ports/arm-cr/qk/iar/qs_port.hpp -8a0ee516b771ad8fbe81d25b2716ee3109058c97adffa1936023dc81e5b29311 ports/arm-cr/qk/ti/qp_port.hpp -3458b418318d5c51e533296d92ac4c9a4866166a4b12d95e5b99d88de8ddb154 ports/arm-cr/qk/ti/qs_port.hpp -b06b39ce1257595ec8bdc5a950f0bef7b309ad189b9c4fa45f0267f167c388de ports/arm-cr/qv/config/qp_config.hpp -342ecd928f43bcce6886840a29cc77289bce7633d699f6867475c38534435355 ports/arm-cr/qv/gnu/qp_port.hpp -3458b418318d5c51e533296d92ac4c9a4866166a4b12d95e5b99d88de8ddb154 ports/arm-cr/qv/gnu/qs_port.hpp -895c3dceeb0c2e72eac53b28828c8d400665f71f608cd4e7b7837b23b90a27b1 ports/arm-cr/qv/iar/qp_port.hpp -3458b418318d5c51e533296d92ac4c9a4866166a4b12d95e5b99d88de8ddb154 ports/arm-cr/qv/iar/qs_port.hpp -83bc0d816d67ca4360244cc90a0cad987ee92879ad9d70a357d31d99d679181e ports/arm-cr/qv/ti/qp_port.hpp -3458b418318d5c51e533296d92ac4c9a4866166a4b12d95e5b99d88de8ddb154 ports/arm-cr/qv/ti/qs_port.hpp -568bd40c319e50df1ed2c51645f7a4a1b358c06303328ba7c2e81a01d36f1005 ports/config/qp_config.hpp -ad8d64ed65b3dc443aeba16bd1a8005e34343d68620da47b17a676b5faca8599 ports/embos/qf_port.cpp -ad1c2bfad3db0e4c571c6747ef6b84989d0dd73aa02429acf55f2a4c462f8922 ports/embos/qp_port.hpp -0203abd103a85beaa5d7a656e42da5bc3b2d033689b73a6556f253aa0ff673a1 ports/embos/qs_port.hpp -5619421cdbccf45699be80cb4ec726061b410c28768fbf38a650653bf95cf45f ports/freertos/qf_port.cpp -95ef7a30ed61479b0323de60977997a86ed6fa6fea7b0fbe9a555719c2438fbf ports/freertos/qp_port.hpp -aecdfde93db3159ef04dd42e9d01c21e57dd1bf2dc0b0783317cab306b20dec6 ports/freertos/qs_port.hpp -002821ee6610360f38701461689fd43d7d8278052bddbbf42e3e9c50cfa0aea0 ports/lint-plus/16bit/cpu.lnt -f9d142f785e76ad4fa3dfd110b41c6520b90a46a1f81eddebb732ef1bff36008 ports/lint-plus/16bit/cstdint -0a5741b0e0e1e9d883fd5be8a59aa4deb5da69a4995d210147ea26148c0f8311 ports/lint-plus/16bit/qs_port.hpp -f9fba84406cf69f6a112535903c2550eeb62d36221c694a3276f4a32a1db668c ports/lint-plus/32bit/cpu.lnt -766d64be870a0a7954bd9111bb2c6b7504dbe87f3423020764756273ba74bf82 ports/lint-plus/32bit/cstdint -68384555c0a6f0d4506550c0373a3f039be1a1c5114d9185e35439e874dbb008 ports/lint-plus/32bit/qs_port.hpp -5184947126190c847d4815d3c30c27f0b29488221f4d3b4b3ef206fc3a97e304 ports/lint-plus/au-autosar.lnt -fea069eaa4f086c05fe5d0cd6f468981d8270228b60e3b4afb0fa2d46e4f006c ports/lint-plus/au-autosar19.lnt -f021b228f0af091270e17333f35cc4d56678aae5c6efcebb39c64ae6d1ac6a21 ports/lint-plus/au-ds.lnt -ebe8b83390154511244d25540b7ecc0f4edbc76c808f531151ccebfb2f0bb0e8 ports/lint-plus/au-ql-cpp11.lnt -18d1ab3cfd7914a63de1c3868acb9490c9fa96501e99ad49e5ba48643a36c31d ports/lint-plus/lint_qf.log -e70a36579b8f7b41db45cbb8877a042b5453e0975fb30aaccc5353ef78486b2d ports/lint-plus/lint_qk.log -b07661f0694133110879343f20b030c9a393dac1a692f768989d53888032cd84 ports/lint-plus/lint_qs.log -bcb2198fc0996b6a83c4f15f3bbb87f95a64198631331c2022e950ab7aecfec4 ports/lint-plus/lint_qv.log -9900c4e1394c0be45b133b49d1c8f109f5e16f4c0725aacbe152b9d2dad2b010 ports/lint-plus/lint_qxk.log -954fd9f9ab4f29bac122d6f58b42132ae72f7054eaaf16b50264af9dbc37be52 ports/lint-plus/make.bat -ff40bd98d60cbeb979f571d51990ed20803e6b3c86cf0a99aa729c76135e3946 ports/lint-plus/new -3f26a66cfba32649879396fc586514ed1ca2eabca78b1ba6711a5a613332ab3f ports/lint-plus/options.lnt -0f08b17584ea20d4b84db30991f159cc015c488b9f0bcc03aa5279fe6e41ee14 ports/lint-plus/qk/qp_port.hpp -6464648252edf008954485b15778ed42b9f7e5b00e6ea9e0ef6148d2db059224 ports/lint-plus/qpcpp.lnt -f01dd5d9ae1cea3304bd6dbd151a876e47f978b893d758a3310f95c82692d4bd ports/lint-plus/qv/qp_port.hpp -52bf6085fd517364796ff8225d2aa0ff7c3b5fcc6577dfde2962f510cfc55a6f ports/lint-plus/qxk/qp_port.hpp -01d76ddf1cb896a92b79cc12c5f7a290956e778a9120df6f4aa4b49a3b7bfdbc ports/lint-plus/std.lnt -8081abe6a267289e782c0664764d2c593c51c8ac64798dc9457d8063ec00d847 ports/msp430/qk/qp_port.hpp -4800ecd47f74fd6775176d1a42e4c420e14bbda88df68055e4a73257d57c0fd3 ports/msp430/qk/qs_port.hpp -e06d4cbb5efd42b1abe2fdcbc7793d8a461d725e84fdc57e637ddd940c7d6cd3 ports/msp430/qutest/qp_port.hpp -4800ecd47f74fd6775176d1a42e4c420e14bbda88df68055e4a73257d57c0fd3 ports/msp430/qutest/qs_port.hpp -6db494fb85020e64f1f5e77e426916301c8224aa36b8a5c2fc06f75c94fc059c ports/msp430/qv/qp_port.hpp -4800ecd47f74fd6775176d1a42e4c420e14bbda88df68055e4a73257d57c0fd3 ports/msp430/qv/qs_port.hpp -ac48336665909b66d91bfddbf7d741ef7d788afec4b6e8162094f9e536ed7a04 ports/msp430/README.md -fa759eb31672aa2cb6441d3827b488b9cb10d8777ea7313f08598471b8bd4f87 ports/pic32/qk/xc32/qk_port.cpp -1f48a051b83a113d1afa919113c99010ef3b864a91c8fff2adde5c7b567039b0 ports/pic32/qk/xc32/qp_port.hpp -3eb1881d92ef4b8df0945d26b76c5d9d50154a63c63b96ddc071b35d84c74c5a ports/pic32/qk/xc32/qs_port.hpp -bedf04d2ea145fec059a5730defac8c9964d62eb4cf1076af7b798eacc392015 ports/pic32/qutest/xc32/qp_port.hpp -c3341f5ef5ac070bb2d4d1f7deb922a3ac36a5faf42099578027a40222c1a9b6 ports/pic32/qutest/xc32/qs_port.hpp -e6e6da96e1a04245004b46ab458d077989092765c7c73edb8115c50a33def41d ports/pic32/qv/xc32/qp_port.hpp -3eb1881d92ef4b8df0945d26b76c5d9d50154a63c63b96ddc071b35d84c74c5a ports/pic32/qv/xc32/qs_port.hpp -18b6a05663d9d62e4477920d2436049de5914b9455bc37a8737699365a18ab16 ports/posix/qf_port.cpp -44a37466d5d76050f8606221cd02ea5067e1e05ecb812734fe2a6f9a14595265 ports/posix/qp_port.hpp -9658dc8f88521df3156044b048b90eb05b7405ff221c171854fec720f275f960 ports/posix/qs_port.cpp -bc5fc1336ff60bcf8e5555004179a65cad5a4501255b1ceb950b79819ad41501 ports/posix/qs_port.hpp -ffcd9b4ee739c2ba247eb09715f360dc17f1896b5e94ea2e610c7f56c9ebf7ce ports/posix/README.md -8a71e5ecf7284727dedf9af190f5e735459f11d41b08a6b72ce70afd5e25a1d1 ports/posix/safe_std.h -5fb30d6455c7a937a8c3745eb76e35464d5eb855bb085973dc3f84d18e8e3cf3 ports/posix-qutest/qp_port.hpp -17140973f1a0a1f673e765be7b12ebcc128557c32d805b209003622898c95d11 ports/posix-qutest/qs_port.hpp -06b38e5c342222d405b1735a950e6c77ccb5d974328f4e19b4198f25a1341906 ports/posix-qutest/qutest_port.cpp -327cfd02c83d9f0cf3904661ccd640c71f4314044cedbda1d3cf2709fea08ed7 ports/posix-qutest/README.md -8a71e5ecf7284727dedf9af190f5e735459f11d41b08a6b72ce70afd5e25a1d1 ports/posix-qutest/safe_std.h -adfbe4b510e66926abd8dd78a209cffa39d416bc3cff6496f904894accbf7c1f ports/posix-qv/qf_port.cpp -e7f1d8b6677693148b1ca1520ada35a2a54dfd2a37bf0beb8b8c93bfa88cafaa ports/posix-qv/qp_port.hpp -9658dc8f88521df3156044b048b90eb05b7405ff221c171854fec720f275f960 ports/posix-qv/qs_port.cpp -bc5fc1336ff60bcf8e5555004179a65cad5a4501255b1ceb950b79819ad41501 ports/posix-qv/qs_port.hpp -67e78634528b56cbb1d5bf7106a0d75688a0a196c8fc02ff3c33641d5f392885 ports/posix-qv/README.md -8a71e5ecf7284727dedf9af190f5e735459f11d41b08a6b72ce70afd5e25a1d1 ports/posix-qv/safe_std.h -843006a7b98a85e1e00abc3fdb0e36de58ef242ef1fad02f45cccecf0116e213 ports/qep-only/qp_port.hpp -8a71e5ecf7284727dedf9af190f5e735459f11d41b08a6b72ce70afd5e25a1d1 ports/qep-only/safe_std.h -d54f0f3fbe307bd9f0559893378fe3557918b44ccbf2ca29dc33d47e1a1ffc94 ports/threadx/qf_port.cpp -fc2281a1accf900341cbaad6fd93e9493b2b3d35cf9c744a3ac051d15ce11f78 ports/threadx/qp_port.hpp -0203abd103a85beaa5d7a656e42da5bc3b2d033689b73a6556f253aa0ff673a1 ports/threadx/qs_port.hpp -73dd3b4c20382276970c13f028d58eb148dfe57db8ab0e8d751976e31733da96 ports/threadx/README.md -f392f539cbbff60f414793d6958c472311457e8195ddabfcf5eeb759e6258555 ports/uc-os2/qf_port.cpp -add2a6436f09db12bfb4f99bbe0a4b079145c3f936fb83bc9c6d76bc17431535 ports/uc-os2/qp_port.hpp -0203abd103a85beaa5d7a656e42da5bc3b2d033689b73a6556f253aa0ff673a1 ports/uc-os2/qs_port.hpp -ac36307e6a15351c75eaf8772a00214d89c1f1aef26db847ed76391e905276fd ports/win32/Makefile -b48df65c766658b63a5b792a0b64cc6798df89d6a1aeb68eef9a988323524f16 ports/win32/qf_port.cpp -e3642d998bdf86b4a540ef6d12d469ed667341f74f8f35cd1d9935a41ec6a5c9 ports/win32/qp_port.hpp -1a3bc077f95bdd83dbf63c5534c140d584a7cdcabf614262bcb0ae17188360e8 ports/win32/qs_port.cpp -d5420755b0b0b6a5091ae2a75d07d94a76f88d75bfbbb3872c6e9e08a83de034 ports/win32/qs_port.hpp -29a3d9dc3040142797ad449dfc9a7848e995aa2e7c18eccc1ba50d1496f851a9 ports/win32/qwin_gui.c -01cf98964a5eb1cc5d543ee41373cafc0468bc6f6e4e160b58d743bbdad02f51 ports/win32/qwin_gui.h -140a0bb0cc69d993341872da950f8eed47019210e0e737a47c9e55b4d9a64056 ports/win32/README.md -8a71e5ecf7284727dedf9af190f5e735459f11d41b08a6b72ce70afd5e25a1d1 ports/win32/safe_std.h -93dce8cda2223166578c0311c0049f68dcf80b77b2ed7ee891dd91a8cca1220e ports/win32-qutest/qp_port.hpp -d5420755b0b0b6a5091ae2a75d07d94a76f88d75bfbbb3872c6e9e08a83de034 ports/win32-qutest/qs_port.hpp -dd5f21d12c9e124184c34580bb77bc59bc615d0142af2eadd0ace6af1d09fa78 ports/win32-qutest/qutest_port.cpp -8a71e5ecf7284727dedf9af190f5e735459f11d41b08a6b72ce70afd5e25a1d1 ports/win32-qutest/safe_std.h -fccde5106b97d6ebe72719916644ae9f836892730584cab282846441303d88a5 ports/win32-qv/qf_port.cpp -eb173d6e8eb67525edd5cc626102a9fd1f7f0a0cd411b184ee61dc733cdcffe5 ports/win32-qv/qp_port.hpp -1a3bc077f95bdd83dbf63c5534c140d584a7cdcabf614262bcb0ae17188360e8 ports/win32-qv/qs_port.cpp -d5420755b0b0b6a5091ae2a75d07d94a76f88d75bfbbb3872c6e9e08a83de034 ports/win32-qv/qs_port.hpp -29a3d9dc3040142797ad449dfc9a7848e995aa2e7c18eccc1ba50d1496f851a9 ports/win32-qv/qwin_gui.c -01cf98964a5eb1cc5d543ee41373cafc0468bc6f6e4e160b58d743bbdad02f51 ports/win32-qv/qwin_gui.h -4377d5047722c1c458d87d3054e2d0d9e0ea627ba20d010cf4c0cd46b822b24f ports/win32-qv/README.md -8a71e5ecf7284727dedf9af190f5e735459f11d41b08a6b72ce70afd5e25a1d1 ports/win32-qv/safe_std.h -89d6bd776c268f94a27b6de9ebae2c3df604a9d1ad439441cfc5201bfb3332dd ports/zephyr/README.md -1a0c8fcb6f655343b0c22aa3baf74e2b05f839d820e6f96357df8d5b9a1f3d26 qpcpp.qm -d285d0e5246e654d8cd0c9f949afd3c55db619b5b8b169c66c348754264a1640 src/qf/qep_hsm.cpp -ac1634517af76fa51657bcccbfbf8ac615f1068073f00f68a8ea577093e76df2 src/qf/qep_msm.cpp -c6e9e52a451a7287016f9517f07cc46a3b01c0cd3a7866a68ee4bb955388cf20 src/qf/qf_act.cpp -d85d1866b437000833852d3ca8e94ee6a4f66ef709e7d5b530d86d66db1077b7 src/qf/qf_actq.cpp -b7370daa70a849370f49bf739e4acdebe6e3498a1f5c9071c2861f57602719a6 src/qf/qf_defer.cpp -7a0cf87be8005d42eb11a61b971cbe97b56f7cd45b1eae4789786c160bf002fe src/qf/qf_dyn.cpp -64ea06969f01af401939d71f5b94ad0056a73dc307af4e4eba713dea8a0b6e19 src/qf/qf_mem.cpp -7fa8d75d777085c2a43a4405d88a19501c13e048822593f17b4189c84ce1401a src/qf/qf_ps.cpp -ce28ea9f0c3cfef15369e7c816d3cfdc21aa901222807d78d9fe281f388689ea src/qf/qf_qact.cpp -b54c33dd65cf915f49729ae41dd34a4d985a9bb440842da3c643c0b9a28f2f10 src/qf/qf_qeq.cpp -064df33059131694a07eccd9a12e40d5edcbd4e7b2f376c708acec1fc9593d20 src/qf/qf_qmact.cpp -111a5249f6558c0004bc0fa2336f0519821c5a498f24e788c9bb2e174d1106a1 src/qf/qf_time.cpp -e0a9dd7c81c6b4bf6537a0a0ecebd67b0e616c6008e5c726e81cf5ebeeafdd33 src/qk/qk.cpp -eb79501b46677f9bad8ca61e9603a6d9c3516a16afb602931da9cb9a7b9debb3 src/qs/qs.cpp -4fe656ea42ce3a0a2b58797aa6c87478eaf9ee733637cbe6f6334848f9303c1e src/qs/qstamp.cpp -e8a55c4a7ae5c51b0334950383d528919485918b5aa787c3befb1dd15fb1aa63 src/qs/qs_64bit.cpp -1f4888c4e24f6ebdf947337616d9176293555326e03a86c7c2a3a5f92649daf1 src/qs/qs_fp.cpp -3e5c2ef0291f86a8a1c2ff787bfdba92fb175ce5ce6da84eb797f243072d7ba9 src/qs/qs_rx.cpp -ebbd07e0cb4ac93c58646a5d28aad2c211374178f57426cbabad61637c832557 src/qs/qutest.cpp -222c92dbec67fe38f98636e058510b5ed2a91196156540fce025199179fe8e91 src/qv/qv.cpp -59ccdad26a20248381fbcb3523e28613c1d3950007f4def7d50f69515a752f25 src/qxk/qxk.cpp -e3374894356ed316777858db66286aa423858481fbbcce5f1b966a19d6e5fb9b src/qxk/qxk_mutex.cpp -0ebebc0769f1951edec4f565f1d726b93c36d6e7b7b9c57ef6fe8cbce0ca1042 src/qxk/qxk_sema.cpp -a8eb742eb3df17723f7f1cb5abbddcfeb84dc5915b66c3febfa840a9d0b7f364 src/qxk/qxk_xthr.cpp -056b020a42961c9bb8cb5d53fea9bb4480c9fd2e8c8844b55b8938bd7db523c8 zephyr/CMakeLists.txt -2d9c9c09417ee369f9df4a661d4cbd6632e9db0e895afacdb8240f1bbf1488d4 zephyr/Kconfig -4de1df3aa8fcb9966f18c4f6ce858cb1a4e7398d0d97e00912416ff68186bf3c zephyr/module.yml -0352a5cb38faf2f7114828ab612066e3b9620d5f92dd451a35d14b8b9552c86e zephyr/qf_port.cpp -8f95aadc99db2100022ceb12504ba98d6349e59bfc16d30d5cbbe132fe28d054 zephyr/qp_port.hpp -eaf5562bcdbb1849dddd3249030b9e4839800b0933f4ed01f641a02378d0067d zephyr/qs_port.hpp -90e28ec7ae88640b3db999369b08b4a90bce0731e9378d9332d3e7a4e79d6492 zephyr/qutest_port.cpp -a5f328f64fecd30ea5ec52530f9e31627a97abf9199bb6839a2f5dd5ae1c85d8 zephyr/README.md diff --git a/qpcpp_md5.bat b/qpcpp_md5.bat new file mode 100644 index 000000000..db4d372a9 --- /dev/null +++ b/qpcpp_md5.bat @@ -0,0 +1,42 @@ +@setlocal + +:: usage +@echo Usage: qppcp_md5 [gen] +@echo examples: +@echo qppcp_md5 : check the md5 sums in the file qpcpp.md5 +@echo qpcpp_md5 gen : generate the md5 file qpcpp.md5 +@echo. + +@if NOT "%1"=="gen" goto check + +@echo generating qpcpp.md5... +@md5sum qpcpp.qm ^ + include/* ^ + src/qf/* src/qk/* src/qs/* src/qv/* src/qxk/* ^ + ports/arm-cm/qk/armclang/* ports/arm-cm/qk/config/* ports/arm-cm/qk/gnu/* ports/arm-cm/qk/iar/* ^ + ports/arm-cm/qv/armclang/* ports/arm-cm/qv/config/* ports/arm-cm/qv/gnu/* ports/arm-cm/qv/iar/* ^ + ports/arm-cm/qxk/armclang/* ports/arm-cm/qxk/config/* ports/arm-cm/qxk/gnu/* ports/arm-cm/qxk/iar/* ^ + ports/arm-cm/qutest/* ^ + ports/arm-cr/qk/config/* ^ + ports/arm-cr/qk/gnu/* ports/arm-cr/qk/iar/* ports/arm-cr/qk/ti/* ^ + ports/arm-cr/qv/gnu/* ports/arm-cr/qv/iar/* ports/arm-cr/qv/ti/* ^ + ports/msp430/qk/* ports/msp430/qv/* ports/msp430/qutest/* ^ + ports/pic32/qk/xc32/* ports/pic32/qv/xc32/* ports/pic32/qutest/xc32/* ^ + ports/config/* ^ + ports/embos/* ^ + ports/freertos/* ^ + ports/threadx/* ^ + ports/uc-os2/* ^ + ports/qep-only/* ^ + ports/posix/* ports/posix-qv/* ports/posix-qutest/* ^ + ports/win32/* ports/win32-qv/* ports/win32-qutest/* ^ + zephyr/* ^ + > qpcpp.md5 +@echo done +@goto end + +:check + md5sum --check --warn qpcpp.md5 + +:end +@endlocal diff --git a/src/qf/qep_msm.cpp b/src/qf/qep_msm.cpp index 9b4a6addc..22321ce67 100644 --- a/src/qf/qep_msm.cpp +++ b/src/qf/qep_msm.cpp @@ -349,6 +349,30 @@ void QMsm::dispatch( #endif } +//${QEP::QMsm::isIn} ......................................................... +bool QMsm::isIn(QStateHandler const state) noexcept { + bool inState = false; // assume that this MSM is not in 'state' + + QMState const *s = m_state.obj; + std::int_fast8_t limit = 6; // loop hard limit + for (; (s != nullptr) && (limit > 0); --limit) { + if (s->stateHandler == state) { // match found? + inState = true; + break; + } + else { + s = s->superstate; // advance to the superstate + } + } + + QF_CRIT_STAT + QF_CRIT_ENTRY(); + Q_ENSURE_INCRIT(690, limit > 0); + QF_CRIT_EXIT(); + + return inState; +} + //${QEP::QMsm::isInState} .................................................... bool QMsm::isInState(QMState const * const stateObj) const noexcept { bool inState = false; // assume that this MSM is not in 'state' @@ -367,7 +391,7 @@ bool QMsm::isInState(QMState const * const stateObj) const noexcept { QF_CRIT_STAT QF_CRIT_ENTRY(); - Q_ENSURE_INCRIT(690, limit > 0); + Q_ENSURE_INCRIT(790, limit > 0); QF_CRIT_EXIT(); return inState; diff --git a/src/qs/qs.cpp b/src/qs/qs.cpp index 7d6900a67..b55817b7a 100644 --- a/src/qs/qs.cpp +++ b/src/qs/qs.cpp @@ -904,6 +904,8 @@ void assertion_pre_( QS_STR_PRE_((module != nullptr) ? module : "?"); endRec_(); onFlush(); + + // busy-wait until all QS data makes it over to the host for (std::uint32_t volatile ctr = delay; ctr > 0U; ) { ctr = (ctr - 1U); } diff --git a/src/qs/qutest.cpp b/src/qs/qutest.cpp index ca64462a3..d73c6e441 100644 --- a/src/qs/qutest.cpp +++ b/src/qs/qutest.cpp @@ -122,14 +122,19 @@ QSTimeCtr onGetTime() { //............................................................................ extern "C" { -Q_NORETURN Q_onError(char const * const module, int_t const location) { +Q_NORETURN Q_onError( + char const * const module, + int_t const id) +{ + // NOTE: called in a critical section + QP::QS::beginRec_(static_cast(QP::QS_ASSERT_FAIL)); QS_TIME_PRE_(); - QS_U16_PRE_(location); + QS_U16_PRE_(id); QS_STR_PRE_((module != nullptr) ? module : "?"); QP::QS::endRec_(); - QP::QS::onFlush(); // flush the assertion record to the host + QP::QS::onCleanup(); // cleanup after the failure QP::QS::onReset(); // reset the target to prevent it from continuing for (;;) { // onReset() should not return, but to ensure no-return... @@ -173,7 +178,7 @@ void processTestEvts_() { if (a->getEQueue().isEmpty()) { // empty queue? tstPriv_.readySet.remove(p); #ifndef Q_UNSAFE - tstPriv_.readySet.verify_(&tstPriv_.readySet_dis); + tstPriv_.readySet.update_(&tstPriv_.readySet_dis); #endif } } diff --git a/zephyr/qutest_port.cpp b/zephyr/qutest_port.cpp index 2f44baf8b..ddf8c4d62 100644 --- a/zephyr/qutest_port.cpp +++ b/zephyr/qutest_port.cpp @@ -1,7 +1,7 @@ //============================================================================ // Product: QUTEST port for Zephyr RTOS -// Last updated for version 7.3.0 -// Last updated on 2023-10-10 +// Last updated for version 7.3.2 +// Last updated on 2023-12-13 // // Q u a n t u m L e a P s // ------------------------ @@ -98,6 +98,9 @@ QSTimeCtr QS::onGetTime() { // NOTE: invoked inside a critical section return k_cycle_get_32(); } //............................................................................ +// NOTE: +// No critical section in QS::onFlush() to avoid nesting of critical sections +// in case QS::onFlush() is called from Q_onError(). void QS::onFlush(void) { std::uint16_t len = 0xFFFFU; // to get as many bytes as available std::uint8_t const *buf;