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 5fb0d557a4
commit 0c2cd2dfa6

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
*/
@ -93,15 +93,16 @@ static IRAM_ATTR esp_err_t spi_end(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
//use the lock to disable the cache and interrupts before using the SPI bus
return spi_start(arg);
ret = spi_start(arg);
#else
//directly disable the cache and interrupts when lock is not used
cache_disable(NULL);
on_spi1_acquired((spi1_app_func_arg_t*)arg);
return ESP_OK;
#endif
on_spi1_acquired((spi1_app_func_arg_t*)arg);
return ret;
}
static IRAM_ATTR esp_err_t spi1_end(void *arg)