spiflash: fix not calling on_spi_acquired when CONFIG_SPI_FLASH_SHARE_SPI1_BUS issue

This commit is contained in:
Armando 2023-06-25 15:20:15 +08:00
parent 7c2ac1feb6
commit f1f446d495

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@ -101,15 +101,16 @@ static IRAM_ATTR esp_err_t spi23_end(void *arg){
static IRAM_ATTR esp_err_t spi1_start(void *arg) static IRAM_ATTR esp_err_t spi1_start(void *arg)
{ {
esp_err_t ret = ESP_OK;
#if CONFIG_SPI_FLASH_SHARE_SPI1_BUS #if CONFIG_SPI_FLASH_SHARE_SPI1_BUS
//use the lock to disable the cache and interrupts before using the SPI bus //use the lock to disable the cache and interrupts before using the SPI bus
return spi_start(arg); ret = spi_start(arg);
#else #else
//directly disable the cache and interrupts when lock is not used //directly disable the cache and interrupts when lock is not used
cache_disable(NULL); cache_disable(NULL);
#endif
on_spi_acquired((app_func_arg_t*)arg); on_spi_acquired((app_func_arg_t*)arg);
return ESP_OK; return ESP_OK;
#endif
} }
static IRAM_ATTR esp_err_t spi1_end(void *arg) static IRAM_ATTR esp_err_t spi1_end(void *arg)