From eb8ca14bf8171b48832410ed5e3f888df6564800 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 30 May 2021 22:19:46 +0700 Subject: [PATCH] add level 3 log for info, add generic TU_LOG() --- src/common/tusb_common.h | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index 1ebd8dd61..6f2905697 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -307,25 +307,40 @@ void tu_print_var(uint8_t const* buf, uint32_t bufsize) for(uint32_t i=0; i 1 +// Log Level 2: Warn +#if CFG_TUSB_DEBUG >= 2 #define TU_LOG2 TU_LOG1 #define TU_LOG2_MEM TU_LOG1_MEM #define TU_LOG2_VAR TU_LOG1_VAR #define TU_LOG2_INT TU_LOG1_INT #define TU_LOG2_HEX TU_LOG1_HEX - #define TU_LOG2_LOCATION() TU_LOG1_LOCATION() #endif +// Log Level 3: Info +#if CFG_TUSB_DEBUG >= 3 + #define TU_LOG3 TU_LOG1 + #define TU_LOG3_MEM TU_LOG1_MEM + #define TU_LOG3_VAR TU_LOG1_VAR + #define TU_LOG3_INT TU_LOG1_INT + #define TU_LOG3_HEX TU_LOG1_HEX +#endif typedef struct { @@ -370,6 +385,15 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3 #define TU_LOG2_LOCATION() #endif +#ifndef TU_LOG3 + #define TU_LOG3(...) + #define TU_LOG3_MEM(...) + #define TU_LOG3_VAR(...) + #define TU_LOG3_INT(...) + #define TU_LOG3_HEX(...) + #define TU_LOG3_LOCATION() +#endif + #ifdef __cplusplus } #endif