From 73648578b0e796a6fcd21df53058cdafdbc8cb77 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 16 Jan 2018 14:59:12 +0700 Subject: [PATCH] fix debug issue --- cores/nRF5/utility/debug.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cores/nRF5/utility/debug.cpp b/cores/nRF5/utility/debug.cpp index 8617ca85..297768e3 100644 --- a/cores/nRF5/utility/debug.cpp +++ b/cores/nRF5/utility/debug.cpp @@ -183,9 +183,8 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs format[2] += 2*size; char offset_fmt[] = "%02lX: "; - - if ( count*size > UINT8_MAX ) format[2] *= 2; - if ( count*size > UINT16_MAX ) format[2] *= 2; + if ( count*size > UINT16_MAX ) offset_fmt[2] = '8'; + else if ( count*size > UINT8_MAX ) offset_fmt[2] = '4'; const uint8_t item_per_line = 16 / size; @@ -218,6 +217,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs cprintf("\n"); } + #if CFG_DEBUG #include "ble.h" @@ -396,7 +396,6 @@ const char* dbg_err_str(uint32_t err_id) return str; } -} - #endif +}