samples: flash_shell: print 16 bytes of flash

On large memory areas printing 8 bytes/line is not enough.
Increased printing 16 bytes per line.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
This commit is contained in:
Andrei Gansari 2020-07-03 17:35:47 +03:00 committed by Anas Nashif
parent 19975af460
commit 87eeb64370

View file

@ -110,11 +110,20 @@ static void dump_buffer(const struct shell *shell, uint8_t *buf, size_t size)
bool newline = false;
uint8_t *p = buf;
while (size >= 8) {
while (size >= 16) {
PR_SHELL(shell, "%02x %02x %02x %02x | %02x %02x %02x %02x |" \
"%02x %02x %02x %02x | %02x %02x %02x %02x\n",
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7],
p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]);
p += 16;
size -= 16;
}
if (size >= 8) {
PR_SHELL(shell, "%02x %02x %02x %02x | %02x %02x %02x %02x\n",
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]);
p += 8;
size -= 8;
newline = true;
}
if (size > 4) {
PR_SHELL(shell, "%02x %02x %02x %02x | ",