1 #ifndef __SI_OSDEBUG_H__
2 #define __SI_OSDEBUG_H__
4 SII_OS_DEBUG_FORMAT_SIMPLE
= 0x0000u
, SII_OS_DEBUG_FORMAT_FILEINFO
=
5 0x0001u
, SII_OS_DEBUG_FORMAT_CHANNEL
= 0x0002u
, SII_OS_DEBUG_FORMAT_TIMESTAMP
= 0x0004u
7 #define MODULE_SET(name) \
8 SII_OSAL_DEBUG_##name, \
9 SII_OSAL_DEBUG_##name##_DBG = SII_OSAL_DEBUG_##name, \
10 SII_OSAL_DEBUG_##name##_ERR, \
11 SII_OSAL_DEBUG_##name##_TRACE, \
12 SII_OSAL_DEBUG_##name##_ALWAYS, \
13 SII_OSAL_DEBUG_##name##_USER1, \
14 SII_OSAL_DEBUG_##name##_USER2, \
15 SII_OSAL_DEBUG_##name##_USER3, \
16 SII_OSAL_DEBUG_##name##_USER4, \
17 SII_OSAL_DEBUG_##name##_MASK = SII_OSAL_DEBUG_##name##_USER4,
26 MODULE_SET(ENTRY_EXIT
)
28 MODULE_SET(SCRATCHPAD
)
31 SII_OSAL_DEBUG_NUM_CHANNELS
32 } SiiOsalDebugChannels_e
;
33 #ifndef SII_DEBUG_CONFIG_RESOURCE_CONSTRAINED
34 typedef void SiiOsDebugChannel_t
;
35 uint32_t SiiOsDebugChannelAdd(uint32_t numChannels
, SiiOsDebugChannel_t
*paChannelList
);
37 void SiiOsDebugChannelEnable(SiiOsalDebugChannels_e channel
);
38 void SiiOsDebugChannelDisable(SiiOsalDebugChannels_e channel
);
39 #define SI_OS_DISABLE_DEBUG_CHANNEL(channel) SiiOsDebugChannelDisable(channel)
40 bool_t
SiiOsDebugChannelIsEnabled(SiiOsalDebugChannels_e channel
);
41 void SiiOsDebugSetConfig(uint16_t flags
);
42 #define SiiOsDebugConfig(flags) SiiOsDebugSetConfig(flags)
43 uint16_t SiiOsDebugGetConfig(void);
44 void SiiOsDebugPrintSimple(SiiOsalDebugChannels_e channel
, char *pszFormat
, ...);
45 void SiiOsDebugPrintShort(SiiOsalDebugChannels_e channel
, char *pszFormat
, ...);
46 void SiiOsDebugPrint(const char *pFileName
, uint32_t iLineNum
, SiiOsalDebugChannels_e channel
,
47 const char *pszFormat
, ...);
48 #ifdef SII_DEBUG_CONFIG_NO_FILE_LINE
49 #define SII_DEBUG_PRINT(channel, ...) SiiOsDebugPrintShort(channel, __VA_ARGS__)
51 #define SII_DEBUG_PRINT(channel, ...) SiiOsDebugPrint(__FILE__, __LINE__, channel, __VA_ARGS__)
53 #define SII_DEBUG(channel, x) if (SiiOsDebugChannelIsEnabled(channel) {x}
54 #define SII_PRINT_FULL(channel, ...) SiiOsDebugPrint(__FILE__, __LINE__, channel, __VA_ARGS__)
55 #define SII_PRINT(channel, ...) SiiOsDebugPrintShort(channel, __VA_ARGS__)
56 #define SII_PRINT_PLAIN(channel, ...) SiiOsDebugPrintSimple(channel, __VA_ARGS__)