Don't try to set extended device programming parameters if they
haven't been specified in the config file for the part. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk@250 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
3d7ffa8e5c
commit
e7af3cdf7d
|
@ -633,29 +633,38 @@ static int stk500_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n_extparms) {
|
if (n_extparms) {
|
||||||
buf[0] = n_extparms+1;
|
if ((p->pagel == 0) || (p->bs2 == 0)) {
|
||||||
/*
|
fprintf(stderr,
|
||||||
* m is currently pointing to eeprom memory if the part has it
|
"%s: please define PAGEL and BS2 signals in the configuration "
|
||||||
*/
|
"file for part %s\n",
|
||||||
if (m)
|
progname, p->desc);
|
||||||
buf[1] = m->page_size;
|
|
||||||
else
|
|
||||||
buf[1] = 0;
|
|
||||||
|
|
||||||
buf[2] = p->pagel;
|
|
||||||
buf[3] = p->bs2;
|
|
||||||
|
|
||||||
if (n_extparms == 4) {
|
|
||||||
if (p->reset_disposition == RESET_DEDICATED)
|
|
||||||
buf[4] = 0;
|
|
||||||
else
|
|
||||||
buf[4] = 1;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
buf[0] = n_extparms+1;
|
||||||
|
|
||||||
rc = stk500_set_extended_parms(pgm, n_extparms+1, buf);
|
/*
|
||||||
if (rc) {
|
* m is currently pointing to eeprom memory if the part has it
|
||||||
fprintf(stderr, "%s: stk500_initialize(): failed\n", progname);
|
*/
|
||||||
exit(1);
|
if (m)
|
||||||
|
buf[1] = m->page_size;
|
||||||
|
else
|
||||||
|
buf[1] = 0;
|
||||||
|
|
||||||
|
buf[2] = p->pagel;
|
||||||
|
buf[3] = p->bs2;
|
||||||
|
|
||||||
|
if (n_extparms == 4) {
|
||||||
|
if (p->reset_disposition == RESET_DEDICATED)
|
||||||
|
buf[4] = 0;
|
||||||
|
else
|
||||||
|
buf[4] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = stk500_set_extended_parms(pgm, n_extparms+1, buf);
|
||||||
|
if (rc) {
|
||||||
|
fprintf(stderr, "%s: stk500_initialize(): failed\n", progname);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue