 
       static int bitbang_serial_have_star = 0;
       if (bitbang_serial_have_star) {
+        bitbang_serial_have_star = 0;
         // Byte is a flash bank select command
         select_flash_bank(c);
-        bitbang_serial_have_star = 0;
+        // Now reset the machine
+        digitalWrite(ndrive_arc_RESET_PIN, LOW);
+        delay(100);
+        digitalWrite(ndrive_arc_RESET_PIN, HIGH);
       } else if (c == '*') {
         bitbang_serial_have_star = 1;
       }

  // TODO detect v1 or v2 board by attempting to pull rom_5V_buffered up/down.
  // On a v1 board this is NC so we'll be able to pull it.  On v2 it'll remain
  // driven.
  pinMode(rom_5V_buffered_PIN, INPUT);
  pinMode(arc_RESET_buffered_PIN, INPUT_PULLUP);

  // On v2 boards we want to leave RESET and POR undriven by default

  }
}

// last known value on /RESET
int stable_reset_value = HIGH;
// when reset transitioned into the new state (allowing dead time for debouncing)
long stable_reset_transition_at = 0;
// how long to ignore reset transitions after one is registered
#define RESET_DEBOUNCE_DELAY 50
// double click counter
int clicks_seen = 0;
// when the first click was registered
long first_click_timestamp = 0;
// how long you have to double click reset
#define DOUBLE_CLICK_WINDOW 1000
// double click detected and not yet handled
bool double_click_detected = false;

// valid transition spotted on /RESET
static void reset_changed() {
  // if we see two clicks within DOUBLE_CLICK_WINDOW ms, reset into the bootloader
  if (!stable_reset_value) {
    long now = millis();
    // reset click counter and timestamp if we haven't seen a click for a while
    if (now - first_click_timestamp > DOUBLE_CLICK_WINDOW) {
      first_click_timestamp = now;
      clicks_seen = 0;
    }
    ++ clicks_seen;
    // detect double click
    if (now - first_click_timestamp < DOUBLE_CLICK_WINDOW && clicks_seen == 2) {
      // double click detected!
      double_click_detected = true;
    }
  }
}

void loop() {

  // monitor RESET line for double clicks (which tells us to reset/POR into the bootloader)
  int current_reset_value = digitalRead(arc_RESET_buffered_PIN);
  if (current_reset_value != stable_reset_value) {
    long now = millis();
    if (now - stable_reset_transition_at > RESET_DEBOUNCE_DELAY) {
      stable_reset_value = current_reset_value;
      stable_reset_transition_at = now;
      if (!stable_reset_value) {
        Serial.println("RESET active");
      } else {
        Serial.println("RESET inactive");
      }
      reset_changed();
    }
  }

  if (double_click_detected) {
    Serial.println("Double click detected!  Selecting bootloader.");
    double_click_detected = false;
    select_flash_bank(SELECT_BOOTLOADER);
  }

  // Switch to serial mode if we're in SPI mode.  This will do nothing
  // if we're already in serial mode.
