feat(hal): unify hal cmake for spi_flash_hal_gpspi.c

pull/11869/head
Armando 2023-06-27 15:59:46 +08:00
rodzic ea05ae6af2
commit fb420725d2
2 zmienionych plików z 8 dodań i 20 usunięć

Wyświetl plik

@ -167,6 +167,10 @@ if(NOT BOOTLOADER_BUILD)
list(APPEND srcs "spi_slave_hd_hal.c")
endif()
if(CONFIG_SOC_GPSPI_SUPPORTED AND NOT CONFIG_IDF_TARGET_ESP32)
list(APPEND srcs "spi_flash_hal_gpspi.c")
endif()
if(CONFIG_SOC_SDIO_SLAVE_SUPPORTED)
list(APPEND srcs "sdio_slave_hal.c")
endif()
@ -198,7 +202,6 @@ if(NOT BOOTLOADER_BUILD)
if(${target} STREQUAL "esp32s2")
list(APPEND srcs
"spi_flash_hal_gpspi.c"
"touch_sensor_hal.c"
"usb_hal.c"
"usb_phy_hal.c"
@ -210,7 +213,6 @@ if(NOT BOOTLOADER_BUILD)
if(${target} STREQUAL "esp32s3")
list(APPEND srcs
"spi_flash_hal_gpspi.c"
"touch_sensor_hal.c"
"usb_hal.c"
"usb_phy_hal.c"
@ -222,34 +224,16 @@ if(NOT BOOTLOADER_BUILD)
if(${target} STREQUAL "esp32c3")
list(APPEND srcs
"spi_flash_hal_gpspi.c"
"xt_wdt_hal.c"
"esp32c3/rtc_cntl_hal.c")
endif()
if(${target} STREQUAL "esp32c2")
list(APPEND srcs
"spi_flash_hal_gpspi.c"
"esp32c2/rtc_cntl_hal.c")
endif()
if(${target} STREQUAL "esp32c6")
list(APPEND srcs
"spi_flash_hal_gpspi.c")
endif()
if(${target} STREQUAL "esp32p4")
list(APPEND srcs
"spi_flash_hal_gpspi.c")
endif()
if(${target} STREQUAL "esp32h2")
list(APPEND srcs
"spi_flash_hal_gpspi.c"
)
list(REMOVE_ITEM srcs
"esp32h2/rtc_cntl_hal.c"
)

Wyświetl plik

@ -34,6 +34,7 @@ extern uint32_t spi_flash_hal_gpspi_check_status(spi_flash_host_inst_t *host);
extern bool spi_flash_hal_gpspi_supports_direct_write(spi_flash_host_inst_t *host, const void *p);
extern bool spi_flash_hal_gpspi_supports_direct_read(spi_flash_host_inst_t *host, const void *p);
#if SOC_GPSPI_SUPPORTED
/** Default configuration for GPSPI */
static const spi_flash_host_driver_t esp_flash_gpspi_host = {
.dev_config = spi_flash_hal_gpspi_device_config,
@ -58,6 +59,9 @@ static const spi_flash_host_driver_t esp_flash_gpspi_host = {
.resume = spi_flash_hal_resume,
.suspend = spi_flash_hal_suspend,
};
#else
static const spi_flash_host_driver_t esp_flash_gpspi_host = {};
#endif
#endif
esp_err_t memspi_host_init_pointers(memspi_host_inst_t *host, const memspi_host_config_t *cfg)