diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c0f31b7..7e6474f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,7 +7,7 @@ on: env: ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS: "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json" ARDUINO_CLI_VERSION: "0.x" - ARDUINO_ESP32_VERSION: "2.0.11" + ARDUINO_ESP32_VERSION: "2.0.12" ARDUINO_JSON_VERSION: "6.21.3" ESPTOOL_VERSION: "4.6" LITTLEFS_VERSION: "v2.5.1" diff --git a/GitOTA.cpp b/GitOTA.cpp index 6121464..8f0a287 100644 --- a/GitOTA.cpp +++ b/GitOTA.cpp @@ -444,6 +444,7 @@ int8_t GitUpdater::downloadFile() { delay(1); if(total >= len) { if(!Update.end()) { + Serial.println("Error downloading update..."); Update.printError(Serial); } else { @@ -453,9 +454,15 @@ int8_t GitUpdater::downloadFile() { } } } - Serial.printf("Update %s complete\n", this->currentFile); - free(buff); + if(len < total) { + Serial.println("Error downloading file"); + return -42; + + } + else + Serial.printf("Update %s complete\n", this->currentFile); + } else { // TODO: memory allocation error.