mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-06-06 02:36:49 +08:00
Fix OTA update size not accurate on ESP32
Use proper function to get partition size instead of guessing doing wrong calculation
This commit is contained in:
parent
7bc15e1bd9
commit
6fc6df1577
@ -99,13 +99,13 @@
|
||||
//ESP_SPIFFS_FILESYSTEM 0
|
||||
//ESP_FAT_FILESYSTEM 1
|
||||
//ESP_LITTLEFS_FILESYSTEM 2 //Not Yet implemented
|
||||
#define FILESYSTEM_FEATURE ESP_SPIFFS_FILESYSTEM
|
||||
#define FILESYSTEM_FEATURE ESP_FAT_FILESYSTEM
|
||||
|
||||
//DIRECT_PIN_FEATURE: allow to access pin using ESP201 command
|
||||
#define DIRECT_PIN_FEATURE
|
||||
|
||||
//TIMESTAMP_FEATURE: set time system
|
||||
#define TIMESTAMP_FEATURE
|
||||
//#define TIMESTAMP_FEATURE
|
||||
|
||||
//FILESYSTEM_TIMESTAMP_FEATURE: allow to get last write time from FILESYSTEM files
|
||||
//#define FILESYSTEM_TIMESTAMP_FEATURE
|
||||
|
@ -22,7 +22,7 @@
|
||||
#define _VERSION_ESP3D_H
|
||||
|
||||
//version and sources location
|
||||
#define FW_VERSION "3.0.0.a10"
|
||||
#define FW_VERSION "3.0.0.a11"
|
||||
#define REPOSITORY "https://github.com/luc-github/ESP3D"
|
||||
|
||||
#endif //_VERSION_ESP3D_H
|
||||
|
@ -144,7 +144,10 @@ size_t ESP_FileSystem::max_update_size()
|
||||
#if defined (ARDUINO_ARCH_ESP32)
|
||||
//Is OTA available ?
|
||||
if (esp_ota_get_running_partition()) {
|
||||
flashsize = ESP.getFreeSketchSpace() + ESP.getSketchSize();
|
||||
const esp_partition_t* partition = esp_ota_get_next_update_partition(NULL);
|
||||
if (partition){
|
||||
flashsize = partition->size;
|
||||
}
|
||||
} else {
|
||||
flashsize = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user