     Serial.println("timed out and failed to connect");
     Serial.println("rebooting...");
     //reset and try again, or maybe put it to deep sleep
-    ESP.reset();
+    reboot();
     //   we never get here.
   }
 

{
  Serial.println("Factory Reset");
  wfCfg.resetCfg(1);
  delay(1000);
  ESP.reset(); 
}

void setup()



#define BTN_PRESS_SHORT 50  // ms
#define BTN_PRESS_LONG 500 // ms

#define BTN_STATE_OFF   0
#define BTN_STATE_SHORT 1 // short press
