From 44a15afcf833761c5dcd38b4b3cdf4bf8a27d8e0 Mon Sep 17 00:00:00 2001 From: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:15:07 -0300 Subject: [PATCH] Fix commits --- cores/esp32/Esp.cpp | 10 ++++++---- libraries/Update/src/Updater.cpp | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cores/esp32/Esp.cpp b/cores/esp32/Esp.cpp index 4b7919e4dde..925a67dfbad 100644 --- a/cores/esp32/Esp.cpp +++ b/cores/esp32/Esp.cpp @@ -60,7 +60,7 @@ extern "C" { #elif CONFIG_IDF_TARGET_ESP32H2 #include "esp32h2/rom/spi_flash.h" #define ESP_FLASH_IMAGE_BASE 0x0000 // Esp32h2 is located at 0x0000 -#else +#else #error Target CONFIG_IDF_TARGET is not supported #endif #else // ESP32 Before IDF 4.0 @@ -249,7 +249,9 @@ String EspClass::getSketchMD5() lengthLeft -= readBytes; offset += readBytes; + #if CONFIG_FREERTOS_UNICORE delay(1); // Fix solo WDT + #endif } free(pb); md5.calculate(); @@ -525,17 +527,17 @@ bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size) return esp_flash_read(esp_flash_default_chip, (void*) data, offset, size) == ESP_OK; } -bool EspClass::partitionEraseRange(const esp_partition_t *partition, uint32_t offset, size_t size) +bool EspClass::partitionEraseRange(const esp_partition_t *partition, uint32_t offset, size_t size) { return esp_partition_erase_range(partition, offset, size) == ESP_OK; } -bool EspClass::partitionWrite(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size) +bool EspClass::partitionWrite(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size) { return esp_partition_write(partition, offset, data, size) == ESP_OK; } -bool EspClass::partitionRead(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size) +bool EspClass::partitionRead(const esp_partition_t *partition, uint32_t offset, uint32_t *data, size_t size) { return esp_partition_read(partition, offset, data, size) == ESP_OK; } diff --git a/libraries/Update/src/Updater.cpp b/libraries/Update/src/Updater.cpp index 61a89c59120..9980558dbba 100644 --- a/libraries/Update/src/Updater.cpp +++ b/libraries/Update/src/Updater.cpp @@ -368,7 +368,7 @@ size_t UpdateClass::writeStream(Stream &data) { bytesToRead = remaining(); } - /* + /* Init read&timeout counters and try to read, if read failed, increase counter, wait 100ms and try to read again. If counter > 300 (30 sec), give up/abort */ @@ -394,7 +394,9 @@ size_t UpdateClass::writeStream(Stream &data) { return written; written += toRead; + #if CONFIG_FREERTOS_UNICORE delay(1); // Fix solo WDT + #endif } return written; }