Update platform = espressif32

This commit is contained in:
fvanroie 2021-05-02 05:09:37 +02:00
parent 326c099c46
commit b4594a4eca
2 changed files with 4 additions and 3 deletions

View File

@ -90,7 +90,7 @@ src_filter = +<*> -<.git/> -<examples/> -<test/> -<tests/> -<stm32f4/> -<lv_font
; -- Platform specific build flags
[esp32]
framework = arduino
platform = espressif32
platform = espressif32@^3.10006.210326
board_upload.flash_size=4MB
board_upload.maximum_size = 4194304

View File

@ -900,14 +900,15 @@ void webHandleFirmwareUpload()
// WiFiUDP::stopAll();
int command = webServer.arg(F("cmd")).toInt();
size_t size;
size_t size = 0;
if(command == U_FLASH) {
size = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;
} else if(command == U_SPIFFS) {
size = UPDATE_SIZE_UNKNOWN;
}
// if(!Update.begin(UPDATE_SIZE_UNKNOWN)) { // start with max available size
if(!Update.begin(size, command, -1, 0U, "spiffs")) { // start with max available size
const char label[] = "spiffs";
if(!Update.begin(size, command, -1, 0U, (const char*)label)) { // start with max available size
webUpdatePrintError();
}
break;