From: Uwe Bonnes Date: Sat, 21 May 2016 13:50:49 +0000 (+0200) Subject: flash/nor/tcl.c: Less verbose output of flash erase_check. X-Git-Tag: v0.10.0-rc1~127 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ae3e9aaba941d7cda9de8b99dccda19ebb66e2ef;p=openocd flash/nor/tcl.c: Less verbose output of flash erase_check. Only report non-erased or unknown sectors or if bank is fully erased. Change-Id: I94f0bc2a0d6529d1ea5f66b284cefd6a2c61fe39 Signed-off-by: Uwe Bonnes Reviewed-on: http://openocd.zylin.com/3501 Tested-by: jenkins Reviewed-by: Andreas Fritiofson Reviewed-by: Andreas Färber --- diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index 77f19de1..9628684e 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -160,6 +160,7 @@ COMMAND_HANDLER(handle_flash_probe_command) COMMAND_HANDLER(handle_flash_erase_check_command) { + bool blank = true; if (CMD_ARGC != 1) return ERROR_COMMAND_SYNTAX_ERROR; @@ -185,10 +186,11 @@ COMMAND_HANDLER(handle_flash_erase_check_command) if (p->sectors[j].is_erased == 0) erase_state = "not erased"; else if (p->sectors[j].is_erased == 1) - erase_state = "erased"; + continue; else erase_state = "erase state unknown"; + blank = false; command_print(CMD_CTX, "\t#%3i: 0x%8.8" PRIx32 " (0x%" PRIx32 " %" PRIi32 "kB) %s", j, @@ -198,6 +200,8 @@ COMMAND_HANDLER(handle_flash_erase_check_command) erase_state); } + if (blank) + command_print(CMD_CTX, "\tBank is erased"); return retval; }