mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-14 01:44:58 +00:00
Replace internal knowledge in jtag3.c by a public API
In certain situations (CRC failure, device locked), that JTAG3 read functions need to return an indication to the caller that it is OK to proceed, and allow erasing the device anyway. Historically, the JTAG3 code passed the respective protocol errors directly (and unexplained) up to the caller, leaving the decision to the caller how to handle the situation. Replace that by a more common return value API. New code should prefer this API instead of any hardcoded return values.
This commit is contained in:
@@ -1116,9 +1116,8 @@ int main(int argc, char * argv [])
|
||||
usleep(waittime);
|
||||
if (init_ok) {
|
||||
rc = avr_signature(pgm, p);
|
||||
if (rc != 0) {
|
||||
// -68 == -(0x44) == -(RSP3_FAIL_OCD_LOCKED)
|
||||
if ((rc == -68) && (p->flags & AVRPART_HAS_UPDI) && (attempt < 1)) {
|
||||
if (rc != LIBAVRDUDE_SUCCESS) {
|
||||
if ((rc == LIBAVRDUDE_SOFTFAIL) && (p->flags & AVRPART_HAS_UPDI) && (attempt < 1)) {
|
||||
attempt++;
|
||||
if (pgm->read_sib) {
|
||||
// Read SIB and compare FamilyID
|
||||
|
||||
Reference in New Issue
Block a user