Skip to content

Commit

Permalink
Fix commits
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Jan 24, 2024
1 parent 15f5250 commit 44a15af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 6 additions & 4 deletions cores/esp32/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion libraries/Update/src/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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;
}
Expand Down

0 comments on commit 44a15af

Please sign in to comment.