explict name

This commit is contained in:
J. Nick Koston
2026-04-29 12:34:25 -05:00
parent 8b98079fad
commit 9b3f8f6f6e
2 changed files with 6 additions and 3 deletions
@@ -98,7 +98,7 @@ void IDFOTABackend::set_update_md5(const char *expected_md5) {
OTAResponseTypes IDFOTABackend::write(uint8_t *data, size_t len) {
#ifdef USE_OTA_PARTITIONS
if (this->ota_type_ == ota::OTA_TYPE_UPDATE_PARTITION_TABLE) {
if (len > OTA_BUFFER_SIZE - this->buf_written_) {
if (len > PARTITION_TABLE_BUFFER_SIZE - this->buf_written_) {
ESP_LOGE(TAG, "Wrong partition table size");
return OTA_RESPONSE_ERROR_PARTITION_TABLE_VERIFY;
}
+5 -2
View File
@@ -10,7 +10,10 @@
namespace esphome::ota {
#ifdef USE_OTA_PARTITIONS
static constexpr size_t OTA_BUFFER_SIZE = ESP_PARTITION_TABLE_MAX_LEN; // 0xC00
// Dedicated staging buffer size for the new partition table image. Must be at least
// ESP_PARTITION_TABLE_MAX_LEN (0xC00) so the entire partition table fits before verification.
// Kept separate from any OTA chunk-transfer buffer to avoid coupling unrelated sizes.
static constexpr size_t PARTITION_TABLE_BUFFER_SIZE = ESP_PARTITION_TABLE_MAX_LEN; // 0xC00
#endif
#ifdef USE_OTA_PARTITIONS
@@ -43,7 +46,7 @@ class IDFOTABackend final {
bool md5_set_{false};
#ifdef USE_OTA_PARTITIONS
ota::OTAType ota_type_{ota::OTA_TYPE_UPDATE_APP};
uint8_t buf_[OTA_BUFFER_SIZE];
uint8_t buf_[PARTITION_TABLE_BUFFER_SIZE];
size_t buf_written_{0};
size_t image_size_{0};
const esp_partition_t *partition_table_part_{nullptr};