mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
spi_flash: Rename long Kconfig options
This commit is contained in:
parent
842384a0d3
commit
22d070e0af
@ -52,9 +52,9 @@ menu "SPI Flash driver"
|
||||
This option is needed to write to flash on ESP32-D2WD, and any configuration
|
||||
where external SPI flash is connected to non-default pins.
|
||||
|
||||
choice SPI_FLASH_WRITING_DANGEROUS_REGIONS
|
||||
choice SPI_FLASH_DANGEROUS_WRITE
|
||||
bool "Writing to dangerous flash regions"
|
||||
default SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS
|
||||
default SPI_FLASH_DANGEROUS_WRITE_ABORTS
|
||||
help
|
||||
SPI flash APIs can optionally abort or return a failure code
|
||||
if erasing or writing addresses that fall at the beginning
|
||||
@ -69,11 +69,11 @@ menu "SPI Flash driver"
|
||||
ROM functions. These functions should not be called directly from IDF
|
||||
applications.
|
||||
|
||||
config SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS
|
||||
config SPI_FLASH_DANGEROUS_WRITE_ABORTS
|
||||
bool "Aborts"
|
||||
config SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS
|
||||
config SPI_FLASH_DANGEROUS_WRITE_FAILS
|
||||
bool "Fails"
|
||||
config SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED
|
||||
config SPI_FLASH_DANGEROUS_WRITE_ALLOWED
|
||||
bool "Allowed"
|
||||
endchoice
|
||||
|
||||
|
@ -77,7 +77,7 @@ const DRAM_ATTR spi_flash_guard_funcs_t g_flash_guard_default_ops = {
|
||||
.end = spi_flash_enable_interrupts_caches_and_other_cpu,
|
||||
.op_lock = spi_flash_op_lock,
|
||||
.op_unlock = spi_flash_op_unlock,
|
||||
#if !CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED
|
||||
#if !CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED
|
||||
.is_safe_write_address = is_safe_write_address
|
||||
#endif
|
||||
};
|
||||
@ -87,14 +87,14 @@ const DRAM_ATTR spi_flash_guard_funcs_t g_flash_guard_no_os_ops = {
|
||||
.end = spi_flash_enable_interrupts_caches_no_os,
|
||||
.op_lock = 0,
|
||||
.op_unlock = 0,
|
||||
#if !CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED
|
||||
#if !CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED
|
||||
.is_safe_write_address = 0
|
||||
#endif
|
||||
};
|
||||
|
||||
static const spi_flash_guard_funcs_t *s_flash_guard_ops;
|
||||
|
||||
#ifdef CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS
|
||||
#ifdef CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS
|
||||
#define UNSAFE_WRITE_ADDRESS abort()
|
||||
#else
|
||||
#define UNSAFE_WRITE_ADDRESS return false
|
||||
@ -104,7 +104,7 @@ static const spi_flash_guard_funcs_t *s_flash_guard_ops;
|
||||
/* CHECK_WRITE_ADDRESS macro to fail writes which land in the
|
||||
bootloader, partition table, or running application region.
|
||||
*/
|
||||
#if CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED
|
||||
#if CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED
|
||||
#define CHECK_WRITE_ADDRESS(ADDR, SIZE)
|
||||
#else /* FAILS or ABORTS */
|
||||
#define CHECK_WRITE_ADDRESS(ADDR, SIZE) do { \
|
||||
@ -112,7 +112,7 @@ static const spi_flash_guard_funcs_t *s_flash_guard_ops;
|
||||
return ESP_ERR_INVALID_ARG; \
|
||||
} \
|
||||
} while(0)
|
||||
#endif // CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED
|
||||
#endif // CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED
|
||||
|
||||
static __attribute__((unused)) bool is_safe_write_address(size_t addr, size_t size)
|
||||
{
|
||||
|
@ -336,7 +336,7 @@ typedef bool (*spi_flash_is_safe_write_address_t)(size_t addr, size_t size);
|
||||
* - 'op_unlock' unlocks access to flash API internal data.
|
||||
* These two functions are recursive and can be used around the outside of multiple calls to
|
||||
* 'start' & 'end', in order to create atomic multi-part flash operations.
|
||||
* 3) When CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is disabled, flash writing/erasing
|
||||
* 3) When CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is disabled, flash writing/erasing
|
||||
* API checks for addresses provided by user to avoid corruption of critical flash regions
|
||||
* (bootloader, partition table, running application etc.).
|
||||
*
|
||||
@ -354,7 +354,7 @@ typedef struct {
|
||||
spi_flash_guard_end_func_t end; /**< critical section end function. */
|
||||
spi_flash_op_lock_func_t op_lock; /**< flash access API lock function.*/
|
||||
spi_flash_op_unlock_func_t op_unlock; /**< flash access API unlock function.*/
|
||||
#if !CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED
|
||||
#if !CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED
|
||||
spi_flash_is_safe_write_address_t is_safe_write_address; /**< checks flash write addresses.*/
|
||||
#endif
|
||||
} spi_flash_guard_funcs_t;
|
||||
|
7
components/spi_flash/sdkconfig.rename
Normal file
7
components/spi_flash/sdkconfig.rename
Normal file
@ -0,0 +1,7 @@
|
||||
# sdkconfig replacement configurations for deprecated options formatted as
|
||||
# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION
|
||||
|
||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS CONFIG_SPI_FLASH_DANGEROUS_WRITE
|
||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS
|
||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS
|
||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED
|
@ -4,11 +4,11 @@
|
||||
#include "esp_spi_flash.h"
|
||||
#include "esp_ota_ops.h"
|
||||
|
||||
#if CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS || CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS
|
||||
#if CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS || CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS
|
||||
|
||||
static const char *data = "blah blah blah";
|
||||
|
||||
#if CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS
|
||||
#if CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS
|
||||
#define TEST_TAGS "[spi_flash]"
|
||||
#else // ABORTS
|
||||
#define TEST_TAGS "[spi_flash][ignore]"
|
||||
|
@ -494,9 +494,9 @@ CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
|
||||
CONFIG_SPI_FLASH_VERIFY_WRITE=
|
||||
CONFIG_SPI_FLASH_ENABLE_COUNTERS=
|
||||
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
|
||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
|
||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS=
|
||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED=
|
||||
CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y
|
||||
CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS=
|
||||
CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED=
|
||||
|
||||
#
|
||||
# SPIFFS Configuration
|
||||
|
@ -19,7 +19,7 @@ CONFIG_MBEDTLS_HARDWARE_SHA=y
|
||||
CONFIG_SPI_FLASH_ENABLE_COUNTERS=y
|
||||
CONFIG_ESP32_ULP_COPROC_ENABLED=y
|
||||
CONFIG_ESP_TASK_WDT=n
|
||||
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS=y
|
||||
CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS=y
|
||||
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=7
|
||||
CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y
|
||||
CONFIG_COMPILER_STACK_CHECK=y
|
||||
|
Loading…
x
Reference in New Issue
Block a user