 #include <avr/sleep.h>
 
 // pin definitions
-#define SCK         14  // PC0 - AIO1 - serial clock to target avr
-#define MISO        4   // PD4 - DIO1 - input from target avr
-#define MOSI        17  // PC3 - AIO4 - output to target avr
+#define PIN_SCK     14  // PC0 - AIO1 - serial clock to target avr
+#define PIN_MISO    4   // PD4 - DIO1 - input from target avr
+#define PIN_MOSI    17  // PC3 - AIO4 - output to target avr
 #define RESET       7   // PD7 - DIO4 - reset pin of the target avr
 #define DONE_LED    9   // B1 - blue LED on JN USB, blinks on start and when ok
 

static byte XferByte(byte v) {
    byte result = 0;
    for (byte i = 0; i < 8; ++i) {
        digitalWrite(MOSI, v & 0x80);
        digitalWrite(SCK, 0); // slow pulse, max 60KHz
        digitalWrite(SCK, 1);
        v <<= 1;
        result = (result << 1) | digitalRead(MISO);
    }
    return result;
}

    Serial.println("\n[isp_repair2]");
    blink();

    digitalWrite(PIN_SCK, 1);
    digitalWrite(PIN_MOSI, 1);
    digitalWrite(RESET, 1);
  
    pinMode(PIN_SCK, OUTPUT);
    pinMode(PIN_MOSI, OUTPUT);
    pinMode(RESET, OUTPUT);
  
    byte config = readConfig();
