diff --git a/cores/nRF5/common_func.h b/cores/nRF5/common_func.h index 39d395ff..be9a868e 100644 --- a/cores/nRF5/common_func.h +++ b/cores/nRF5/common_func.h @@ -116,6 +116,13 @@ //--------------------------------------------------------------------+ const char* dbg_err_str(int32_t err_id); // TODO move to other place +#if __cplusplus +#define PRINTF ::printf +#else +#define PRINTF printf +#endif + + #if CFG_DEBUG #define LOG_LV1(...) ADALOG(__VA_ARGS__) #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 #if CFG_DEBUG -#if __cplusplus -#define PRINTF ::printf -#else -#define PRINTF printf -#endif - #define PRINT_LOCATION() PRINTF("%s: %d:\n", __PRETTY_FUNCTION__, __LINE__) #define PRINT_MESS(x) PRINTF("%s: %d: %s \n" , __FUNCTION__, __LINE__, (char*)(x)) #define PRTNT_HEAP() if (CFG_DEBUG >= 3) PRINTF("\n%s: %d: Heap free: %d\n", __FUNCTION__, __LINE__, util_heap_get_free_size()) diff --git a/cores/nRF5/utility/debug.cpp b/cores/nRF5/utility/debug.cpp index 666fd32b..33118c30 100644 --- a/cores/nRF5/utility/debug.cpp +++ b/cores/nRF5/utility/debug.cpp @@ -39,6 +39,7 @@ #include #include #include +#include // defined in linker script extern uint32_t __data_start__[];