Skip to content

Commit

Permalink
Fix faulty end condition for OTA
Browse files Browse the repository at this point in the history
  • Loading branch information
Johboh committed Dec 29, 2023
1 parent 33c5f51 commit 64bdcc2
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In your existing `idf_component.yml` or in a new `idf_component.yml` next to you
```
dependencies:
johboh/EspNowNetwork:
version: ">=0.5.0"
version: ">=0.5.1"
```

### Examples
Expand Down
2 changes: 1 addition & 1 deletion examples/espidf/host/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies:
johboh/EspNowNetwork:
#version: ">=0.5.0"
#version: ">=0.5.1"
# Remove path and enable version to use EspNowNetwork from repository
path: ../../../../
2 changes: 1 addition & 1 deletion examples/espidf/node/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies:
johboh/EspNowNetwork:
#version: ">=0.5.0"
#version: ">=0.5.1"
# Remove path and enable version to use EspNowNetwork from repository
path: ../../../../
2 changes: 1 addition & 1 deletion idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "0.5.0"
version: "0.5.1"
description: Library for setting up a network of ESP NOW nodes
url: https://github.com/Johboh/EspNowNetwork
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"name": "Johan Böhlin"
},
"version": "0.5.0",
"version": "0.5.1",
"license": "MIT",
"repository":
{
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EspNowNetwork
version=0.5.0
version=0.5.1
author=Johan Böhlin <[email protected]>
maintainer=Johan Böhlin <[email protected]>
sentence=Library for setting up a network of ESP NOW nodes
Expand Down
6 changes: 3 additions & 3 deletions src/impl/EspNowOta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,11 @@ bool EspNowOta::writeStreamToPartition(const esp_partition_t *partition, esp_htt
}

md5.add((uint8_t *)buffer, (uint16_t)bytes_filled);
bytes_read += bytes_filled;

// If this is the end, finish up.
if (bytes_filled != SPI_FLASH_SEC_SIZE) {
log("This is the end", ESP_LOG_INFO);
if (bytes_read == content_length) {
log("End of stream, writing data to partition", ESP_LOG_INFO);

if (!md5hash.empty()) {
md5.calculate();
Expand Down Expand Up @@ -326,7 +327,6 @@ bool EspNowOta::writeStreamToPartition(const esp_partition_t *partition, esp_htt
}
}

bytes_read += bytes_filled;
vTaskDelay(0); // Yield/reschedule
}

Expand Down

0 comments on commit 64bdcc2

Please sign in to comment.