1.2.5.4.9 SYS_DEBUG_MESSAGE Macro

C

#define SYS_DEBUG_MESSAGE(level,message)

SYS_DEBUG_MESSAGE(SYS_ERROR_LEVEL level, const char* message )

Summary

Prints a debug message if the system error level is defined at or lower than the level specified.

Description

This function prints a debug message if the system error level is defined at or lower than the level specified. If mapped to the SYS_DEBUG_Message function, then the system debug service must be initialized and running.

Precondition

If mapped to the SYS_DEBUG_Message function, then the system debug service must be initialized and running.

Parameters

ParamDescription
levelThe current error level threshold for displaying the message.
messagePointer to a buffer containing the message to be displayed.

Returns

None.

Example

// In configuration.h file: #define SYS_DEBUG_USE_CONSOLE
// In sys_debug.h file: #define SYS_DEBUG_MESSAGE(level, message) _SYS_DEBUG_MESSAGE(level, message)

SYS_DEBUG_ErrorLevelSet(SYS_ERROR_DEBUG);
SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "System Debug Message \r\n");

Remarks

By default, this macro is defined as nothing, effectively removing all code generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro must be defined in a way that maps calls to it to the desired implementation (see example, above).

This macro can be mapped to the system console service (along with other system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system configuration (configuration.h) instead of defining it individually.