Remove processing -U ... heading for backup/restore/verify

This commit is contained in:
Stefan Rueger
2024-07-04 15:33:36 +01:00
parent 2e1b66fb34
commit 4f25cf8be6
3 changed files with 10 additions and 7 deletions

View File

@@ -1274,6 +1274,7 @@ enum updateflags {
UF_NOWRITE = 1,
UF_AUTO_ERASE = 2,
UF_VERIFY = 4,
UF_NOHEADING = 8,
};

View File

@@ -758,7 +758,7 @@ static int cmd_backup(const PROGRAMMER *pgm, const AVRPART *p, int argc, const c
};
pgm->flush_cache(pgm, p); // Flush cache before any device memory access
int ret = do_op(pgm, p, &upd, UF_AUTO_ERASE); // -U argv[1]:r:file
int ret = do_op(pgm, p, &upd, UF_AUTO_ERASE|UF_NOHEADING); // -U argv[1]:r:file
mmt_free(upd.filename);
mmt_free(upd.memstr);
@@ -802,7 +802,7 @@ static int cmd_restore(const PROGRAMMER *pgm, const AVRPART *p, int argc, const
};
pgm->flush_cache(pgm, p); // Flush cache before any device memory access
int ret = do_op(pgm, p, &upd, UF_AUTO_ERASE|UF_VERIFY); // -U argv[1]:w:file (no -V)
int ret = do_op(pgm, p, &upd, UF_AUTO_ERASE|UF_VERIFY|UF_NOHEADING); // -U argv[1]:w:file (no -V)
mmt_free(upd.filename);
mmt_free(upd.memstr);
pgm->reset_cache(pgm, p); // Reset cache after writing to memories
@@ -843,7 +843,7 @@ static int cmd_verify(const PROGRAMMER *pgm, const AVRPART *p, int argc, const c
};
pgm->flush_cache(pgm, p); // Flush cache before any device memory access
int ret = do_op(pgm, p, &upd, UF_AUTO_ERASE); // -V -U argv[1]:v:file
int ret = do_op(pgm, p, &upd, UF_AUTO_ERASE|UF_NOHEADING); // -V -U argv[1]:v:file
mmt_free(upd.filename);
mmt_free(upd.memstr);

View File

@@ -633,12 +633,14 @@ int do_op(const PROGRAMMER *pgm, const AVRPART *p, const UPDATE *upd, enum updat
AVRMEM *mem, **umemlist = NULL, *m;
Segment *seglist = NULL;
Filestats fs;
char *tofree;
const char *umstr = upd->memstr;
lmsg_info("\n"); // Ensure an empty line for visual separation of operations
pmsg_info("processing %s\n", tofree = update_str(upd));
mmt_free(tofree);
if(!(flags & UF_NOHEADING)) {
char *heading = update_str(upd);
lmsg_info("\n"); // Ensure an empty line for visual separation of operations
pmsg_info("processing %s\n", heading);
mmt_free(heading);
}
if(upd->cmdline) {
if(!str_eq(upd->cmdline, "interactive terminal"))