aboutsummaryrefslogtreecommitdiff
path: root/src/flash/stellaris.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/flash/stellaris.c')
-rw-r--r--src/flash/stellaris.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c
index cc85cafb..c4bc4dce 100644
--- a/src/flash/stellaris.c
+++ b/src/flash/stellaris.c
@@ -1007,15 +1007,20 @@ int stellaris_handle_mass_erase_command(struct command_context_s *cmd_ctx, char
return ERROR_OK;
}
- stellaris_mass_erase(bank);
-
- /* set all sectors as erased */
- for (i = 0; i < bank->num_sectors; i++)
+ if (stellaris_mass_erase(bank) == ERROR_OK)
{
- bank->sectors[i].is_erased = 1;
+ /* set all sectors as erased */
+ for (i = 0; i < bank->num_sectors; i++)
+ {
+ bank->sectors[i].is_erased = 1;
+ }
+
+ command_print(cmd_ctx, "stellaris mass erase complete");
+ }
+ else
+ {
+ command_print(cmd_ctx, "stellaris mass erase failed");
}
-
- command_print(cmd_ctx, "stellaris mass erase complete");
return ERROR_OK;
}