Skip to content

Commit cf13508

Browse files
Randall Bohn (Huckle)
authored andcommitted
Set error if GET_SIGN_ON not followed by CRC_EOP
1 parent b91f67b commit cf13508

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

build/shared/examples/ArduinoISP/ArduinoISP.ino

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ int avrisp() {
478478
Serial.print("AVR ISP");
479479
Serial.print((char) STK_OK);
480480
}
481+
else {
482+
error++;
483+
Serial.print((char) STK_NOSYNC);
484+
}
481485
break;
482486
case 'A':
483487
get_version(getch());
@@ -537,14 +541,14 @@ int avrisp() {
537541
read_signature();
538542
break;
539543

540-
// expecting a command, not CRC_EOP
541-
// this is how we can get back in sync
544+
// expecting a command, not CRC_EOP
545+
// this is how we can get back in sync
542546
case CRC_EOP:
543547
error++;
544548
Serial.print((char) STK_NOSYNC);
545549
break;
546550

547-
// anything else we will return STK_UNKNOWN
551+
// anything else we will return STK_UNKNOWN
548552
default:
549553
error++;
550554
if (CRC_EOP == getch())
@@ -554,5 +558,3 @@ int avrisp() {
554558
}
555559
}
556560

557-
558-

0 commit comments

Comments
 (0)