Skip to content

Commit 03805f3

Browse files
committed
Define PRINTF macro regardless of debug level.
1 parent b8fb0cd commit 03805f3

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

cores/nRF5/common_func.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@
116116
//--------------------------------------------------------------------+
117117
const char* dbg_err_str(int32_t err_id); // TODO move to other place
118118

119+
#if __cplusplus
120+
#define PRINTF ::printf
121+
#else
122+
#define PRINTF printf
123+
#endif
124+
125+
119126
#if CFG_DEBUG
120127
#define LOG_LV1(...) ADALOG(__VA_ARGS__)
121128
#define LOG_LV1_BUFFER(...) ADALOG_BUFFER(__VA_ARGS__)
@@ -134,12 +141,6 @@ const char* dbg_err_str(int32_t err_id); // TODO move to other place
134141

135142
#if CFG_DEBUG
136143

137-
#if __cplusplus
138-
#define PRINTF ::printf
139-
#else
140-
#define PRINTF printf
141-
#endif
142-
143144
#define PRINT_LOCATION() PRINTF("%s: %d:\n", __PRETTY_FUNCTION__, __LINE__)
144145
#define PRINT_MESS(x) PRINTF("%s: %d: %s \n" , __FUNCTION__, __LINE__, (char*)(x))
145146
#define PRTNT_HEAP() if (CFG_DEBUG >= 3) PRINTF("\n%s: %d: Heap free: %d\n", __FUNCTION__, __LINE__, util_heap_get_free_size())

cores/nRF5/utility/debug.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <malloc.h>
4040
#include <Arduino.h>
4141
#include <ctype.h>
42+
#include <common_func.h>
4243

4344
// defined in linker script
4445
extern uint32_t __data_start__[];

0 commit comments

Comments
 (0)