mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-13 17:34:56 +00:00
* update.c (parse_op): do not assume default memtype here
* main.c: after locating the part information, determine default memtype for all update options that didn't have a memtype specified; this is "application" for Xmega parts, and "flash" for everything else. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1086 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
24
main.c
24
main.c
@@ -859,6 +859,30 @@ int main(int argc, char * argv [])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now that we know which part we are going to program, locate any
|
||||
* -U options using the default memory region, and fill in the
|
||||
* device-dependent default region name, either "application" (for
|
||||
* Xmega devices), or "flash" (everything else).
|
||||
*/
|
||||
for (ln=lfirst(updates); ln; ln=lnext(ln)) {
|
||||
upd = ldata(ln);
|
||||
if (upd->memtype == NULL) {
|
||||
const char *mtype = (p->flags & AVRPART_HAS_PDI)? "application": "flash";
|
||||
if (verbose >= 2) {
|
||||
fprintf(stderr,
|
||||
"%s: defaulting memtype in -U %c:%s option to \"%s\"\n",
|
||||
progname,
|
||||
(upd->op == DEVICE_READ)? 'r': (upd->op == DEVICE_WRITE)? 'w': 'v',
|
||||
upd->filename, mtype);
|
||||
}
|
||||
if ((upd->memtype = strdup(mtype)) == NULL) {
|
||||
fprintf(stderr, "%s: out of memory\n", progname);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* open the programmer
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user