mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
spiflash: fix not calling on_spi_acquired when CONFIG_SPI_FLASH_SHARE_SPI1_BUS issue
This commit is contained in:
parent
6209a2c5e2
commit
a9e5dac6cc
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -92,15 +92,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)
|
||||
|
Loading…
Reference in New Issue
Block a user