@@ -31,6 +31,10 @@ extern "C" {
3131#include "pk_api.h"
3232#include "trac_interface.h"
3333
34+ #ifdef SBE_CONSOLE_SUPPORT
35+ #include "printf.H"
36+ #endif
37+
3438#ifdef __cplusplus
3539}
3640#endif
@@ -47,6 +51,15 @@ extern "C" {
4751#define SBE_EXIT (args ...)
4852#define SBE_DEBUG (args ...)
4953
54+ #if defined(SBE_CONSOLE_SUPPORT ) && defined(ENABLE_CONSOLE_TRACE_IN_FILE )
55+ #define PK_TRACE_INTERNAL (args ...) { \
56+ printf(args); \
57+ printf("\n\r"); \
58+ }
59+ #else
60+ #define PK_TRACE_INTERNAL (args ...) PK_TRACE(args)
61+ #endif
62+
5063// Levels of logging
5164// 0 - No tracing
5265// 1 - Error
@@ -55,21 +68,21 @@ extern "C" {
5568// 4 - Error, info, entry/exit, debug
5669#if (SBE_TRACE_LEVEL >= 1 )
5770#undef SBE_ERROR
58- #define SBE_ERROR (args ...) PK_TRACE (SBE_ERR_MRK"" args)
71+ #define SBE_ERROR (args ...) PK_TRACE_INTERNAL (SBE_ERR_MRK"" args)
5972#endif
6073#if (SBE_TRACE_LEVEL >= 2 )
6174#undef SBE_INFO
62- #define SBE_INFO (args ...) PK_TRACE (SBE_INF_MRK"" args)
75+ #define SBE_INFO (args ...) PK_TRACE_INTERNAL (SBE_INF_MRK"" args)
6376#endif
6477#if (SBE_TRACE_LEVEL >= 3 )
6578#undef SBE_ENTER
6679#undef SBE_EXIT
67- #define SBE_ENTER (args ...) PK_TRACE (SBE_ENTER_MRK"" args)
68- #define SBE_EXIT (args ...) PK_TRACE (SBE_EXIT_MRK"" args)
80+ #define SBE_ENTER (args ...) PK_TRACE_INTERNAL (SBE_ENTER_MRK"" args)
81+ #define SBE_EXIT (args ...) PK_TRACE_INTERNAL (SBE_EXIT_MRK"" args)
6982#endif
7083#if (SBE_TRACE_LEVEL >= 4 )
7184#undef SBE_DEBUG
72- #define SBE_DEBUG (args ...) PK_TRACE (SBE_DEBUG_MRK"" args)
85+ #define SBE_DEBUG (args ...) PK_TRACE_INTERNAL (SBE_DEBUG_MRK"" args)
7386#endif
74- #define SBE_TRACE (args ...) PK_TRACE (args)
87+ #define SBE_TRACE (args ...) PK_TRACE_INTERNAL (args)
7588#endif // __SBEFW_SBE_TRACE_H
0 commit comments