Skip to content

Commit

Permalink
7.4.0-rc.3
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum-leaps committed Sep 5, 2024
1 parent c284a04 commit 25946b8
Show file tree
Hide file tree
Showing 22 changed files with 170 additions and 218 deletions.
2 changes: 1 addition & 1 deletion examples
Submodule examples updated 160 files
20 changes: 4 additions & 16 deletions include/qp.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ enum QStateRet {
// unhandled and need to "bubble up"
Q_RET_SUPER, //!< event passed to superstate to handle
Q_RET_SUPER_SUB, //!< event passed to submachine superstate
Q_RET_UNHANDLED, //!< event unhandled due to a guard
Q_RET_UNHANDLED, //!< event unhandled due to guard

// handled and do not need to "bubble up"
Q_RET_HANDLED, //!< event handled (internal transition)
Expand Down Expand Up @@ -417,13 +417,8 @@ bool QMsm_isIn_(
QAsm * const me,
QStateHandler const state);

//! @private @memberof QMsm
//! @deprecated instead use: QASM_IS_IN()
bool QMsm_isInState(QMsm const * const me,
QMState const * const stateObj);

//! @public @memberof QMsm
static inline QMState const * QMsm_stateObj(QMsm * const me) {
static inline QMState const * QMsm_stateObj(QMsm const * const me) {
return me->super.state.obj;
}

Expand Down Expand Up @@ -861,10 +856,8 @@ void QActive_setAttr(QActive * const me,
uint32_t attr1,
void const * attr2);

// private:

//! @private @memberof QActive
void QActive_start_(QActive * const me,
//! @public @memberof QActive
void QActive_start(QActive * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto,
uint_fast16_t const qLen,
Expand Down Expand Up @@ -1197,11 +1190,6 @@ void QF_gcFromISR(QEvt const * const e);
(evtRef_) = (void *)0; \
} while (false)

//${QF-macros::QACTIVE_START} ................................................
#define QACTIVE_START(me_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_) \
(QActive_start_((QActive *)(me_), (prioSpec_), \
(qSto_), (qLen_), (stkSto_), (stkSize_), (par_)))

//${QF-macros::QACTIVE_POST} .................................................
#ifdef Q_SPY
#define QACTIVE_POST(me_, e_, sender_) \
Expand Down
16 changes: 14 additions & 2 deletions include/qpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,19 @@
//! @deprecated plain 'char' is no longer forbidden in MISRA-C:2023
typedef char char_t;

//! @deprecated assertion failure handler
//! @deprecated Macro for starting an Active Object.
//! Use QActive::QActive_start() instead.
#define QACTIVE_START(me_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_) \
(QActive_start((QActive *)(me_), (prioSpec_), \
(qSto_), (qLen_), (stkSto_), (stkSize_), (par_)))

//! @deprecated Macro for starting an eXtended Thread.
//! Use QXThread::QXThread_start() instead.
#define QXTHREAD_START(me_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_) \
(QXThread_start((QXThread *)(me_), (prioSpec_), \
(qSto_), (qLen_), (stkSto_), (stkSize_), (par_)))

//! @deprecated Assertion failure handler.
//! Use Q_onError() instead.
#define Q_onAssert(module_, id_) Q_onError(module_, id_)

Expand Down Expand Up @@ -130,7 +142,7 @@ static inline void QF_psInit(
#define QHSM_DISPATCH(me_, e_, qsId_) QASM_DISPATCH((me_), (e_), (qsId_))

//! @deprecated instead use: QASM_IS_IN()
#define QHsm_isIn(me_, state_) QHsm_isIn_((QAsm *)(me_), (state_))
#define QHsm_isIn(me_, state_) QASM_IS_IN((QAsm *)(me_), (state_))

//============================================================================
#if (QP_API_VERSION < 691)
Expand Down
16 changes: 12 additions & 4 deletions include/qxk.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ void QXThread_ctor(QXThread * const me,
QXThreadHandler const handler,
uint_fast8_t const tickRate);

//! @public @memberof QXThread
static inline void QXThread_start(QXThread * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto,
uint_fast16_t const qLen,
void * const stkSto,
uint_fast16_t const stkSize,
void const * const par)
{
QActive_start(&me->super, prioSpec, qSto, qLen, stkSto, stkSize, par);
}

//! @public @memberof QXThread
bool QXThread_delay(QTimeEvtCtr const nTicks);

Expand Down Expand Up @@ -269,10 +281,6 @@ void QXMutex_unlock(QXMutex * const me);

//$declare${QXK-macros} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

//${QXK-macros::QXTHREAD_START} ..............................................
#define QXTHREAD_START(me_, prioSpec_, qSto_, qLen_, stkSto_, stkSize_, par_) QACTIVE_START((me_), (prioSpec_), (qSto_), (qLen_), \
(stkSto_), (stkSize_), (par_))

//${QXK-macros::QXTHREAD_POST_X} .............................................
#define QXTHREAD_POST_X(me_, e_, margin_, sender_) \
QACTIVE_POST_X(&(me_)->super, (e_), (margin_), (sender_))
Expand Down
11 changes: 6 additions & 5 deletions ports/embos/qf_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ void QF_stop(void) {
}

//............................................................................
void QActive_start_(QActive * const me, QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
void QActive_start(QActive * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
{
// create the embOS message box for the AO
OS_MAILBOX_Create(&me->eQueue,
Expand Down Expand Up @@ -297,7 +298,7 @@ QEvt const *QActive_get_(QActive * const me) {
// FPU. In this QP-embOS port, an active object task that uses the FPU is
// designated by the QF_TASK_USES_FPU attribute, which can be set with the
// QF_setEmbOsTaskAttr() function. The task attributes must be set *before*
// calling QACTIVE_START(). The task attributes are saved in QActive.osObject
// calling QActive_start(). The task attributes are saved in QActive.osObject
// member.
//
// NOTE3:
Expand Down
4 changes: 2 additions & 2 deletions ports/freertos/qf_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static void task_function(void *pvParameters) { // FreeRTOS task signature
}

//............................................................................
void QActive_start_(QActive * const me,
void QActive_start(QActive * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto,
uint_fast16_t const qLen,
Expand Down Expand Up @@ -214,7 +214,7 @@ void QActive_stop(QActive * const me) {
void QActive_setAttr(QActive *const me, uint32_t attr1, void const *attr2) {
QF_CRIT_STAT
QF_CRIT_ENTRY();
// this function must be called before QACTIVE_START(),
// this function must be called before QActive_start(),
// which implies that me->thread.pxDummy1 must not be used yet;
Q_REQUIRE_INCRIT(300, me->thread.pxDummy1 == (void *)0);
switch (attr1) {
Expand Down
9 changes: 5 additions & 4 deletions ports/posix-qv/qf_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,11 @@ int QF_consoleWaitForKey(void) {
#endif

// QActive functions =========================================================
void QActive_start_(QActive * const me, QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
void QActive_start(QActive * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
{
Q_UNUSED_PAR(stkSto);
Q_UNUSED_PAR(stkSize);
Expand Down
9 changes: 5 additions & 4 deletions ports/posix/qf_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,11 @@ static void *thread_routine(void *arg) { // the expected POSIX signature
}

// QActive functions =======================================================
void QActive_start_(QActive * const me, QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
void QActive_start(QActive * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
{
Q_UNUSED_PAR(stkSto);
Q_UNUSED_PAR(stkSize);
Expand Down
2 changes: 1 addition & 1 deletion ports/qube/qube.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ int_t QF_run(void) {
}

//--------------------------------------------------------------------------
void QActive_start_(QActive* const me,
void QActive_start(QActive* const me,
QPrioSpec const prioSpec,
QEvt const** const qSto,
uint_fast16_t const qLen,
Expand Down
11 changes: 6 additions & 5 deletions ports/threadx/qf_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ static void thread_function(ULONG thread_input) { // ThreadX signature
}
}
//............................................................................
void QActive_start_(QActive * const me, QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
void QActive_start(QActive * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
{
me->prio = (uint8_t)(prioSpec & 0xFFU); // QF-priority
me->pthre = (uint8_t)(prioSpec >> 8U); // QF preemption-threshold
Expand Down Expand Up @@ -116,7 +117,7 @@ void QActive_start_(QActive * const me, QPrioSpec const prioSpec,
}
//............................................................................
void QActive_setAttr(QActive *const me, uint32_t attr1, void const *attr2) {
// this function must be called before QACTIVE_START(),
// this function must be called before QActive_start(),
// which implies that me->thread.tx_thread_name must not be used yet;
//
QF_CRIT_STAT
Expand Down
13 changes: 7 additions & 6 deletions ports/uc-os2/qf_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ static void task_function(void *pdata) { // uC-OS2 task signature
}

//............................................................................
void QActive_start_(QActive * const me, QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
void QActive_start(QActive * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
{
// task name to be passed to OSTaskCreateExt()
void * const task_name = (void *)me->eQueue;
Expand Down Expand Up @@ -168,7 +169,7 @@ void QActive_setAttr(QActive *const me, uint32_t attr1, void const *attr2) {
QF_CRIT_ENTRY();
switch (attr1) {
case TASK_NAME_ATTR:
// this function must be called before QACTIVE_START(),
// this function must be called before QActive_start(),
// which implies that me->eQueue must not be used yet;
Q_ASSERT_INCRIT(300, me->eQueue == (OS_EVENT *)0);
// temporarily store the name, cast 'const' away
Expand Down Expand Up @@ -311,7 +312,7 @@ QEvt const *QActive_get_(QActive * const me) {
// NOTE1:
// The member QActive.thread is set to the uC-OS2 task options in the
// function QF_setUCosTaskAttr(), which must be called **before**
// QACTIVE_START().
// QActive_start().
//
// NOTE3:
// The event posting to uC-OS2 message queue occurs OUTSIDE critical section,
Expand Down
9 changes: 5 additions & 4 deletions ports/win32-qv/qf_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,11 @@ int QF_consoleWaitForKey(void) {

// QActive functions =========================================================

void QActive_start_(QActive * const me, QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
void QActive_start(QActive * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
{
Q_UNUSED_PAR(stkSto);
Q_UNUSED_PAR(stkSize);
Expand Down
9 changes: 5 additions & 4 deletions ports/win32/qf_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,11 @@ int QF_consoleWaitForKey(void) {

// QActive functions =========================================================

void QActive_start_(QActive * const me, QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
void QActive_start(QActive * const me,
QPrioSpec const prioSpec,
QEvt const * * const qSto, uint_fast16_t const qLen,
void * const stkSto, uint_fast16_t const stkSize,
void const * const par)
{
Q_UNUSED_PAR(stkSto);
Q_UNUSED_PAR(stkSize);
Expand Down
Loading

0 comments on commit 25946b8

Please sign in to comment.