mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-06-30 04:21:00 +02:00
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:
@ -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)
|
||||
|
Reference in New Issue
Block a user