Better restart

Add 30s progress to ensure restart is finished
Hide restart boot loader message redirecting serial output
This commit is contained in:
luc 2015-09-16 17:46:36 +08:00
parent 283270f660
commit d663f62605
2 changed files with 5 additions and 2 deletions

View File

@ -90,7 +90,6 @@ void setup() {
}
//setup serial
Serial.begin(baud_rate);
//Serial1.setDebugOutput(true);
//setup wifi according settings
wifi_config.Setup();
delay(1000);
@ -186,6 +185,10 @@ uint8_t i,data;
}
if (web_interface->restartmodule)
{
Serial.flush();
delay(500);
Serial.swap();
delay(100);
ESP.restart();
while (1){delay(1);};
}

View File

@ -349,7 +349,7 @@ const char POLLING_NAME[]PROGMEM ="Refresh printer status every :";
const char POLLING_ID[]PROGMEM ="POLLING";
const char TEXT_HTML[]PROGMEM ="text/html";
const char RESTARTCMD [] PROGMEM ="<script>setTimeout(function(){window.location.href='/RESTART'},3000);</script>";
const char RESTARTINGMSG [] PROGMEM = "<CENTER>Restarting, please wait.... </CENTER><script>setTimeout(function(){window.location.href='/'},20000);</script>";
const char RESTARTINGMSG [] PROGMEM = "<HTML>\n<BODY>\n<CENTER>Restarting, please wait.... \n<BR>\n<PROGRESS name='prg' id='prg'>\n</CENTER>\n<script>\nvar i = 0; var x = document.getElementById(\"prg\"); x.max=30; function refreshbar(){}setInterval(function(){i=i+1; var x = document.getElementById(\"prg\"); x.value=i; if (i>30) {window.location.href='/';}},1000);</script>\n</BODY>\n</HTML>\n";