From 177eb9f6c65ba4bf611e779daaed1de25cfec081 Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Fri, 15 Dec 2023 05:51:44 +0800 Subject: [PATCH] refactor(hal/usb): Fix USB OTG compilation dependency Update "hal/CMakeLists.txt" so that USB OTG related HAL files depend on the "SOC_USB_OTG_SUPPORTED" capability. --- components/hal/CMakeLists.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/hal/CMakeLists.txt b/components/hal/CMakeLists.txt index 8843a5be71..84c444b817 100644 --- a/components/hal/CMakeLists.txt +++ b/components/hal/CMakeLists.txt @@ -179,6 +179,13 @@ if(NOT BOOTLOADER_BUILD) list(APPEND srcs "ds_hal.c") endif() + if(CONFIG_SOC_USB_OTG_SUPPORTED) + list(APPEND srcs + "usb_hal.c" + "usb_dwc_hal.c" + "usb_phy_hal.c") + endif() + if(${target} STREQUAL "esp32") list(APPEND srcs "touch_sensor_hal.c" @@ -190,24 +197,18 @@ if(NOT BOOTLOADER_BUILD) list(APPEND srcs "spi_flash_hal_gpspi.c" "touch_sensor_hal.c" - "usb_hal.c" - "usb_phy_hal.c" "xt_wdt_hal.c" "esp32s2/cp_dma_hal.c" - "esp32s2/touch_sensor_hal.c" - "usb_dwc_hal.c") + "esp32s2/touch_sensor_hal.c") endif() if(${target} STREQUAL "esp32s3") list(APPEND srcs "spi_flash_hal_gpspi.c" "touch_sensor_hal.c" - "usb_hal.c" - "usb_phy_hal.c" "xt_wdt_hal.c" "esp32s3/touch_sensor_hal.c" - "esp32s3/rtc_cntl_hal.c" - "usb_dwc_hal.c") + "esp32s3/rtc_cntl_hal.c") endif() if(${target} STREQUAL "esp32c3")