From 11a360223be08b4003df0efe7c1b2d79d98ea7f9 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 1 Feb 2018 22:18:13 +0700 Subject: [PATCH] fix debug dump memory --- cores/nRF5/utility/debug.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cores/nRF5/utility/debug.cpp b/cores/nRF5/utility/debug.cpp index c228b9ca..18a5df53 100644 --- a/cores/nRF5/utility/debug.cpp +++ b/cores/nRF5/utility/debug.cpp @@ -234,6 +234,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs // fill up last row to 16 for printing ascii const uint16_t remain = count%16; + uint8_t nback = (remain ? remain : 16); if ( remain ) { @@ -245,7 +246,7 @@ void dbgDumpMemory(void const *buf, uint8_t size, uint16_t count, bool printOffs } cprintf(" | "); - dump_str_line(buf8-16, remain ? remain : 16); + dump_str_line(buf8-nback, nback); cprintf("\n"); cprintf("\n");