File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
hardware/esp8266com/esp8266/libraries/ESP8266WebServer/examples/WebUpdate Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,13 @@ void setup(void){
30
30
Serial.setDebugOutput (true );
31
31
WiFiUDP::stopAll ();
32
32
Serial.printf (" Update: %s\n " , upload.filename .c_str ());
33
- uint32_t maxSketchSpace = (( ESP.getFreeSketchSpace () + ESP. getSketchSize ()) / 2 ) & 0xFFFFF000 ;
33
+ uint32_t maxSketchSpace = (ESP.getFreeSketchSpace () - 0x1000 ) & 0xFFFFF000 ;
34
34
if (!Update.begin (maxSketchSpace)){// start with max available size
35
35
Update.printError (Serial);
36
- return ;
37
36
}
38
37
} else if (upload.status == UPLOAD_FILE_WRITE){
39
38
if (Update.write (upload.buf , upload.currentSize ) != upload.currentSize ){
40
39
Update.printError (Serial);
41
- return ;
42
40
}
43
41
} else if (upload.status == UPLOAD_FILE_END){
44
42
if (Update.end (true )){ // true to set the size to the current progress
@@ -59,7 +57,7 @@ void setup(void){
59
57
server.begin ();
60
58
MDNS.addService (" http" , " tcp" , 80 );
61
59
62
- Serial.println (" Ready! Open http:\/\ /%s.local in your browser\n " , host);
60
+ Serial.printf (" Ready! Open http:/ /%s.local in your browser\n " , host);
63
61
} else {
64
62
Serial.println (" WiFi Failed" );
65
63
}
You can’t perform that action at this time.
0 commit comments