Skip to content

Commit

Permalink
dfuse: Return error code to main after unprotect or mass erase
Browse files Browse the repository at this point in the history
Signed-off-by: Tormod Volden <[email protected]>
  • Loading branch information
tormodvolden committed Nov 22, 2020
1 parent 6e320f8 commit 696b596
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dfuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,17 +690,17 @@ int dfuse_do_dnload(struct dfu_if *dif, int xfer_size, struct dfu_file *file,
"will erase the flash memory"
"and can only be used with force\n");
}
dfuse_special_command(dif, 0, READ_UNPROTECT);
ret = dfuse_special_command(dif, 0, READ_UNPROTECT);
printf("Device disconnects, erases flash and resets now\n");
exit(EX_OK);
return ret;
}
if (dfuse_mass_erase) {
if (!dfuse_force) {
errx(EX_USAGE, "The mass erase command "
"can only be used with force");
}
printf("Performing mass erase, this can take a moment\n");
dfuse_special_command(dif, 0, MASS_ERASE);
ret = dfuse_special_command(dif, 0, MASS_ERASE);
}
if (!file->name) {
printf("DfuSe command mode\n");
Expand Down

0 comments on commit 696b596

Please sign in to comment.