From c5091c599ab990a59425bbcae82759acb236e661 Mon Sep 17 00:00:00 2001 From: MCUdude Date: Sun, 25 Dec 2022 20:18:36 +0100 Subject: [PATCH] Explain what the various SUFFER bits do --- src/jtag3.c | 8 +++++++- src/stk500v2.c | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/jtag3.c b/src/jtag3.c index 6fb560a5..f0ec2fa4 100644 --- a/src/jtag3.c +++ b/src/jtag3.c @@ -1429,7 +1429,7 @@ static void jtag3_enable(PROGRAMMER *pgm, const AVRPART *p) { return; } -int jtag3_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) { +static int jtag3_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) { LNODEID ln; const char *extended_param; int rv = 0; @@ -1460,6 +1460,12 @@ int jtag3_parseextparms(const PROGRAMMER *pgm, const LISTID extparms) { continue; } + // SUFFER bits + // Bit 7 ARDUINO: Adds control of extra LEDs when set to 0 + // Bit 6..3: Reserved (masked out with 0x78 in the code below) + // Bit 2 EOF: Agressive power-down, sleep after 5 seconds if no USB enumeration when set to 0 + // Bit 1 LOWP: forces running at 1 MHz when bit set to 0 + // Bit 0 FUSE: Fuses are safe-masked when bit sent to 1 Fuses are unprotected when set to 0 else if (matches(extended_param, "suffer") ) { for(LNODEID ln=lfirst(pgm->id); ln; ln=lnext(ln)) { if (matches(ldata(ln), "xplainedmini")) { diff --git a/src/stk500v2.c b/src/stk500v2.c index c35bc598..5990e44a 100644 --- a/src/stk500v2.c +++ b/src/stk500v2.c @@ -1550,6 +1550,13 @@ static int stk500v2_jtag3_parseextparms(const PROGRAMMER *pgm, const LISTID extp for (ln = lfirst(extparms); ln; ln = lnext(ln)) { extended_param = ldata(ln); + + // SUFFER bits + // Bit 7 ARDUINO: Adds control of extra LEDs when set to 0 + // Bit 6..3: Reserved (masked out with 0x78 in the code below) + // Bit 2 EOF: Agressive power-down, sleep after 5 seconds if no USB enumeration when set to 0 + // Bit 1 LOWP: forces running at 1 MHz when bit set to 0 + // Bit 0 FUSE: Fuses are safe-masked when bit sent to 1 Fuses are unprotected when set to 0 if (strncmp(extended_param, "suffer", strlen("suffer")) == 0) { for (LNODEID ln=lfirst(pgm->id); ln; ln=lnext(ln)) { if (strncmp(ldata(ln), "xplainedmini", strlen("xplainedmini")) == 0) {