Explorar el Código

Merge branch 'bugfix/spi_add_flash' into 'master'

spi_flash: fix a logic bug in checking ex_flash and psram

Closes IDFGH-2230

See merge request espressif/esp-idf!10009
Michael (XIAO Xufeng) hace 5 años
padre
commit
60fb1a6ef3
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      components/hal/spi_flash_hal.c

+ 1 - 1
components/hal/spi_flash_hal.c

@@ -66,7 +66,7 @@ static inline int get_dummy_n(bool gpio_is_used, int input_delay_ns, int eff_clk
 
 
 esp_err_t spi_flash_hal_init(spi_flash_hal_context_t *data_out, const spi_flash_hal_config_t *cfg)
 esp_err_t spi_flash_hal_init(spi_flash_hal_context_t *data_out, const spi_flash_hal_config_t *cfg)
 {
 {
-    if (!esp_ptr_internal(data_out)) {
+    if (!esp_ptr_internal(data_out) && cfg->host_id == SPI1_HOST) {
         return ESP_ERR_INVALID_ARG;
         return ESP_ERR_INVALID_ARG;
     }
     }
     if (cfg->cs_num >= SOC_SPI_PERIPH_CS_NUM(cfg->host_id)) {
     if (cfg->cs_num >= SOC_SPI_PERIPH_CS_NUM(cfg->host_id)) {