Fix HTTPUpdate flash size check and add SPIFFS size check (#2161)

* Fix error in PR #2048: if ::available() is called before ::connect() _rxBuffer is not initialised

* Fixed flash size check and added SPIFFS size check

* Rewriting ESP.getFreeSketchSpace(), moving code from HTTPUpdate.cpp
This commit is contained in:
Jeroen88
2018-12-06 20:39:52 +01:00
committed by Me No Dev
parent bb7dea1566
commit 884e417a49
3 changed files with 29 additions and 8 deletions

View File

@ -169,7 +169,12 @@ uint32_t EspClass::getSketchSize () {
}
uint32_t EspClass::getFreeSketchSpace () {
return sketchSize(SKETCH_SIZE_FREE);
const esp_partition_t* _partition = esp_ota_get_next_update_partition(NULL);
if(!_partition){
return 0;
}
return _partition->size;
}
uint8_t EspClass::getChipRevision(void)