Skip to content

Commit

Permalink
refactor(i2s): refactor i2s examples common dependencies
Browse files Browse the repository at this point in the history
Closes #14751

Make the common I2S dependencies as an example common component,
so that to avoid slash & backslash issue on windows
when use absolute include path.
  • Loading branch information
L-KAYA committed Dec 24, 2024
1 parent 85be155 commit 75fb8bb
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ if(CONFIG_SOC_I2S_SUPPORTS_PDM_RX AND CONFIG_EXAMPLE_PDM_RX)
endif()

idf_component_register(SRCS "${srcs}"
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio
INCLUDE_DIRS "." "$ENV{IDF_PATH}/examples/peripherals/i2s/common")
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio i2s_examples_common
INCLUDE_DIRS ".")
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies:
i2s_examples_common:
path: ${IDF_PATH}/examples/peripherals/i2s/i2s_examples_common
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
idf_component_register(SRCS "i2s_std_example_main.c"
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio
INCLUDE_DIRS "." "$ENV{IDF_PATH}/examples/peripherals/i2s/common")
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio i2s_examples_common
INCLUDE_DIRS ".")
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies:
i2s_examples_common:
path: ${IDF_PATH}/examples/peripherals/i2s/i2s_examples_common
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
idf_component_register(SRCS "i2s_tdm_example_main.c"
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio
INCLUDE_DIRS "." "$ENV{IDF_PATH}/examples/peripherals/i2s/common")
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio i2s_examples_common
INCLUDE_DIRS ".")
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies:
i2s_examples_common:
path: ${IDF_PATH}/examples/peripherals/i2s/i2s_examples_common
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
idf_component_register(SRCS "i2s_es7210_record_example.c"
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio fatfs
INCLUDE_DIRS "$ENV{IDF_PATH}/examples/peripherals/i2s/common"
PRIV_REQUIRES esp_driver_i2s esp_driver_gpio fatfs i2s_examples_common
INCLUDE_DIRS
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ dependencies:
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
i2s_examples_common:
path: ${IDF_PATH}/examples/peripherals/i2s/i2s_examples_common
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ dependencies:
# version: "^1"
# rules:
# - if: "target in [esp32s3]"
i2s_examples_common:
path: ${IDF_PATH}/examples/peripherals/i2s/i2s_examples_common
2 changes: 2 additions & 0 deletions examples/peripherals/i2s/i2s_examples_common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# register I2S common dependencies as a component
idf_component_register(INCLUDE_DIRS ".")
4 changes: 2 additions & 2 deletions examples/peripherals/i2s/i2s_recorder/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
idf_component_register(SRCS "i2s_recorder_main.c"
PRIV_REQUIRES esp_driver_i2s fatfs
INCLUDE_DIRS "$ENV{IDF_PATH}/examples/peripherals/i2s/common")
PRIV_REQUIRES esp_driver_i2s fatfs i2s_examples_common
INCLUDE_DIRS)
3 changes: 3 additions & 0 deletions examples/peripherals/i2s/i2s_recorder/main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies:
i2s_examples_common:
path: ${IDF_PATH}/examples/peripherals/i2s/i2s_examples_common

0 comments on commit 75fb8bb

Please sign in to comment.