mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-05 00:40:44 +08:00
Fix loop of unique ota partition wrongly detected as second partition
next update partition should give null if no next app partition, but actually it loop first partition, so compare both addresses to be sure there are 2 distinct partitions
This commit is contained in:
parent
766eb4efbd
commit
e9b742434f
@ -22,7 +22,7 @@
|
|||||||
#define _VERSION_ESP3D_H
|
#define _VERSION_ESP3D_H
|
||||||
|
|
||||||
//version and sources location
|
//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"
|
#define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0"
|
||||||
|
|
||||||
#endif //_VERSION_ESP3D_H
|
#endif //_VERSION_ESP3D_H
|
||||||
|
@ -65,13 +65,15 @@ size_t ESP_FileSystem::max_update_size()
|
|||||||
#endif //ARDUINO_ARCH_ESP8266
|
#endif //ARDUINO_ARCH_ESP8266
|
||||||
#if defined (ARDUINO_ARCH_ESP32)
|
#if defined (ARDUINO_ARCH_ESP32)
|
||||||
//Is OTA available ?
|
//Is OTA available ?
|
||||||
if (esp_ota_get_running_partition()) {
|
const esp_partition_t* mainpartition = esp_ota_get_running_partition();
|
||||||
const esp_partition_t* partition = esp_ota_get_next_update_partition(NULL);
|
if (mainpartition) {
|
||||||
|
const esp_partition_t* partition = esp_ota_get_next_update_partition(mainpartition);
|
||||||
if (partition) {
|
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
|
#endif //ARDUINO_ARCH_ESP32
|
||||||
return flashsize;
|
return flashsize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user