mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-28 06:55:27 +00:00
Warn if a part shares multiple programming modes with a programmer
This commit is contained in:
15
src/main.c
15
src/main.c
@@ -138,10 +138,6 @@ static void usage(void)
|
||||
static char *via_prog_modes(int pm) {
|
||||
static char type[1024];
|
||||
|
||||
// Suppress PM_JTAGmkI if also PM_JTAG is given
|
||||
if((pm & PM_JTAG) && (pm & PM_JTAGmkI))
|
||||
pm &= ~PM_JTAGmkI;
|
||||
|
||||
strcpy(type, "?");
|
||||
if(pm & PM_SPM)
|
||||
strcat(type, ", bootloader");
|
||||
@@ -867,6 +863,17 @@ int main(int argc, char * argv [])
|
||||
exit(0);
|
||||
}
|
||||
|
||||
for(LNODEID ln1 = lfirst(part_list); ln1; ln1 = lnext(ln1)) {
|
||||
AVRPART *p = ldata(ln1);
|
||||
for(LNODEID ln2 = lfirst(programmers); ln2; ln2 = lnext(ln2)) {
|
||||
PROGRAMMER *pgm = ldata(ln2);
|
||||
int pm = pgm->prog_modes & p->prog_modes;
|
||||
if(pm & (pm-1))
|
||||
avrdude_message(MSG_INFO, "%s warning: %s and %s share multiple modes (%s)\n",
|
||||
progname, pgm->id? ldata(lfirst(pgm->id)): "???", p->desc, via_prog_modes(pm));
|
||||
}
|
||||
}
|
||||
|
||||
avrdude_message(MSG_NOTICE, "\n");
|
||||
|
||||
if (partdesc) {
|
||||
|
Reference in New Issue
Block a user