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");