Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Define PRINTF macro regardless of debug level.
  • Loading branch information
henrygab committed Mar 11, 2020
commit 03805f3c33edc9878c4ab0abcd953793aed63c0f
13 changes: 7 additions & 6 deletions cores/nRF5/common_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand All @@ -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())
Expand Down
1 change: 1 addition & 0 deletions cores/nRF5/utility/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <malloc.h>
#include <Arduino.h>
#include <ctype.h>
#include <common_func.h>

// defined in linker script
extern uint32_t __data_start__[];
Expand Down