diff --git a/esp3d/src/include/version.h b/esp3d/src/include/version.h index d16f088f..05760086 100644 --- a/esp3d/src/include/version.h +++ b/esp3d/src/include/version.h @@ -22,7 +22,7 @@ #define _VERSION_ESP3D_H //version and sources location -#define FW_VERSION "3.0.0.a57" +#define FW_VERSION "3.0.0.a58" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0" #endif //_VERSION_ESP3D_H diff --git a/esp3d/src/modules/filesystem/esp_filesystem.cpp b/esp3d/src/modules/filesystem/esp_filesystem.cpp index 04ece8d7..c65e92dc 100644 --- a/esp3d/src/modules/filesystem/esp_filesystem.cpp +++ b/esp3d/src/modules/filesystem/esp_filesystem.cpp @@ -65,13 +65,15 @@ size_t ESP_FileSystem::max_update_size() #endif //ARDUINO_ARCH_ESP8266 #if defined (ARDUINO_ARCH_ESP32) //Is OTA available ? - if (esp_ota_get_running_partition()) { - const esp_partition_t* partition = esp_ota_get_next_update_partition(NULL); + const esp_partition_t* mainpartition = esp_ota_get_running_partition(); + if (mainpartition) { + const esp_partition_t* partition = esp_ota_get_next_update_partition(mainpartition); if (partition) { - flashsize = partition->size; + const esp_partition_t* partition2 = esp_ota_get_next_update_partition(partition); + if (partition2 && (partition->address!=partition2->address)) { + flashsize = partition2->size; + } } - } else { - flashsize = 0; } #endif //ARDUINO_ARCH_ESP32 return flashsize;