Skip to content

Commit

Permalink
triceAsssertTrue and triceAssertFalse are now covered by TRICE_CLEAN …
Browse files Browse the repository at this point in the history
…too.
  • Loading branch information
rokath committed Apr 3, 2024
1 parent b80d9ea commit 7d00ee3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/MDK-ARM_STM32F030R8_instrumented/Core/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ int main(void)
Trice( "w: Hello! 👋🙂 \a\n" ); // with sound!
Trice( "w: Hello! 👋🙂 \a\n" ); // with sound!
trice( "w: Hello! 👋🙂 \a\n" ); // with sound!
triceAssert( "FATAL:Oh, no 1st test!\n", 0 );
TRiceAssert( "FATAL:Oh, no 2nd test!\n", 1 );
TriceAssert( "FATAL:Oh, no 3rd test!\n", 0 );
triceAssertTrue( "FATAL:Oh, no 1st test!\n", 1 );
TRiceAssertTrue( "FATAL:Oh, no 2nd test!\n", 0 );
TriceAssertFalse( "FATAL:Oh, no 3rd test!\n", 0 );
trice( "w: Hello! 👋🙂 \a\n" ); // with sound!
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; // enable SysTick interrupt
/* USER CODE END SysInit */
Expand Down
4 changes: 4 additions & 0 deletions src/trice.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,8 @@ unsigned TriceOutDepth( void ){
return depth;
}

#ifdef TRICE_CLEAN
#else // #ifdef TRICE_CLEAN

//! TRICE_ASSERT writes trice data as fast as possible in a buffer.
//! \param tid is a 16 bit Trice id in upper 2 bytes of a 32 bit value
Expand Down Expand Up @@ -653,3 +655,5 @@ void TRiceAssertFalse( int idN, char* msg, int flag ){
TRICE_ASSERT( ID( idN ) );
}
}

#endif // #else // #ifdef TRICE_CLEAN
24 changes: 21 additions & 3 deletions src/trice.h
Original file line number Diff line number Diff line change
Expand Up @@ -905,9 +905,27 @@ TRICE_INLINE void trice0( uint16_t tid, char const * pFmt ){ trice32m_0( tid );

#endif // #else // #ifdef TRICE_TRANSFER_ORDER_IS_NOT_MCU_ENDIAN

void triceAssert( int idN, char* msg, int flag );
void TriceAssert( int idN, char* msg, int flag );
void TRiceAssert( int idN, char* msg, int flag );
#ifdef TRICE_CLEAN

TRICE_INLINE void triceAssertTrue( int idN, char* msg, int flag ){}
TRICE_INLINE void TriceAssertTrue( int idN, char* msg, int flag ){}
TRICE_INLINE void TRiceAssertTrue( int idN, char* msg, int flag ){}

TRICE_INLINE void triceAssertFalse( int idN, char* msg, int flag ){}
TRICE_INLINE void TriceAssertFalse( int idN, char* msg, int flag ){}
TRICE_INLINE void TRiceAssertFalse( int idN, char* msg, int flag ){}

#else // #ifdef TRICE_CLEAN

void triceAssertTrue( int idN, char* msg, int flag );
void TriceAssertTrue( int idN, char* msg, int flag );
void TRiceAssertTrue( int idN, char* msg, int flag );

void triceAssertFalse( int idN, char* msg, int flag );
void TriceAssertFalse( int idN, char* msg, int flag );
void TRiceAssertFalse( int idN, char* msg, int flag );

#endif // #else // #ifdef TRICE_CLEAN

typedef void (*WriteAuxiliaryFn_t)( uint8_t const * enc, size_t encLen );
extern WriteAuxiliaryFn_t UserNonBlockingDirectWriteAuxiliaryFn;
Expand Down

0 comments on commit 7d00ee3

Please sign in to comment.