From 64174a7ff90986d76bf01cf532f8a3e9d8522e22 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 7 Mar 2017 00:45:48 +0700 Subject: [PATCH] add LOG_LV1, LOG_LV2 --- cores/nRF5/common_func.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cores/nRF5/common_func.h b/cores/nRF5/common_func.h index 814e1b47..f3c93629 100644 --- a/cores/nRF5/common_func.h +++ b/cores/nRF5/common_func.h @@ -117,6 +117,26 @@ int cprintf(const char * format, ...); cprintf("\n");\ }while(0) +#if CFG_DEBUG +#define LOG_LV1(...) ADALOG(__VA_ARGS__) +#else +#define LOG_LV1(...) +#endif + +#if CFG_DEBUG >= 2 +#define LOG_LV2(...) ADALOG(__VA_ARGS__) +#else +#define LOG_LV2(...) +#endif + +#define ADALOG(tag, ...) \ + do { \ + cprintf("[" #tag "] ");\ + cprintf(__VA_ARGS__);\ + cprintf("\n");\ + }while(0) + + #else #define PRINT_LOCATION()