mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
spi_flash: rename spi_flash_os_func_app: spi_start, spi_end
spi_start -> s_acquire_spi_bus_lock spi_end -> s_release_spi_bus_lock
This commit is contained in:
committed by
Armando (Dou Yiwen)
parent
29ff838f5a
commit
da5acfdca6
@ -74,7 +74,7 @@ IRAM_ATTR static void cache_disable(void* arg)
|
|||||||
}
|
}
|
||||||
#endif //#if !SPI_FLASH_CACHE_NO_DISABLE
|
#endif //#if !SPI_FLASH_CACHE_NO_DISABLE
|
||||||
|
|
||||||
static IRAM_ATTR esp_err_t spi_start(void *arg)
|
static IRAM_ATTR esp_err_t acquire_spi_bus_lock(void *arg)
|
||||||
{
|
{
|
||||||
spi_bus_lock_dev_handle_t dev_lock = ((app_func_arg_t *)arg)->dev_lock;
|
spi_bus_lock_dev_handle_t dev_lock = ((app_func_arg_t *)arg)->dev_lock;
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ static IRAM_ATTR esp_err_t spi_start(void *arg)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static IRAM_ATTR esp_err_t spi_end(void *arg)
|
static IRAM_ATTR esp_err_t release_spi_bus_lock(void *arg)
|
||||||
{
|
{
|
||||||
return spi_bus_lock_acquire_end(((app_func_arg_t *)arg)->dev_lock);
|
return spi_bus_lock_acquire_end(((app_func_arg_t *)arg)->dev_lock);
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ static IRAM_ATTR esp_err_t spi1_start(void *arg)
|
|||||||
*/
|
*/
|
||||||
#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
|
||||||
ret = spi_start(arg);
|
ret = acquire_spi_bus_lock(arg);
|
||||||
#elif SPI_FLASH_CACHE_NO_DISABLE
|
#elif SPI_FLASH_CACHE_NO_DISABLE
|
||||||
_lock_acquire(&s_spi1_flash_mutex);
|
_lock_acquire(&s_spi1_flash_mutex);
|
||||||
#else
|
#else
|
||||||
@ -124,7 +124,7 @@ static IRAM_ATTR esp_err_t spi1_end(void *arg)
|
|||||||
* There are three ways for ESP Flash API lock, see `spi1_start`
|
* There are three ways for ESP Flash API lock, see `spi1_start`
|
||||||
*/
|
*/
|
||||||
#if CONFIG_SPI_FLASH_SHARE_SPI1_BUS
|
#if CONFIG_SPI_FLASH_SHARE_SPI1_BUS
|
||||||
ret = spi_end(arg);
|
ret = release_spi_bus_lock(arg);
|
||||||
#elif SPI_FLASH_CACHE_NO_DISABLE
|
#elif SPI_FLASH_CACHE_NO_DISABLE
|
||||||
_lock_release(&s_spi1_flash_mutex);
|
_lock_release(&s_spi1_flash_mutex);
|
||||||
#else
|
#else
|
||||||
@ -220,8 +220,8 @@ static const DRAM_ATTR esp_flash_os_functions_t esp_flash_spi1_default_os_functi
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const esp_flash_os_functions_t esp_flash_spi23_default_os_functions = {
|
static const esp_flash_os_functions_t esp_flash_spi23_default_os_functions = {
|
||||||
.start = spi_start,
|
.start = acquire_spi_bus_lock,
|
||||||
.end = spi_end,
|
.end = release_spi_bus_lock,
|
||||||
.delay_us = delay_us,
|
.delay_us = delay_us,
|
||||||
.get_temp_buffer = get_buffer_malloc,
|
.get_temp_buffer = get_buffer_malloc,
|
||||||
.release_temp_buffer = release_buffer_malloc,
|
.release_temp_buffer = release_buffer_malloc,
|
||||||
|
Reference in New Issue
Block a user