From 71bf4f72a9ac327e6821a8f0c4797c784ce35b6d Mon Sep 17 00:00:00 2001 From: Hans Date: Mon, 13 Nov 2023 03:30:30 +0100 Subject: [PATCH] Always print error if part and programmer doesn't have a common programming interface (#1563) * Harmonize WIN32 implementation of serial time-outs with Posix This is from @mariusgreuel in Issue #1249. https://github.com/avrdudes/avrdude/issues/1249 > The WIN32 time-out is specified as ReadTotalTimeoutConstant + buflen * ReadTotalTimeoutMultiplier, which makes it potentially much longer than the Posix one (i.e. at least double). ReadIntervalTimeout is also set to timeout, which essentially renders the interval timeout ineffective, so IMHO, we should explicitly disable that feature. * Update NEWS * Always print error if part and programmer doesn't have a common programming interface even though the user uses -F. It won't exit though. * Don't mention -F in error message if -F is already used --------- Co-authored-by: mcuee Co-authored-by: Stefan Rueger --- src/main.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 32268da3..aa55d3a3 100644 --- a/src/main.c +++ b/src/main.c @@ -1128,10 +1128,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(partdesc && (p = locate_part(part_list, partdesc)) && !(p->prog_modes & pgm->prog_modes)) { + pmsg_error("-c %s cannot program %s for lack of a common programming mode\n", pgmid, p->desc); + if(!ovsigck) { + imsg_error("use -F to override this check\n"); + exit(1); + } } if (pgm->initpgm) {