mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-23 09:36:24 +03:00
Check part-programmer compatibility early on
This commit is contained in:
13
src/main.c
13
src/main.c
@@ -1083,6 +1083,12 @@ int main(int argc, char * argv [])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if(!ovsigck && partdesc && (p = locate_part(part_list, partdesc)) && !(p->prog_modes & pgm->prog_modes)) {
|
||||
pmsg_error("programmer %s cannot program part %s as they\n", pgmid, p->desc);
|
||||
imsg_error("lack a common programming mode; use -F to override this check\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pgm->initpgm) {
|
||||
pgm->initpgm(pgm);
|
||||
} else {
|
||||
@@ -1198,13 +1204,6 @@ int main(int argc, char * argv [])
|
||||
goto main_exit;
|
||||
}
|
||||
|
||||
if(!ovsigck && !(p->prog_modes & pgm->prog_modes)) {
|
||||
pmsg_error("programmer %s cannot program part %s as they\n", pgmid, p->desc);
|
||||
imsg_error("lack a common programming mode; use -F to override this check\n");
|
||||
exitrc = 1;
|
||||
goto main_exit;
|
||||
}
|
||||
|
||||
if (exitspecs != NULL) {
|
||||
if (pgm->parseexitspecs == NULL) {
|
||||
pmsg_warning("-E option not supported by this programmer type\n");
|
||||
|
||||
Reference in New Issue
Block a user