Skip to content

Commit 177eb9f

Browse files
committed
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.
1 parent dc27d54 commit 177eb9f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

components/hal/CMakeLists.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@ if(NOT BOOTLOADER_BUILD)
179179
list(APPEND srcs "ds_hal.c")
180180
endif()
181181

182+
if(CONFIG_SOC_USB_OTG_SUPPORTED)
183+
list(APPEND srcs
184+
"usb_hal.c"
185+
"usb_dwc_hal.c"
186+
"usb_phy_hal.c")
187+
endif()
188+
182189
if(${target} STREQUAL "esp32")
183190
list(APPEND srcs
184191
"touch_sensor_hal.c"
@@ -190,24 +197,18 @@ if(NOT BOOTLOADER_BUILD)
190197
list(APPEND srcs
191198
"spi_flash_hal_gpspi.c"
192199
"touch_sensor_hal.c"
193-
"usb_hal.c"
194-
"usb_phy_hal.c"
195200
"xt_wdt_hal.c"
196201
"esp32s2/cp_dma_hal.c"
197-
"esp32s2/touch_sensor_hal.c"
198-
"usb_dwc_hal.c")
202+
"esp32s2/touch_sensor_hal.c")
199203
endif()
200204

201205
if(${target} STREQUAL "esp32s3")
202206
list(APPEND srcs
203207
"spi_flash_hal_gpspi.c"
204208
"touch_sensor_hal.c"
205-
"usb_hal.c"
206-
"usb_phy_hal.c"
207209
"xt_wdt_hal.c"
208210
"esp32s3/touch_sensor_hal.c"
209-
"esp32s3/rtc_cntl_hal.c"
210-
"usb_dwc_hal.c")
211+
"esp32s3/rtc_cntl_hal.c")
211212
endif()
212213

213214
if(${target} STREQUAL "esp32c3")

0 commit comments

Comments
 (0)