Skip to content

Commit

Permalink
Remove ESP.checkFlashCRC() from upgrade path
Browse files Browse the repository at this point in the history
  • Loading branch information
dkerr64 authored and jgstroud committed May 2, 2024
1 parent 33e227c commit 2839c7f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,11 +986,13 @@ void handle_update()
// Error logged in _setUpdaterError
server.send(400, F("text/plain"), _updaterError);
}
#ifdef CRC_CHECK
else if (!ESP.checkFlashCRC())
{
// CRC error
server.send(400, F("text/plain"), "Flash CRC check failed. Update aborted");
}
#endif
else
{
RINFO("Upload complete, received firmware MD5: %s", Update.md5String().c_str());
Expand Down Expand Up @@ -1079,8 +1081,10 @@ void handle_firmware_upload()
else if (_authenticatedUpdate && upload.status == UPLOAD_FILE_END && !_updaterError.length())
{
Serial.printf("\n"); // newline after last of the dot dot dots
#ifdef CRC_CHECK
if (ESP.checkFlashCRC())
{
#endif
if (Update.end(true))
{ // true to set the size to the current progress
RINFO("Update Success, size: %zu, Rebooting...", upload.totalSize);
Expand All @@ -1089,12 +1093,14 @@ void handle_firmware_upload()
{
_setUpdaterError();
}
#ifdef CRC_CHECK
}
else
{
Update.end();
RERROR("Flash CRC check failed. Update aborted");
}
#endif
}
else if (_authenticatedUpdate && upload.status == UPLOAD_FILE_ABORTED)
{
Expand Down

0 comments on commit 2839c7f

Please sign in to comment.