refactor(flash_enc): move esp_flash_encryption_enabled() to efuse component

This commit is contained in:
Chen Jichang
2026-01-21 15:11:59 +08:00
committed by Chen Ji Chang
parent 0ac402217c
commit b8c527a87c
53 changed files with 139 additions and 131 deletions
+2 -2
View File
@@ -6,6 +6,6 @@ endif()
idf_component_register(SRCS "src/esp_https_ota.c"
INCLUDE_DIRS "include"
REQUIRES esp_http_client bootloader_support esp_bootloader_format esp_app_format
REQUIRES esp_http_client esp_bootloader_format esp_app_format
esp_event esp_partition
PRIV_REQUIRES log app_update)
PRIV_REQUIRES log app_update efuse)
+2 -2
View File
@@ -14,7 +14,7 @@
#include <sys/param.h>
#include <inttypes.h>
#include "esp_check.h"
#include "esp_flash_encrypt.h"
#include "esp_efuse.h"
#include "hal/efuse_hal.h"
ESP_EVENT_DEFINE_BASE(ESP_HTTPS_OTA_EVENT);
@@ -350,7 +350,7 @@ esp_err_t esp_https_ota_begin(const esp_https_ota_config_t *ota_config, esp_http
// We allow resumption only if we have minimum buffer size already written to flash
if (ota_config->ota_image_bytes_written >= DEFAULT_OTA_BUF_SIZE) {
// For FE case the flash is written in multiples of 16 bytes. So, we need to align the offset to 16 bytes.
https_ota_handle->binary_file_len = esp_flash_encryption_enabled() ? (ota_config->ota_image_bytes_written & ~0xF) : ota_config->ota_image_bytes_written;
https_ota_handle->binary_file_len = esp_efuse_is_flash_encryption_enabled() ? (ota_config->ota_image_bytes_written & ~0xF) : ota_config->ota_image_bytes_written;
ESP_LOGD(TAG, "Resuming OTA from offset: %d", https_ota_handle->binary_file_len);
}
}