     Log.print(" FAILED - got 0x");
     Log.println(b, HEX);
 
+    controlPins(false, false);
     while (true) { // halt, blinking rapidly
         toggleLed();
         delay(100);


    uint8_t b = 0;
    do {
        Log.print(".");
        Target.write(0x7F);
        b = getReply();

static void toggleLed () {
#ifdef LED_PIN
    pinMode(LED_PIN, OUTPUT);
    digitalWrite(LED_PIN, !digitalRead(LED_PIN));
#endif
}

// adjust the control pins to reset the target and get it into ISP mode
static void controlPins (bool isp, bool reset) {
#ifdef ISP_PIN
    pinMode(ISP_PIN, OUTPUT);
    digitalWrite(ISP_PIN, !isp);
#endif
#ifdef RESET_PIN
    pinMode(RESET_PIN, OUTPUT);
    digitalWrite(RESET_PIN, !reset);
#endif
}

