diff --git a/esphome/components/ota/ota_backend_esp8266.cpp b/esphome/components/ota/ota_backend_esp8266.cpp index fe829ab0629..51a3f99da86 100644 --- a/esphome/components/ota/ota_backend_esp8266.cpp +++ b/esphome/components/ota/ota_backend_esp8266.cpp @@ -223,7 +223,7 @@ bool ESP8266OTABackend::write_buffer_() { } bool ESP8266OTABackend::write_buffer_final_() { - // Same as write_buffer_() but without MD5 update (for final padded write) + // Similar to write_buffer_(), but without flash mode patching or MD5 update (for final padded write) if (this->buffer_len_ == 0) { return true; } @@ -334,9 +334,9 @@ bool ESP8266OTABackend::verify_end_() { return false; } -// Check if new firmware's flash size fits (only when auto-detection is disabled) -// With FLASH_MAP_SUPPORT (modern cores), flash size is auto-detected from chip #if !FLASH_MAP_SUPPORT + // Check if new firmware's flash size fits (only when auto-detection is disabled) + // With FLASH_MAP_SUPPORT (modern cores), flash size is auto-detected from chip // NOLINTNEXTLINE(readability-static-accessed-through-instance) uint32_t bin_flash_size = ESP.magicFlashChipSize((bytes[3] & 0xf0) >> 4); // NOLINTNEXTLINE(readability-static-accessed-through-instance) diff --git a/esphome/components/ota/ota_backend_esp8266.h b/esphome/components/ota/ota_backend_esp8266.h index d3668d4d109..a9d6dd2ccc5 100644 --- a/esphome/components/ota/ota_backend_esp8266.h +++ b/esphome/components/ota/ota_backend_esp8266.h @@ -19,6 +19,7 @@ class ESP8266OTABackend : public OTABackend { OTAResponseTypes write(uint8_t *data, size_t len) override; OTAResponseTypes end() override; void abort() override; + // Compression supported in all ESP8266 Arduino versions ESPHome supports (>= 2.7.0) bool supports_compression() override { return true; } protected: @@ -49,7 +50,7 @@ class ESP8266OTABackend : public OTABackend { size_t image_size_{0}; md5::MD5Digest md5_{}; - uint8_t expected_md5_[16]; // MD5 = 16 bytes + uint8_t expected_md5_[16]; // Fixed-size buffer for 128-bit (16-byte) MD5 digest bool md5_set_{false}; };