EFM32 Jade Gecko 12 Software Documentation  efm32jg12-doc-5.1.2
ASSERT

Detailed Description

Error checking module.

By default, EMLIB library assert usage is not included in order to reduce footprint and processing overhead. Further, EMLIB assert usage is decoupled from ISO C assert handling (NDEBUG usage), to allow a user to use ISO C assert without including EMLIB assert statements.

Below are available defines for controlling EMLIB assert inclusion. The defines are typically defined for a project to be used by the preprocessor.

Note
The internal EMLIB assert is documented here because DEBUG_EFM is defined in the doxygen configuration.

Macros

#define EFM_ASSERT(expr)    ((expr) ? ((void)0) : assertEFM(__FILE__, __LINE__))
 

Functions

void assertEFM (const char *file, int line)
 EFM internal assert handling. More...
 

Function Documentation

void assertEFM ( const char *  file,
int  line 
)

EFM internal assert handling.

This function is invoked through EFM_ASSERT() macro usage only, it should not be used explicitly.

This implementation simply enters an indefinite loop, allowing the use of a debugger to determine cause of failure. By defining DEBUG_EFM_USER to the preprocessor for all files, a user defined version of this function must be defined and will be invoked instead, possibly providing output of assertion location.

Note
This function is not used unless DEBUG_EFM is defined during preprocessing of EFM_ASSERT() usage.
Parameters
[in]fileName of source file where assertion failed.
[in]lineLine number in source file where assertion failed.

Definition at line 70 of file em_assert.c.