diff --git a/components/hal/spi_flash_hal_common.inc b/components/hal/spi_flash_hal_common.inc index 4f8947ecd2..803c745c65 100644 --- a/components/hal/spi_flash_hal_common.inc +++ b/components/hal/spi_flash_hal_common.inc @@ -126,9 +126,9 @@ esp_err_t spi_flash_hal_configure_host_io_mode( * - DIO is similar. */ if (conf_required) { -#if !SOC_SPI_MEM_SUPPORT_WB_MODE_INDEPENDENT_CONTROL int line_width = (io_mode == SPI_FLASH_DIO? 2: 4); dummy_cyclelen_base -= SPI_FLASH_LL_CONTINUOUS_MODE_BIT_NUMS / line_width; +#if !SOC_SPI_MEM_SUPPORT_WB_MODE_INDEPENDENT_CONTROL addr_bitlen += SPI_FLASH_LL_CONTINUOUS_MODE_BIT_NUMS; #endif spi_flash_ll_set_extra_address(dev, 0); @@ -138,7 +138,9 @@ esp_err_t spi_flash_hal_configure_host_io_mode( } #endif #else - gpspi_flash_ll_set_dummy_out(dev, (conf_required? 1: 0), 1); + if (conf_required) { + gpspi_flash_ll_set_dummy_out(dev, (conf_required? 1: 0), 1); + } #endif #if CONFIG_IDF_TARGET_ESP32P4 diff --git a/components/spi_flash/include/spi_flash/spi_flash_defs.h b/components/spi_flash/include/spi_flash/spi_flash_defs.h index a7d5cbe81f..3d412a10bf 100644 --- a/components/spi_flash/include/spi_flash/spi_flash_defs.h +++ b/components/spi_flash/include/spi_flash/spi_flash_defs.h @@ -57,13 +57,8 @@ #define CMD_RDSFDP 0x5A /* Read the SFDP of the flash */ -#if !SOC_SPI_MEM_SUPPORT_WB_MODE_INDEPENDENT_CONTROL #define SPI_FLASH_DIO_DUMMY_BITLEN 4 #define SPI_FLASH_QIO_DUMMY_BITLEN 6 -#else -#define SPI_FLASH_DIO_DUMMY_BITLEN 0 -#define SPI_FLASH_QIO_DUMMY_BITLEN 4 -#endif #define SPI_FLASH_DIO_ADDR_BITLEN 24 #define SPI_FLASH_QIO_ADDR_BITLEN 24 #define SPI_FLASH_QOUT_ADDR_BITLEN 24