iLLD_TC27xD  1.0
Collaboration diagram for Assertion:

Files

file  Assert.h
 Assert functions.
 

Macros

#define IFX_CFG_ASSERT_STDIO   (0)
 If set to 1, the assert message is send to the Assert_io interface. More...
 
#define IFX_CFG_ASSERT_STDIO   (0)
 If set to 1, the assert message is send to the Assert_io interface. More...
 
#define IFX_CFG_ASSERT_USE_BREAKPOINT   (0)
 If set to 1, the assert function will break the execution (breakpoint) More...
 
#define IFX_CFG_ASSERT_VERBOSE_LEVEL_DEFAULT   (IFX_VERBOSE_LEVEL_INFO)
 defines the assertion default level More...
 
#define Ifx_Assert_setStandardIo(standardIo)   ((void)0)
 Set the standard output used for IFX_ASSERT and IFX_VALIDATE. More...
 
#define IFX_ASSERT(level, expr)   ((void)0)
 Assertion function (assert) More...
 
#define IFX_VALIDATE(level, expr)   (expr)
 Assertion function (validate) More...
 

Functions

IFX_EXTERN void Ifx_Assert_doLevel (uint8 level, pchar __assertion, pchar __file, unsigned int __line, pchar __function)
 
IFX_EXTERN boolean Ifx_Assert_doValidate (boolean expr, uint8 level, pchar __assertion, pchar __file, unsigned int __line, pchar __function)
 

Detailed Description

This module implements assertion functions.

Global configuration settings (Ifx_Cfg.h) :

Do not include this file but use #include "_Utilities/Ifx_Assert.h" instead

Macro Definition Documentation

#define IFX_ASSERT (   level,
  expr 
)    ((void)0)

Assertion function (assert)

If expr is FALSE, then an assertion message is displayed. The message indicates the assertion level, the file, line and function where the assertion occurred, and also display expr as text. In case the debug break point is enabled then a debug instruction will also be inserted so that the debugger stops

If expr is true, nothing is additional done.

The expr expression is ignored (code disabled) in case the assertion level set by IFX_CFG_ASSERT_VERBOSE_LEVEL_DEFAULT is IFX_VERBOSE_LEVEL_OFF.

The output needs to the be set with the function Ifx_Assert_setStandardIo() in order for the message to be displayed.

Parameters
levellevel of the assertion, range=[IFX_VERBOSE_LEVEL_OFF, IFX_VERBOSE_LEVEL_FAILURE, IFX_VERBOSE_LEVEL_ERROR, IFX_VERBOSE_LEVEL_WARNING, IFX_VERBOSE_LEVEL_INFO, IFX_VERBOSE_LEVEL_DEBUG]
exprexpression to be tested. If FALSE the assertion is executed else nothing is done
Returns
void

Definition at line 156 of file Assert.h.

#define Ifx_Assert_setStandardIo (   standardIo)    ((void)0)

Set the standard output used for IFX_ASSERT and IFX_VALIDATE.

For example the standard IO could redirect the output to a serial interface, CAN interface, ...

Parameters
standardIoSpecifies the standard output used

Enable only if (IFX_CFG_ASSERT_STDIO!=0)

Returns
None.

Definition at line 88 of file Assert.h.

#define IFX_CFG_ASSERT_STDIO   (0)

If set to 1, the assert message is send to the Assert_io interface.

Definition at line 126 of file Assert.h.

#define IFX_CFG_ASSERT_STDIO   (0)

If set to 1, the assert message is send to the Assert_io interface.

Definition at line 126 of file Assert.h.

#define IFX_CFG_ASSERT_USE_BREAKPOINT   (0)

If set to 1, the assert function will break the execution (breakpoint)

Definition at line 64 of file Assert.h.

#define IFX_CFG_ASSERT_VERBOSE_LEVEL_DEFAULT   (IFX_VERBOSE_LEVEL_INFO)

defines the assertion default level

If not defined, the default assert level is set to IFX_VERBOSE_LEVEL_INFO

Definition at line 72 of file Assert.h.

#define IFX_VALIDATE (   level,
  expr 
)    (expr)

Assertion function (validate)

If expr is FALSE, then an assertion message is displayed. The message indicates the assertion level, the file, line and function where the assertion occurred, and also display expr as text. In case the debug break point is enabled then a debug instruction will also be inserted so that the debugger stops.

IFX_VALIDATE differs from IFX_ASSERT in the way that the expr expression is evaluated whatever the assertion level set by IFX_CFG_ASSERT_VERBOSE_LEVEL_DEFAULT.

The output needs to the be set with the function Ifx_Assert_setStandardIo() in order for the message to be displayed.

Parameters
levellevel of the assertion, range=[IFX_VERBOSE_LEVEL_OFF, IFX_VERBOSE_LEVEL_FAILURE, IFX_VERBOSE_LEVEL_ERROR, IFX_VERBOSE_LEVEL_WARNING, IFX_VERBOSE_LEVEL_INFO, IFX_VERBOSE_LEVEL_DEBUG]
exprexpression to be tested. If FALSE the assertion is executed else nothing is done
Returns
void

Definition at line 182 of file Assert.h.

Function Documentation

IFX_EXTERN void Ifx_Assert_doLevel ( uint8  level,
pchar  __assertion,
pchar  __file,
unsigned int  __line,
pchar  __function 
)

Definition at line 57 of file Assert.c.

IFX_EXTERN boolean Ifx_Assert_doValidate ( boolean  expr,
uint8  level,
pchar  __assertion,
pchar  __file,
unsigned int  __line,
pchar  __function 
)

Definition at line 80 of file Assert.c.