Emulate chip erase in terminal when pgm->chip_erase() soft fails

This commit is contained in:
Stefan Rueger
2022-11-19 23:09:18 +00:00
parent d65a9a3cee
commit ee25a62df6
3 changed files with 45 additions and 4 deletions

View File

@@ -1395,7 +1395,10 @@ int main(int argc, char * argv [])
} else {
pmsg_info("erasing chip\n");
exitrc = avr_chip_erase(pgm, p);
if(exitrc)
if(exitrc == LIBAVRDUDE_SOFTFAIL) {
imsg_info("delaying chip erase until first -U upload to flash\n");
exitrc = 1;
} else if(exitrc)
goto main_exit;
}
}