This commit is contained in:
J. Nick Koston
2025-12-26 22:13:10 -10:00
parent a5574bbabe
commit 37de782e3e
@@ -96,6 +96,8 @@ OTAResponseTypes ESP8266OTABackend::begin(size_t image_size) {
// NOLINTNEXTLINE(readability-static-accessed-through-instance)
this->buffer_size_ = (ESP.getFreeHeap() > 2 * FLASH_SECTOR_SIZE) ? FLASH_SECTOR_SIZE : MIN_BUFFER_SIZE;
// ESP8266's umm_malloc guarantees 4-byte aligned allocations, which is required
// for spi_flash_write(). This is the same pattern used by Arduino's Updater class.
this->buffer_ = make_unique<uint8_t[]>(this->buffer_size_);
if (!this->buffer_) {
return OTA_RESPONSE_ERROR_UNKNOWN;