Skip to content

Commit d968c7a

Browse files
Randall Bohn (Huckle)Peter Van Hoyweghen
Randall Bohn (Huckle)
authored and
Peter Van Hoyweghen
committed
Don't start_pmode if we're already in pmode.
1 parent a2a06f5 commit d968c7a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build/shared/examples/11.ArduinoISP/ArduinoISP/ArduinoISP.ino

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
void pulse(int pin, int times);
6767

6868
void setup() {
69-
Serial.begin(19200);
69+
Serial.begin(9600);
7070
pinMode(LED_PMODE, OUTPUT);
7171
pulse(LED_PMODE, 2);
7272
pinMode(LED_ERR, OUTPUT);
@@ -510,9 +510,13 @@ int avrisp() {
510510
fill(5);
511511
empty_reply();
512512
break;
513-
514513
case 'P':
515-
start_pmode();
514+
if (pmode) {
515+
pulse(LED_ERR, 3);
516+
}
517+
else {
518+
start_pmode();
519+
}
516520
empty_reply();
517521
break;
518522
case 'U': // set address (word)

0 commit comments

Comments
 (0)