From 98b5ea7bdf953cd30e6d59d86a1f9dc937082106 Mon Sep 17 00:00:00 2001 From: morris Date: Mon, 16 Oct 2023 11:41:02 +0800 Subject: [PATCH] refactor(pcnt): make pcnt driver as component --- .gitlab/CODEOWNERS | 1 + components/driver/CMakeLists.txt | 9 +++-- components/driver/Kconfig | 2 +- components/driver/linker.lf | 5 --- .../driver/test_apps/.build-test-rules.yml | 4 -- .../dac_test_apps/dac/main/CMakeLists.txt | 2 +- .../i2s_test_apps/i2s/main/CMakeLists.txt | 2 +- .../legacy_i2s_driver/main/CMakeLists.txt | 2 +- .../driver/test_apps/ledc/main/CMakeLists.txt | 2 +- .../legacy_mcpwm_driver/main/CMakeLists.txt | 2 +- components/esp_driver_pcnt/CMakeLists.txt | 17 +++++++++ .../pcnt => esp_driver_pcnt}/Kconfig.pcnt | 0 .../include/driver/pulse_cnt.h | 0 components/esp_driver_pcnt/linker.lf | 8 ++++ .../pcnt => esp_driver_pcnt/src}/pulse_cnt.c | 10 ++--- .../test_apps/.build-test-rules.yml | 7 ++++ .../test_apps/pulse_cnt/CMakeLists.txt | 2 +- .../test_apps/pulse_cnt/README.md | 0 .../test_apps/pulse_cnt/main/CMakeLists.txt | 3 +- .../test_apps/pulse_cnt/main/test_app_main.c | 0 .../test_apps/pulse_cnt/main/test_pulse_cnt.c | 0 .../pulse_cnt/main/test_pulse_cnt_board.h | 0 .../pulse_cnt/main/test_pulse_cnt_iram.c | 0 .../pulse_cnt/main/test_pulse_cnt_simulator.c | 0 .../test_apps/pulse_cnt/pytest_pulse_cnt.py | 0 .../pulse_cnt/sdkconfig.ci.iram_safe | 0 .../test_apps/pulse_cnt/sdkconfig.ci.release | 0 .../test_apps/pulse_cnt/sdkconfig.defaults | 0 components/esp_timer/CMakeLists.txt | 38 +++++++++---------- docs/doxygen/Doxyfile | 2 +- examples/peripherals/.build-test-rules.yml | 2 + .../system/g1_components/CMakeLists.txt | 4 +- .../components/test_utils/CMakeLists.txt | 2 +- 33 files changed, 75 insertions(+), 51 deletions(-) create mode 100644 components/esp_driver_pcnt/CMakeLists.txt rename components/{driver/pcnt => esp_driver_pcnt}/Kconfig.pcnt (100%) rename components/{driver/pcnt => esp_driver_pcnt}/include/driver/pulse_cnt.h (100%) create mode 100644 components/esp_driver_pcnt/linker.lf rename components/{driver/pcnt => esp_driver_pcnt/src}/pulse_cnt.c (98%) create mode 100644 components/esp_driver_pcnt/test_apps/.build-test-rules.yml rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/CMakeLists.txt (87%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/README.md (100%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/main/CMakeLists.txt (71%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/main/test_app_main.c (100%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/main/test_pulse_cnt.c (100%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/main/test_pulse_cnt_board.h (100%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/main/test_pulse_cnt_iram.c (100%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/main/test_pulse_cnt_simulator.c (100%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/pytest_pulse_cnt.py (100%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/sdkconfig.ci.iram_safe (100%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/sdkconfig.ci.release (100%) rename components/{driver => esp_driver_pcnt}/test_apps/pulse_cnt/sdkconfig.defaults (100%) diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index 4dc470e321..bd0687aaa1 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -87,6 +87,7 @@ /components/esp_bootloader_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities /components/esp_coex/ @esp-idf-codeowners/wifi @esp-idf-codeowners/bluetooth @esp-idf-codeowners/ieee802154 /components/esp_common/ @esp-idf-codeowners/system +/components/esp_driver_*/ @esp-idf-codeowners/peripherals /components/esp_eth/ @esp-idf-codeowners/network /components/esp_event/ @esp-idf-codeowners/system /components/esp_gdbstub/ @esp-idf-codeowners/debugging diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index 9d43f98551..78c96e3e9a 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -23,7 +23,6 @@ set(includes "include" "ledc/include" "mcpwm/include" "parlio/include" - "pcnt/include" "rmt/include" "sdio_slave/include" "sdmmc/include" @@ -150,10 +149,9 @@ if(CONFIG_SOC_MCPWM_SUPPORTED) list(APPEND ldfragments "mcpwm/linker.lf") endif() -# PCNT related source files +# PCNT legacy driver if(CONFIG_SOC_PCNT_SUPPORTED) - list(APPEND srcs "pcnt/pulse_cnt.c" - "deprecated/pcnt_legacy.c") + list(APPEND srcs "deprecated/pcnt_legacy.c") endif() # RMT related source files @@ -245,6 +243,9 @@ else() INCLUDE_DIRS ${includes} PRIV_REQUIRES efuse esp_timer esp_mm REQUIRES esp_pm esp_ringbuf freertos soc hal esp_hw_support + # for backward compatibility, the driver component needs to + # have a public dependency on other "esp_driver_foo" components + esp_driver_pcnt LDFRAGMENTS ${ldfragments} ) endif() diff --git a/components/driver/Kconfig b/components/driver/Kconfig index 4936d2fc73..0394f99569 100644 --- a/components/driver/Kconfig +++ b/components/driver/Kconfig @@ -227,7 +227,7 @@ menu "Driver Configurations" orsource "./gptimer/Kconfig.gptimer" - orsource "./pcnt/Kconfig.pcnt" + orsource "../esp_driver_pcnt/Kconfig.pcnt" orsource "./rmt/Kconfig.rmt" diff --git a/components/driver/linker.lf b/components/driver/linker.lf index ae09bf19a9..6c90eff1f4 100644 --- a/components/driver/linker.lf +++ b/components/driver/linker.lf @@ -1,11 +1,6 @@ [mapping:driver] archive: libdriver.a entries: - if PCNT_CTRL_FUNC_IN_IRAM = y: - pulse_cnt: pcnt_unit_start (noflash) - pulse_cnt: pcnt_unit_stop (noflash) - pulse_cnt: pcnt_unit_clear_count (noflash) - pulse_cnt: pcnt_unit_get_count (noflash) if SDM_CTRL_FUNC_IN_IRAM = y: sdm: sdm_channel_set_pulse_density (noflash) if ANA_CMPR_CTRL_FUNC_IN_IRAM = y: diff --git a/components/driver/test_apps/.build-test-rules.yml b/components/driver/test_apps/.build-test-rules.yml index 98a33dbdf7..12824f0545 100644 --- a/components/driver/test_apps/.build-test-rules.yml +++ b/components/driver/test_apps/.build-test-rules.yml @@ -113,10 +113,6 @@ components/driver/test_apps/parlio: temporary: true reason: lack of runner -components/driver/test_apps/pulse_cnt: - disable: - - if: SOC_PCNT_SUPPORTED != 1 - components/driver/test_apps/rmt: disable: - if: SOC_RMT_SUPPORTED != 1 diff --git a/components/driver/test_apps/dac_test_apps/dac/main/CMakeLists.txt b/components/driver/test_apps/dac_test_apps/dac/main/CMakeLists.txt index 9ae8264930..369886c7dd 100644 --- a/components/driver/test_apps/dac_test_apps/dac/main/CMakeLists.txt +++ b/components/driver/test_apps/dac_test_apps/dac/main/CMakeLists.txt @@ -8,5 +8,5 @@ endif() # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity driver esp_adc + PRIV_REQUIRES unity esp_driver_pcnt driver esp_adc WHOLE_ARCHIVE) diff --git a/components/driver/test_apps/i2s_test_apps/i2s/main/CMakeLists.txt b/components/driver/test_apps/i2s_test_apps/i2s/main/CMakeLists.txt index 9e911f818e..1e48b532a3 100644 --- a/components/driver/test_apps/i2s_test_apps/i2s/main/CMakeLists.txt +++ b/components/driver/test_apps/i2s_test_apps/i2s/main/CMakeLists.txt @@ -3,5 +3,5 @@ set(srcs "test_app_main.c" "test_i2s_iram.c") idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity driver spi_flash + PRIV_REQUIRES unity esp_driver_pcnt driver spi_flash WHOLE_ARCHIVE) diff --git a/components/driver/test_apps/i2s_test_apps/legacy_i2s_driver/main/CMakeLists.txt b/components/driver/test_apps/i2s_test_apps/legacy_i2s_driver/main/CMakeLists.txt index 8a091fba5f..4e1ae63f7d 100644 --- a/components/driver/test_apps/i2s_test_apps/legacy_i2s_driver/main/CMakeLists.txt +++ b/components/driver/test_apps/i2s_test_apps/legacy_i2s_driver/main/CMakeLists.txt @@ -2,5 +2,5 @@ set(srcs "test_app_main.c" "test_legacy_i2s.c") idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity driver + PRIV_REQUIRES unity esp_driver_pcnt driver WHOLE_ARCHIVE) diff --git a/components/driver/test_apps/ledc/main/CMakeLists.txt b/components/driver/test_apps/ledc/main/CMakeLists.txt index 146642e5d3..5a5d4f716a 100644 --- a/components/driver/test_apps/ledc/main/CMakeLists.txt +++ b/components/driver/test_apps/ledc/main/CMakeLists.txt @@ -4,5 +4,5 @@ set(srcs "test_app_main.c" # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity driver esp_timer esp_psram + PRIV_REQUIRES unity esp_driver_pcnt driver esp_timer esp_psram WHOLE_ARCHIVE) diff --git a/components/driver/test_apps/legacy_mcpwm_driver/main/CMakeLists.txt b/components/driver/test_apps/legacy_mcpwm_driver/main/CMakeLists.txt index 8e3ba4f804..bcdc50e5e6 100644 --- a/components/driver/test_apps/legacy_mcpwm_driver/main/CMakeLists.txt +++ b/components/driver/test_apps/legacy_mcpwm_driver/main/CMakeLists.txt @@ -4,5 +4,5 @@ set(srcs "test_app_main.c" # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity driver + PRIV_REQUIRES unity esp_driver_pcnt driver WHOLE_ARCHIVE) diff --git a/components/esp_driver_pcnt/CMakeLists.txt b/components/esp_driver_pcnt/CMakeLists.txt new file mode 100644 index 0000000000..fa3864076f --- /dev/null +++ b/components/esp_driver_pcnt/CMakeLists.txt @@ -0,0 +1,17 @@ +set(srcs) +set(public_include "include") +if(CONFIG_SOC_PCNT_SUPPORTED) + list(APPEND srcs "src/pulse_cnt.c") +endif() + +if(BOOTLOADER_BUILD) + # Bootloader shall NOT depend on the drivers + idf_component_register() +else() + idf_component_register(SRCS ${srcs} + INCLUDE_DIRS ${public_include} + PRIV_REQUIRES "esp_pm" + "driver" # will be replaced by esp_driver_gpio + LDFRAGMENTS "linker.lf" + ) +endif() diff --git a/components/driver/pcnt/Kconfig.pcnt b/components/esp_driver_pcnt/Kconfig.pcnt similarity index 100% rename from components/driver/pcnt/Kconfig.pcnt rename to components/esp_driver_pcnt/Kconfig.pcnt diff --git a/components/driver/pcnt/include/driver/pulse_cnt.h b/components/esp_driver_pcnt/include/driver/pulse_cnt.h similarity index 100% rename from components/driver/pcnt/include/driver/pulse_cnt.h rename to components/esp_driver_pcnt/include/driver/pulse_cnt.h diff --git a/components/esp_driver_pcnt/linker.lf b/components/esp_driver_pcnt/linker.lf new file mode 100644 index 0000000000..13556e6a9c --- /dev/null +++ b/components/esp_driver_pcnt/linker.lf @@ -0,0 +1,8 @@ +[mapping:pcnt_driver] +archive: libesp_driver_pcnt.a +entries: + if PCNT_CTRL_FUNC_IN_IRAM = y: + pulse_cnt: pcnt_unit_start (noflash) + pulse_cnt: pcnt_unit_stop (noflash) + pulse_cnt: pcnt_unit_clear_count (noflash) + pulse_cnt: pcnt_unit_get_count (noflash) diff --git a/components/driver/pcnt/pulse_cnt.c b/components/esp_driver_pcnt/src/pulse_cnt.c similarity index 98% rename from components/driver/pcnt/pulse_cnt.c rename to components/esp_driver_pcnt/src/pulse_cnt.c index fc2c0a709e..ce9619de23 100644 --- a/components/driver/pcnt/pulse_cnt.c +++ b/components/esp_driver_pcnt/src/pulse_cnt.c @@ -192,7 +192,7 @@ esp_err_t pcnt_new_unit(const pcnt_unit_config_t *config, pcnt_unit_handle_t *re "invalid limit range:[%d,%d]", config->low_limit, config->high_limit); if (config->intr_priority) { ESP_GOTO_ON_FALSE(1 << (config->intr_priority) & PCNT_ALLOW_INTR_PRIORITY_MASK, ESP_ERR_INVALID_ARG, err, - TAG, "invalid interrupt priority:%d", config->intr_priority); + TAG, "invalid interrupt priority:%d", config->intr_priority); } unit = heap_caps_calloc(1, sizeof(pcnt_unit_t), PCNT_MEM_ALLOC_CAPS); @@ -225,8 +225,8 @@ esp_err_t pcnt_new_unit(const pcnt_unit_config_t *config, pcnt_unit_handle_t *re isr_flags |= PCNT_ALLOW_INTR_PRIORITY_MASK; } ESP_GOTO_ON_ERROR(esp_intr_alloc_intrstatus(pcnt_periph_signals.groups[group_id].irq, isr_flags, - (uint32_t)pcnt_ll_get_intr_status_reg(group->hal.dev), PCNT_LL_UNIT_WATCH_EVENT(unit_id), - pcnt_default_isr, unit, &unit->intr), err, + (uint32_t)pcnt_ll_get_intr_status_reg(group->hal.dev), PCNT_LL_UNIT_WATCH_EVENT(unit_id), + pcnt_default_isr, unit, &unit->intr), err, TAG, "install interrupt service failed"); } @@ -488,8 +488,8 @@ esp_err_t pcnt_unit_register_event_callbacks(pcnt_unit_handle_t unit, const pcnt isr_flags |= PCNT_ALLOW_INTR_PRIORITY_MASK; } ESP_RETURN_ON_ERROR(esp_intr_alloc_intrstatus(pcnt_periph_signals.groups[group_id].irq, isr_flags, - (uint32_t)pcnt_ll_get_intr_status_reg(group->hal.dev), PCNT_LL_UNIT_WATCH_EVENT(unit_id), - pcnt_default_isr, unit, &unit->intr), + (uint32_t)pcnt_ll_get_intr_status_reg(group->hal.dev), PCNT_LL_UNIT_WATCH_EVENT(unit_id), + pcnt_default_isr, unit, &unit->intr), TAG, "install interrupt service failed"); } // enable/disable PCNT interrupt events diff --git a/components/esp_driver_pcnt/test_apps/.build-test-rules.yml b/components/esp_driver_pcnt/test_apps/.build-test-rules.yml new file mode 100644 index 0000000000..d94a1f9237 --- /dev/null +++ b/components/esp_driver_pcnt/test_apps/.build-test-rules.yml @@ -0,0 +1,7 @@ +# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps + +components/esp_driver_pcnt/test_apps/pulse_cnt: + disable: + - if: SOC_PCNT_SUPPORTED != 1 + depends_components: + - esp_driver_pcnt diff --git a/components/driver/test_apps/pulse_cnt/CMakeLists.txt b/components/esp_driver_pcnt/test_apps/pulse_cnt/CMakeLists.txt similarity index 87% rename from components/driver/test_apps/pulse_cnt/CMakeLists.txt rename to components/esp_driver_pcnt/test_apps/pulse_cnt/CMakeLists.txt index 46dee2c382..aac9520484 100644 --- a/components/driver/test_apps/pulse_cnt/CMakeLists.txt +++ b/components/esp_driver_pcnt/test_apps/pulse_cnt/CMakeLists.txt @@ -10,7 +10,7 @@ project(pcnt_test) if(CONFIG_COMPILER_DUMP_RTL_FILES) add_custom_target(check_test_app_sections ALL COMMAND ${PYTHON} $ENV{IDF_PATH}/tools/ci/check_callgraph.py - --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/driver/,${CMAKE_BINARY_DIR}/esp-idf/hal/ + --rtl-dirs ${CMAKE_BINARY_DIR}/esp-idf/esp_driver_pcnt/,${CMAKE_BINARY_DIR}/esp-idf/hal/ --elf-file ${CMAKE_BINARY_DIR}/pcnt_test.elf find-refs --from-sections=.iram0.text diff --git a/components/driver/test_apps/pulse_cnt/README.md b/components/esp_driver_pcnt/test_apps/pulse_cnt/README.md similarity index 100% rename from components/driver/test_apps/pulse_cnt/README.md rename to components/esp_driver_pcnt/test_apps/pulse_cnt/README.md diff --git a/components/driver/test_apps/pulse_cnt/main/CMakeLists.txt b/components/esp_driver_pcnt/test_apps/pulse_cnt/main/CMakeLists.txt similarity index 71% rename from components/driver/test_apps/pulse_cnt/main/CMakeLists.txt rename to components/esp_driver_pcnt/test_apps/pulse_cnt/main/CMakeLists.txt index a7ee53f40d..82fd921095 100644 --- a/components/driver/test_apps/pulse_cnt/main/CMakeLists.txt +++ b/components/esp_driver_pcnt/test_apps/pulse_cnt/main/CMakeLists.txt @@ -9,5 +9,6 @@ endif() # In order for the cases defined by `TEST_CASE` to be linked into the final elf, # the component can be registered as WHOLE_ARCHIVE idf_component_register(SRCS ${srcs} - PRIV_REQUIRES unity driver spi_flash + PRIV_REQUIRES unity esp_driver_pcnt spi_flash + driver # will be replaced by esp_driver_gpio WHOLE_ARCHIVE) diff --git a/components/driver/test_apps/pulse_cnt/main/test_app_main.c b/components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_app_main.c similarity index 100% rename from components/driver/test_apps/pulse_cnt/main/test_app_main.c rename to components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_app_main.c diff --git a/components/driver/test_apps/pulse_cnt/main/test_pulse_cnt.c b/components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_pulse_cnt.c similarity index 100% rename from components/driver/test_apps/pulse_cnt/main/test_pulse_cnt.c rename to components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_pulse_cnt.c diff --git a/components/driver/test_apps/pulse_cnt/main/test_pulse_cnt_board.h b/components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_pulse_cnt_board.h similarity index 100% rename from components/driver/test_apps/pulse_cnt/main/test_pulse_cnt_board.h rename to components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_pulse_cnt_board.h diff --git a/components/driver/test_apps/pulse_cnt/main/test_pulse_cnt_iram.c b/components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_pulse_cnt_iram.c similarity index 100% rename from components/driver/test_apps/pulse_cnt/main/test_pulse_cnt_iram.c rename to components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_pulse_cnt_iram.c diff --git a/components/driver/test_apps/pulse_cnt/main/test_pulse_cnt_simulator.c b/components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_pulse_cnt_simulator.c similarity index 100% rename from components/driver/test_apps/pulse_cnt/main/test_pulse_cnt_simulator.c rename to components/esp_driver_pcnt/test_apps/pulse_cnt/main/test_pulse_cnt_simulator.c diff --git a/components/driver/test_apps/pulse_cnt/pytest_pulse_cnt.py b/components/esp_driver_pcnt/test_apps/pulse_cnt/pytest_pulse_cnt.py similarity index 100% rename from components/driver/test_apps/pulse_cnt/pytest_pulse_cnt.py rename to components/esp_driver_pcnt/test_apps/pulse_cnt/pytest_pulse_cnt.py diff --git a/components/driver/test_apps/pulse_cnt/sdkconfig.ci.iram_safe b/components/esp_driver_pcnt/test_apps/pulse_cnt/sdkconfig.ci.iram_safe similarity index 100% rename from components/driver/test_apps/pulse_cnt/sdkconfig.ci.iram_safe rename to components/esp_driver_pcnt/test_apps/pulse_cnt/sdkconfig.ci.iram_safe diff --git a/components/driver/test_apps/pulse_cnt/sdkconfig.ci.release b/components/esp_driver_pcnt/test_apps/pulse_cnt/sdkconfig.ci.release similarity index 100% rename from components/driver/test_apps/pulse_cnt/sdkconfig.ci.release rename to components/esp_driver_pcnt/test_apps/pulse_cnt/sdkconfig.ci.release diff --git a/components/driver/test_apps/pulse_cnt/sdkconfig.defaults b/components/esp_driver_pcnt/test_apps/pulse_cnt/sdkconfig.defaults similarity index 100% rename from components/driver/test_apps/pulse_cnt/sdkconfig.defaults rename to components/esp_driver_pcnt/test_apps/pulse_cnt/sdkconfig.defaults diff --git a/components/esp_timer/CMakeLists.txt b/components/esp_timer/CMakeLists.txt index 0129826de1..faf80921d3 100644 --- a/components/esp_timer/CMakeLists.txt +++ b/components/esp_timer/CMakeLists.txt @@ -1,28 +1,24 @@ idf_build_get_property(target IDF_TARGET) if(${target} STREQUAL "linux") -idf_component_register(INCLUDE_DIRS include) + idf_component_register(INCLUDE_DIRS include) else() + set(srcs "src/esp_timer.c" + "src/ets_timer_legacy.c" + "src/system_time.c" + "src/esp_timer_impl_common.c") -set(srcs "src/esp_timer.c" - "src/ets_timer_legacy.c" - "src/system_time.c" - "src/esp_timer_impl_common.c") - -if(CONFIG_ESP_TIMER_IMPL_TG0_LAC) - list(APPEND srcs "src/esp_timer_impl_lac.c") -elseif(CONFIG_ESP_TIMER_IMPL_SYSTIMER) - list(APPEND srcs "src/esp_timer_impl_systimer.c") -endif() - -if(CONFIG_SOC_SYSTIMER_SUPPORT_ETM) - list(APPEND srcs "src/esp_timer_etm.c") -endif() - -idf_component_register(SRCS "${srcs}" - INCLUDE_DIRS include - PRIV_INCLUDE_DIRS private_include - REQUIRES esp_common - PRIV_REQUIRES soc driver) + if(CONFIG_ESP_TIMER_IMPL_TG0_LAC) + list(APPEND srcs "src/esp_timer_impl_lac.c") + elseif(CONFIG_ESP_TIMER_IMPL_SYSTIMER) + list(APPEND srcs "src/esp_timer_impl_systimer.c") + endif() + if(CONFIG_SOC_SYSTIMER_SUPPORT_ETM) + list(APPEND srcs "src/esp_timer_etm.c") + endif() + + idf_component_register(SRCS "${srcs}" + INCLUDE_DIRS include + PRIV_INCLUDE_DIRS private_include) endif() diff --git a/docs/doxygen/Doxyfile b/docs/doxygen/Doxyfile index f9a4a5cbb2..89d66714aa 100644 --- a/docs/doxygen/Doxyfile +++ b/docs/doxygen/Doxyfile @@ -106,7 +106,6 @@ INPUT = \ $(PROJECT_PATH)/components/driver/mcpwm/include/driver/mcpwm_types.h \ $(PROJECT_PATH)/components/driver/parlio/include/driver/parlio_tx.h \ $(PROJECT_PATH)/components/driver/parlio/include/driver/parlio_types.h \ - $(PROJECT_PATH)/components/driver/pcnt/include/driver/pulse_cnt.h \ $(PROJECT_PATH)/components/driver/rmt/include/driver/rmt_common.h \ $(PROJECT_PATH)/components/driver/rmt/include/driver/rmt_encoder.h \ $(PROJECT_PATH)/components/driver/rmt/include/driver/rmt_rx.h \ @@ -140,6 +139,7 @@ INPUT = \ $(PROJECT_PATH)/components/esp_common/include/esp_check.h \ $(PROJECT_PATH)/components/esp_common/include/esp_err.h \ $(PROJECT_PATH)/components/esp_common/include/esp_idf_version.h \ + $(PROJECT_PATH)/components/esp_driver_pcnt/include/driver/pulse_cnt.h \ $(PROJECT_PATH)/components/esp_eth/include/esp_eth_com.h \ $(PROJECT_PATH)/components/esp_eth/include/esp_eth_driver.h \ $(PROJECT_PATH)/components/esp_eth/include/esp_eth_mac.h \ diff --git a/examples/peripherals/.build-test-rules.yml b/examples/peripherals/.build-test-rules.yml index 5141971ac6..414bdf75c5 100644 --- a/examples/peripherals/.build-test-rules.yml +++ b/examples/peripherals/.build-test-rules.yml @@ -193,6 +193,8 @@ examples/peripherals/parlio/simple_rgb_led_matrix: examples/peripherals/pcnt: disable: - if: SOC_PCNT_SUPPORTED != 1 + depends_components: + - esp_driver_pcnt examples/peripherals/rmt: disable: diff --git a/tools/test_apps/system/g1_components/CMakeLists.txt b/tools/test_apps/system/g1_components/CMakeLists.txt index 2c1925c027..204005e1cd 100644 --- a/tools/test_apps/system/g1_components/CMakeLists.txt +++ b/tools/test_apps/system/g1_components/CMakeLists.txt @@ -33,9 +33,9 @@ set(extra_components_which_shouldnt_be_included bootloader_support # [refactor-todo]: should cxx be in G1? Can it exist without FreeRTOS? cxx - # [refactor-todo]: driver is a dependency of esp_pm, esp_timer, spi_flash, vfs, esp_wifi, ${IDF_TARGET} + # [refactor-todo]: driver is a dependency of esp_pm, spi_flash, vfs, esp_wifi # all of these should be removed from G1 except for spi_flash. - driver + driver esp_driver_pcnt # esp_app_format is dependency of bootloader_support, app_update esp_app_format # esp_bootloader_format is dependency of bootloader_support, app_update diff --git a/tools/unit-test-app/components/test_utils/CMakeLists.txt b/tools/unit-test-app/components/test_utils/CMakeLists.txt index 27748db9ed..8a50233d57 100644 --- a/tools/unit-test-app/components/test_utils/CMakeLists.txt +++ b/tools/unit-test-app/components/test_utils/CMakeLists.txt @@ -16,5 +16,5 @@ endif() idf_component_register(SRCS ${srcs} INCLUDE_DIRS include REQUIRES esp_partition idf_test cmock - PRIV_REQUIRES perfmon driver esp_netif) + PRIV_REQUIRES perfmon esp_driver_pcnt driver esp_netif) target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")