From 54107100bbc32756324070a6a06146b958f653d6 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 2 Jun 2021 00:26:50 +0700 Subject: [PATCH] fix missing TU_LOG symbol --- src/common/tusb_common.h | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index d9b388916..3350ed86c 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -24,10 +24,6 @@ * This file is part of the TinyUSB stack. */ -/** \ingroup Group_Common - * \defgroup Group_CommonH common.h - * @{ */ - #ifndef _TUSB_COMMON_H_ #define _TUSB_COMMON_H_ @@ -288,8 +284,9 @@ TU_ATTR_ALWAYS_INLINE static inline void tu_unaligned_write16 (void* mem, ui // CFG_TUSB_DEBUG for debugging // 0 : no debug -// 1 : print when there is error -// 2 : print out log +// 1 : print error +// 2 : print warning +// 3 : print info #if CFG_TUSB_DEBUG void tu_print_mem(void const *buf, uint32_t count, uint8_t indent); @@ -316,7 +313,6 @@ void tu_print_var(uint8_t const* buf, uint32_t bufsize) #define TU_LOG_LOCATION() tu_printf("%s: %d:\r\n", __PRETTY_FUNCTION__, __LINE__) #define TU_LOG_FAILED() tu_printf("%s: %d: Failed\r\n", __PRETTY_FUNCTION__, __LINE__) - // Log Level 1: Error #define TU_LOG1 tu_printf #define TU_LOG1_MEM tu_print_mem @@ -366,6 +362,17 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3 #endif // CFG_TUSB_DEBUG +#ifndef TU_LOG +#define TU_LOG(n, ...) +#define TU_LOG_MEM(n, ...) +#define TU_LOG_VAR(n, ...) +#define TU_LOG_INT(n, ...) +#define TU_LOG_HEX(n, ...) +#define TU_LOG_LOCATION() +#define TU_LOG_FAILED() +#endif + +// TODO replace all TU_LOGn with TU_LOG(n) #ifndef TU_LOG1 #define TU_LOG1(...) #define TU_LOG1_MEM(...) @@ -395,5 +402,3 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3 #endif #endif /* _TUSB_COMMON_H_ */ - -/** @} */