From 67ac40b98d217dde82090bf10a0cf55af5d1c44b Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 1 Nov 2020 13:37:56 +0700 Subject: [PATCH] house keeping: make tu_print_mem format easier to compare with hex2dump --- examples/device/audio_test/src/tusb_config.h | 6 +++-- src/common/tusb_common.h | 2 +- src/tusb.c | 24 ++++++++++---------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/examples/device/audio_test/src/tusb_config.h b/examples/device/audio_test/src/tusb_config.h index 16f88a4d..5d94858e 100644 --- a/examples/device/audio_test/src/tusb_config.h +++ b/examples/device/audio_test/src/tusb_config.h @@ -47,6 +47,10 @@ extern "C" { #define CFG_TUSB_OS OPT_OS_NONE +#ifndef CFG_TUSB_DEBUG +#define CFG_TUSB_DEBUG 0 +#endif + // CFG_TUSB_DEBUG is defined by compiler in DEBUG build // #define CFG_TUSB_DEBUG 0 @@ -105,8 +109,6 @@ extern "C" { // Size of control request buffer #define CFG_TUD_AUDIO_CTRL_BUF_SIZE 64 -#define CFG_TUSB_DEBUG 0 - #ifdef __cplusplus } #endif diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index 15892fa3..f10be88a 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -213,7 +213,7 @@ static inline bool tu_bit_test (uint32_t value, uint8_t pos) { return (value // 2 : print out log #if CFG_TUSB_DEBUG -void tu_print_mem(void const *buf, uint16_t count, uint8_t indent); +void tu_print_mem(void const *buf, uint32_t count, uint8_t indent); #ifdef CFG_TUSB_DEBUG_PRINTF extern int CFG_TUSB_DEBUG_PRINTF(const char *format, ...); diff --git a/src/tusb.c b/src/tusb.c index 1bc134db..bed525b9 100644 --- a/src/tusb.c +++ b/src/tusb.c @@ -70,20 +70,24 @@ char const* const tusb_strerr[TUSB_ERROR_COUNT] = { ERROR_TABLE(ERROR_STRING) }; static void dump_str_line(uint8_t const* buf, uint16_t count) { + tu_printf(" |"); + // each line is 16 bytes for(uint16_t i=0; i