Warn if a part shares multiple programming modes with a programmer
This commit is contained in:
parent
0175ffd21f
commit
4c29edbc41
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) {
|
||||
|
|
Loading…
Reference in New Issue