 // setupEncoder will check if encoder position is retained in RAM after a crash
 // and return true if so
 bool setupEncoder() {
+  bool recovered = false;
+  
   if (EEPROM.read(EEPROM_REMEMBER_POSITION) == 1) {
     // check if encoder value can be recovered after crash
     if (encoder0Pos ^ encoder0ChecksumKey == encoder0Checksum) {

  // encoder pin on interrupt 0 (pin 2)
  attachInterrupt(0, doEncoderA, RISING);
  
  return false;
}

void setupMotorDriver(bool poweron) {

      if (encoder0Pos > 10 && encoder0Pos < 100000) {
        // yes! let's claim we're homed
        reboots++;
        recovered = true;
      }
    }
  }
