@@ -31,6 +31,10 @@ extern "C" {
31
31
#include "pk_api.h"
32
32
#include "trac_interface.h"
33
33
34
+ #ifdef SBE_CONSOLE_SUPPORT
35
+ #include "printf.H"
36
+ #endif
37
+
34
38
#ifdef __cplusplus
35
39
}
36
40
#endif
@@ -47,6 +51,15 @@ extern "C" {
47
51
#define SBE_EXIT (args ...)
48
52
#define SBE_DEBUG (args ...)
49
53
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
+
50
63
// Levels of logging
51
64
// 0 - No tracing
52
65
// 1 - Error
@@ -55,21 +68,21 @@ extern "C" {
55
68
// 4 - Error, info, entry/exit, debug
56
69
#if (SBE_TRACE_LEVEL >= 1 )
57
70
#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)
59
72
#endif
60
73
#if (SBE_TRACE_LEVEL >= 2 )
61
74
#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)
63
76
#endif
64
77
#if (SBE_TRACE_LEVEL >= 3 )
65
78
#undef SBE_ENTER
66
79
#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)
69
82
#endif
70
83
#if (SBE_TRACE_LEVEL >= 4 )
71
84
#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)
73
86
#endif
74
- #define SBE_TRACE (args ...) PK_TRACE (args)
87
+ #define SBE_TRACE (args ...) PK_TRACE_INTERNAL (args)
75
88
#endif // __SBEFW_SBE_TRACE_H
0 commit comments