From 66821f699ce1579b661818b141a9172f8e32262e Mon Sep 17 00:00:00 2001 From: Song Ruo Jing Date: Thu, 21 Sep 2023 19:27:43 +0800 Subject: [PATCH] refactor(ledc): move related kconfig and linker.lf to its own folder --- components/driver/CMakeLists.txt | 2 ++ components/driver/Kconfig | 10 +--------- components/driver/ledc/Kconfig.ledc | 11 +++++++++++ components/driver/ledc/linker.lf | 12 ++++++++++++ components/driver/linker.lf | 4 ---- components/driver/test_apps/ledc/sdkconfig.defaults | 2 +- components/hal/linker.lf | 2 -- 7 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 components/driver/ledc/Kconfig.ledc create mode 100644 components/driver/ledc/linker.lf diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index 6af58de63d..c3d8a35c4e 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -125,6 +125,8 @@ endif() # LEDC related source files if(CONFIG_SOC_LEDC_SUPPORTED) list(APPEND srcs "ledc/ledc.c") + + list(APPEND ldfragments "ledc/linker.lf") endif() # MCPWM related source files diff --git a/components/driver/Kconfig b/components/driver/Kconfig index 65f29bd8e7..174904903c 100644 --- a/components/driver/Kconfig +++ b/components/driver/Kconfig @@ -409,15 +409,7 @@ menu "Driver Configurations" endmenu # Parallel IO Configuration - menu "LEDC Configuration" - config LEDC_CTRL_FUNC_IN_IRAM - bool "Place LEDC control functions into IRAM" - default n - help - Place LEDC control functions (ledc_update_duty and ledc_stop) into IRAM, - so that these functions can be IRAM-safe and able to be called in an IRAM context. - Enabling this option can improve driver performance as well. - endmenu # LEDC Configuration + orsource "./ledc/Kconfig.ledc" menu "I2C Configuration" config I2C_ISR_IRAM_SAFE diff --git a/components/driver/ledc/Kconfig.ledc b/components/driver/ledc/Kconfig.ledc new file mode 100644 index 0000000000..74f8b7a37b --- /dev/null +++ b/components/driver/ledc/Kconfig.ledc @@ -0,0 +1,11 @@ +menu "LEDC Configuration" + + config LEDC_CTRL_FUNC_IN_IRAM + bool "Place LEDC control functions into IRAM" + default n + help + Place LEDC control functions (ledc_update_duty and ledc_stop) into IRAM, + so that these functions can be IRAM-safe and able to be called in an IRAM context. + Enabling this option can improve driver performance as well. + +endmenu # LEDC Configuration diff --git a/components/driver/ledc/linker.lf b/components/driver/ledc/linker.lf new file mode 100644 index 0000000000..4119b65081 --- /dev/null +++ b/components/driver/ledc/linker.lf @@ -0,0 +1,12 @@ +[mapping:ledc_driver] +archive: libdriver.a +entries: + if LEDC_CTRL_FUNC_IN_IRAM = y: + ledc: ledc_stop (noflash) + ledc: ledc_update_duty (noflash) + ledc: _ledc_update_duty (noflash) + +[mapping:ledc_hal] +archive: libhal.a +entries: + ledc_hal_iram (noflash) diff --git a/components/driver/linker.lf b/components/driver/linker.lf index 9c69a76c5c..ae09bf19a9 100644 --- a/components/driver/linker.lf +++ b/components/driver/linker.lf @@ -15,7 +15,3 @@ entries: if DAC_CTRL_FUNC_IN_IRAM = y: dac_oneshot: dac_oneshot_output_voltage (noflash) dac_continuous: dac_continuous_write_asynchronously (noflash) - if LEDC_CTRL_FUNC_IN_IRAM = y: - ledc: ledc_stop (noflash) - ledc: ledc_update_duty (noflash) - ledc: _ledc_update_duty (noflash) diff --git a/components/driver/test_apps/ledc/sdkconfig.defaults b/components/driver/test_apps/ledc/sdkconfig.defaults index 8b3c17e0e0..568a2ae79f 100644 --- a/components/driver/test_apps/ledc/sdkconfig.defaults +++ b/components/driver/test_apps/ledc/sdkconfig.defaults @@ -1,4 +1,4 @@ CONFIG_FREERTOS_HZ=1000 -CONFIG_ESP_TASK_WDT=n +CONFIG_ESP_TASK_WDT_INIT=n # Disable memory protection, because "LEDC continue work after software reset" test case requires a cpu reset CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n diff --git a/components/hal/linker.lf b/components/hal/linker.lf index c36d4a2d5e..b2d5f76a76 100644 --- a/components/hal/linker.lf +++ b/components/hal/linker.lf @@ -14,8 +14,6 @@ entries: spi_hal_iram (noflash) if HAL_SPI_SLAVE_FUNC_IN_IRAM = y: spi_slave_hal_iram (noflash) - if SOC_LEDC_SUPPORTED = y: - ledc_hal_iram (noflash) if SOC_I2C_SUPPORTED = y: i2c_hal_iram (noflash) if HAL_WDT_USE_ROM_IMPL = n: