iLLD_TC27xD
1.0
|
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) |
This module implements assertion functions.
Global configuration settings (Ifx_Cfg.h) :
Do not include this file but use #include "_Utilities/Ifx_Assert.h" instead
#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.
level | level 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] |
expr | expression to be tested. If FALSE the assertion is executed else nothing is done |
#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, ...
standardIo | Specifies the standard output used |
Enable only if (IFX_CFG_ASSERT_STDIO!=0)
#define IFX_CFG_ASSERT_STDIO (0) |
#define IFX_CFG_ASSERT_STDIO (0) |
#define IFX_CFG_ASSERT_USE_BREAKPOINT (0) |
#define IFX_CFG_ASSERT_VERBOSE_LEVEL_DEFAULT (IFX_VERBOSE_LEVEL_INFO) |
#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.
level | level 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] |
expr | expression to be tested. If FALSE the assertion is executed else nothing is done |
IFX_EXTERN void Ifx_Assert_doLevel | ( | uint8 | level, |
pchar | __assertion, | ||
pchar | __file, | ||
unsigned int | __line, | ||
pchar | __function | ||
) |