Warn if a part shares multiple programming modes with a programmer

This commit is contained in:
Stefan Rueger 2022-09-21 12:10:24 +01:00
parent 0175ffd21f
commit 4c29edbc41
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
1 changed files with 11 additions and 4 deletions

View File

@ -138,10 +138,6 @@ static void usage(void)
static char *via_prog_modes(int pm) { static char *via_prog_modes(int pm) {
static char type[1024]; 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, "?"); strcpy(type, "?");
if(pm & PM_SPM) if(pm & PM_SPM)
strcat(type, ", bootloader"); strcat(type, ", bootloader");
@ -867,6 +863,17 @@ int main(int argc, char * argv [])
exit(0); 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"); avrdude_message(MSG_NOTICE, "\n");
if (partdesc) { if (partdesc) {