mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
feat(partition_table): Add read-only partition flag and functionality
This commit is contained in:
@@ -206,15 +206,20 @@ static IRAM_ATTR void release_buffer_malloc(void* arg, void *temp_buf)
|
||||
|
||||
static IRAM_ATTR esp_err_t main_flash_region_protected(void* arg, size_t start_addr, size_t size)
|
||||
{
|
||||
if (!esp_partition_is_flash_region_writable(start_addr, size)) {
|
||||
return ESP_ERR_NOT_ALLOWED;
|
||||
}
|
||||
#if !CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED
|
||||
if (((app_func_arg_t*)arg)->no_protect || esp_partition_main_flash_region_safe(start_addr, size)) {
|
||||
//ESP_OK = 0, also means protected==0
|
||||
return ESP_OK;
|
||||
} else {
|
||||
return ESP_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
#endif // !CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
|
||||
static IRAM_ATTR void main_flash_op_status(uint32_t op_status)
|
||||
{
|
||||
bool is_erasing = op_status & SPI_FLASH_OS_IS_ERASING_STATUS_FLAG;
|
||||
|
Reference in New Issue
Block a user