Skip to content

Commit 72e30b8

Browse files
committed
Fix ESP32-Solo WDT on HTTP OTA update
1 parent ab73583 commit 72e30b8

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

cores/esp32/Esp.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern "C" {
4242
#elif CONFIG_IDF_TARGET_ESP32C3
4343
#include "esp32c3/rom/spi_flash.h"
4444
#define ESP_FLASH_IMAGE_BASE 0x0000 // Esp32c3 is located at 0x0000
45-
#else
45+
#else
4646
#error Target CONFIG_IDF_TARGET is not supported
4747
#endif
4848
#else // ESP32 Before IDF 4.0
@@ -187,7 +187,7 @@ static uint32_t sketchSize(sketchSize_t response) {
187187
return data.image_len;
188188
}
189189
}
190-
190+
191191
uint32_t EspClass::getSketchSize () {
192192
return sketchSize(SKETCH_SIZE_TOTAL);
193193
}
@@ -226,6 +226,8 @@ String EspClass::getSketchMD5()
226226
md5.add(buf.get(), readBytes);
227227
lengthLeft -= readBytes;
228228
offset += readBytes;
229+
230+
delay(1); // Fix solo WDT
229231
}
230232
md5.calculate();
231233
result = md5.toString();
@@ -376,17 +378,17 @@ bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size)
376378
return spi_flash_read(offset, (uint32_t*) data, size) == ESP_OK;
377379
}
378380

379-
bool EspClass::partitionEraseRange(const esp_partition_t *partition, uint32_t offset, size_t size)
381+
bool EspClass::partitionEraseRange(const esp_partition_t *partition, uint32_t offset, size_t size)
380382
{
381383
return esp_partition_erase_range(partition, offset, size) == ESP_OK;
382384
}
383385

384-
bool EspClass::partitionWrite(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
386+
bool EspClass::partitionWrite(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
385387
{
386388
return esp_partition_write(partition, offset, data, size) == ESP_OK;
387389
}
388390

389-
bool EspClass::partitionRead(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
391+
bool EspClass::partitionRead(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size)
390392
{
391393
return esp_partition_read(partition, offset, data, size) == ESP_OK;
392394
}

libraries/HTTPUpdate/src/HTTPUpdate.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ HTTPUpdateResult HTTPUpdate::handleUpdate(HTTPClient& http, const String& curren
199199
if(sketchMD5.length() != 0) {
200200
http.addHeader("x-ESP32-sketch-md5", sketchMD5);
201201
}
202-
203-
delay(1); // Fix solo WDT
204-
205202
// Add also a SHA256
206203
String sketchSHA256 = getSketchSHA256();
207204
if(sketchSHA256.length() != 0) {

0 commit comments

Comments
 (0)