Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,10 @@ Temporary Items

# gcc code coverage
*.gcno
*.gcda
*.gcda

# vscode
.vscode

# builds
build/
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ add_library( ${PROJECT_NAME}
qedgecheck.c
qbsbuffers.c
qresponse.c
qinput.c
)
set( QUARKTS_CONFIG_PATH ../os_config )
set_target_properties( ${PROJECT_NAME} PROPERTIES PUBLIC_HEADER include/QuarkTS.h )
Expand Down
1 change: 1 addition & 0 deletions include/QuarkTS.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Read the API reference here ; https://kmilo17pet.github.io/QuarkTS/
#include "qcoroutine.h"
#include "qioutils.h"
#include "qtrace.h"
#include "qinput.h"

#if ( Q_MEMORY_MANAGER == 1 )
#include "qmemmang.h"
Expand Down
47 changes: 32 additions & 15 deletions include/qcoroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,27 @@
_qCR_Oper_t; // skipcq: CXX-E2000

/*Construction statements*/
#define _qCR_LCInit /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_LCInit \
{ _qCR_PC_INIT_VAL, _qCR_UNDEFINED, QSTIMER_INITIALIZER } \

#define _qCR_RT( _PT_ ) /* skipcq: CXX-E2000 */ \
// skipcq: CXX-E2000
#define _qCR_RT( _PT_ ) \
case (_qCR_TaskPC_t)(_PT_) : \

// skipcq: CXX-E2000
#define _qCR_JUMP( _DST_ ) switch (_DST_) // skipcq: CXX-W1164

// skipcq: CXX-E2000
#define _qCR_LCON( _DST_ , _STATE_, _REST_, _ACTION_ ) \
( _DST_ ) = (_STATE_); \
_ACTION_; \
_REST_ Q_UNUSED(0) \

#define _qCR_EXIT goto _qCR_ExitPoint // skipcq: CXX-E2000

#define _qCR_DEF /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_DEF \
static _qCR_Instance_t _qCRState = _qCR_LCInit; \
_qCR_Instance_t * const _qcr = &_qCRState \

Expand All @@ -103,14 +108,16 @@
/*! @cond */
/*Core Statements*/
/*=======================================================================*/
#define _qCR_Start /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_Start \
_qCR_DEF; \
_qCR_JUMP( _qcr->instr ) { /* skipcq: CXX-W1197 */\
_qCR_RT( _qCR_PC_INIT_VAL ) \


/*=======================================================================*/
#define _qCR_hStart( handle ) /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_hStart( handle ) \
_qCR_DEF; \
if ( NULL == (handle) ) { \
(handle) = &_qCRState; \
Expand All @@ -120,28 +127,32 @@
_qCR_RT( _qCR_PC_INIT_VAL ) \

/*=======================================================================*/
#define _qCR_Dispose /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_Dispose \
_qcr->instr = _qCR_PC_INIT_VAL; \
} \
_qCR_ExitPoint: Q_UNUSED(0) \


/*=======================================================================*/
#define _qCR_Yield /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_Yield \
do { \
_qCR_LCON( _qcr->instr, __LINE__, _qCR_RT(__LINE__), _qCR_EXIT ); \
} while ( qFalse ) \


/*=======================================================================*/
#define _qCR_Restart /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_Restart \
do { \
_qCR_LCON( _qcr->instr, _qCR_PC_INIT_VAL, Q_NONE, _qCR_EXIT ); \
} while ( qFalse ) \


/*=======================================================================*/
#define _qCR_wu_Assert( condition ) /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_wu_Assert( condition ) \
do { \
_qCR_LCON( _qcr->instr, __LINE__, _qCR_RT(__LINE__), Q_UNUSED(0) ); \
if ( !(condition) ) { \
Expand All @@ -151,22 +162,25 @@


/*=======================================================================*/
#define _qCR_GetPosition( position ) /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_GetPosition( position ) \
do { \
_qCR_LCON( position, __LINE__, _qCR_RT(__LINE__), Q_UNUSED(0) ); \
Q_UNUSED( (position) ); \
} while ( qFalse ) \


/*=======================================================================*/
#define _qCR_RestoreFromPosition( position ) /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_RestoreFromPosition( position ) \
do { \
_qCR_LCON( _qcr->instr, (position), Q_NONE, _qCR_EXIT ); \
} while ( qFalse ) \


/*=======================================================================*/
#define _qCR_Delay( dTime ) /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_Delay( dTime ) \
do { \
qCR_TimeoutSet( dTime ); \
_qCR_LCON( _qcr->instr, __LINE__, _qCR_RT(__LINE__), Q_UNUSED(0) ); \
Expand All @@ -177,7 +191,8 @@


/*=======================================================================*/
#define _qCR_wu_TmrAssert( condition, timeout ) /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_wu_TmrAssert( condition, timeout ) \
do { \
qCR_TimeoutSet( timeout ); \
_qCR_LCON( _qcr->instr, __LINE__, _qCR_RT(__LINE__), Q_UNUSED(0) ); \
Expand All @@ -188,13 +203,15 @@


/*=======================================================================*/
#define _qCR_do /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_do \
do { \
_qCR_LCON( _qcr->instr, __LINE__, _qCR_RT(__LINE__), Q_UNUSED(0) ); \


/*=======================================================================*/
#define _qCR_until( condition ) /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qCR_until( condition ) \
if ( !(condition) ) { \
_qCR_EXIT; \
} \
Expand Down
3 changes: 2 additions & 1 deletion include/qedgecheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@

/*! @cond */
/*cppcheck-suppress misra-c2012-20.7 */
#define _QEDGECHECK_REG_FCN_DEC(NAME) /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _QEDGECHECK_REG_FCN_DEC(NAME) \
qBool_t NAME( const void *addr, qBool_t pinNumber ) \

_QEDGECHECK_REG_FCN_DEC( _qReg_32Bits );
Expand Down
3 changes: 2 additions & 1 deletion include/qfsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@
/*fields for the qSM_Handler_t pointer*/
/*! @cond */
/*cppcheck-suppress misra-c2012-20.7 */
#define _qSM_HANDLER_FIELDS( pAttrib ) /* skipcq: CXX-E2000 */\
// skipcq: CXX-E2000
#define _qSM_HANDLER_FIELDS( pAttrib ) \
void *StartState; \
void *NextState; \
pAttrib void *machine; \
Expand Down
Loading