From c113507ad7a3f3a7841b1c00da512c93361e29f3 Mon Sep 17 00:00:00 2001 From: morris Date: Sat, 1 Jul 2023 23:12:38 +0800 Subject: [PATCH 1/2] feat(gptimer): add gptimer linker.lf to control the placement of driver and hal since the linker placement of the hal functions are controlled by the Kconfig in the driver component, we should create the linker.lf in the driver component, not in the hal component. --- components/driver/CMakeLists.txt | 2 +- components/driver/gptimer/linker.lf | 17 +++++++++++ components/driver/linker.lf | 7 ----- components/hal/CMakeLists.txt | 2 +- components/hal/esp32/include/hal/timer_ll.h | 2 ++ components/hal/esp32c2/include/hal/timer_ll.h | 2 ++ components/hal/esp32c3/include/hal/timer_ll.h | 2 ++ components/hal/esp32c6/include/hal/timer_ll.h | 2 ++ components/hal/esp32h2/include/hal/timer_ll.h | 2 ++ components/hal/esp32s2/include/hal/timer_ll.h | 2 ++ components/hal/esp32s3/include/hal/timer_ll.h | 2 ++ components/hal/linker.lf | 2 -- components/hal/timer_hal.c | 24 ++++++++++++++- components/hal/timer_hal_iram.c | 30 ------------------- 14 files changed, 56 insertions(+), 42 deletions(-) create mode 100644 components/driver/gptimer/linker.lf delete mode 100644 components/hal/timer_hal_iram.c diff --git a/components/driver/CMakeLists.txt b/components/driver/CMakeLists.txt index 564814091f..be80ecc4e7 100644 --- a/components/driver/CMakeLists.txt +++ b/components/driver/CMakeLists.txt @@ -216,7 +216,7 @@ else() INCLUDE_DIRS ${includes} PRIV_REQUIRES efuse esp_timer REQUIRES esp_pm esp_ringbuf freertos soc hal esp_hw_support - LDFRAGMENTS linker.lf) + LDFRAGMENTS linker.lf gptimer/linker.lf) endif() # If system needs to monitor USJ connection status, then usb_serial_jtag_connection_monitor object file has to be linked diff --git a/components/driver/gptimer/linker.lf b/components/driver/gptimer/linker.lf new file mode 100644 index 0000000000..1e80c4b0bd --- /dev/null +++ b/components/driver/gptimer/linker.lf @@ -0,0 +1,17 @@ +[mapping:gptimer_driver] +archive: libdriver.a +entries: + if GPTIMER_CTRL_FUNC_IN_IRAM = y: + gptimer: gptimer_set_raw_count (noflash) + gptimer: gptimer_get_raw_count (noflash) + gptimer: gptimer_get_captured_count (noflash) + gptimer: gptimer_set_alarm_action (noflash) + gptimer: gptimer_start (noflash) + gptimer: gptimer_stop (noflash) + +[mapping:gptimer_hal] +archive: libhal.a +entries: + if GPTIMER_CTRL_FUNC_IN_IRAM = y: + timer_hal: timer_hal_set_counter_value (noflash) + timer_hal: timer_hal_capture_and_get_counter_value (noflash) diff --git a/components/driver/linker.lf b/components/driver/linker.lf index 1f6f247879..d9b25c0ac7 100644 --- a/components/driver/linker.lf +++ b/components/driver/linker.lf @@ -1,13 +1,6 @@ [mapping:driver] archive: libdriver.a entries: - if GPTIMER_CTRL_FUNC_IN_IRAM = y: - gptimer: gptimer_set_raw_count (noflash) - gptimer: gptimer_get_raw_count (noflash) - gptimer: gptimer_get_captured_count (noflash) - gptimer: gptimer_set_alarm_action (noflash) - gptimer: gptimer_start (noflash) - gptimer: gptimer_stop (noflash) if PCNT_CTRL_FUNC_IN_IRAM = y: pulse_cnt: pcnt_unit_start (noflash) pulse_cnt: pcnt_unit_stop (noflash) diff --git a/components/hal/CMakeLists.txt b/components/hal/CMakeLists.txt index c898f7e69e..8843a5be71 100644 --- a/components/hal/CMakeLists.txt +++ b/components/hal/CMakeLists.txt @@ -58,7 +58,7 @@ if(NOT BOOTLOADER_BUILD) endif() if(CONFIG_SOC_GPTIMER_SUPPORTED) - list(APPEND srcs "timer_hal.c" "timer_hal_iram.c") + list(APPEND srcs "timer_hal.c") endif() if(CONFIG_SOC_LEDC_SUPPORTED) diff --git a/components/hal/esp32/include/hal/timer_ll.h b/components/hal/esp32/include/hal/timer_ll.h index 63ba28801a..98cf9038f7 100644 --- a/components/hal/esp32/include/hal/timer_ll.h +++ b/components/hal/esp32/include/hal/timer_ll.h @@ -193,6 +193,7 @@ static inline void timer_ll_set_reload_value(timg_dev_t *hw, uint32_t timer_num, * @param timer_num Timer number in the group * @return reload count value */ +__attribute__((always_inline)) static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_num) { return ((uint64_t)hw->hw_timer[timer_num].loadhi.tx_load_hi << 32) | (hw->hw_timer[timer_num].loadlo.tx_load_lo); @@ -204,6 +205,7 @@ static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_ * @param hw Timer Group register base address * @param timer_num Timer number in the group */ +__attribute__((always_inline)) static inline void timer_ll_trigger_soft_reload(timg_dev_t *hw, uint32_t timer_num) { hw->hw_timer[timer_num].load.tx_load = 1; diff --git a/components/hal/esp32c2/include/hal/timer_ll.h b/components/hal/esp32c2/include/hal/timer_ll.h index f77d5fc641..7336306f71 100644 --- a/components/hal/esp32c2/include/hal/timer_ll.h +++ b/components/hal/esp32c2/include/hal/timer_ll.h @@ -193,6 +193,7 @@ static inline void timer_ll_set_reload_value(timg_dev_t *hw, uint32_t timer_num, * @param timer_num Timer number in the group * @return reload count value */ +__attribute__((always_inline)) static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_num) { return ((uint64_t)hw->hw_timer[timer_num].loadhi.tx_load_hi << 32) | (hw->hw_timer[timer_num].loadlo.tx_load_lo); @@ -204,6 +205,7 @@ static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_ * @param hw Timer Group register base address * @param timer_num Timer number in the group */ +__attribute__((always_inline)) static inline void timer_ll_trigger_soft_reload(timg_dev_t *hw, uint32_t timer_num) { hw->hw_timer[timer_num].load.tx_load = 1; diff --git a/components/hal/esp32c3/include/hal/timer_ll.h b/components/hal/esp32c3/include/hal/timer_ll.h index 2c9ed9395d..817387ceba 100644 --- a/components/hal/esp32c3/include/hal/timer_ll.h +++ b/components/hal/esp32c3/include/hal/timer_ll.h @@ -193,6 +193,7 @@ static inline void timer_ll_set_reload_value(timg_dev_t *hw, uint32_t timer_num, * @param timer_num Timer number in the group * @return reload count value */ +__attribute__((always_inline)) static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_num) { return ((uint64_t)hw->hw_timer[timer_num].loadhi.tx_load_hi << 32) | (hw->hw_timer[timer_num].loadlo.tx_load_lo); @@ -204,6 +205,7 @@ static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_ * @param hw Timer Group register base address * @param timer_num Timer number in the group */ +__attribute__((always_inline)) static inline void timer_ll_trigger_soft_reload(timg_dev_t *hw, uint32_t timer_num) { hw->hw_timer[timer_num].load.tx_load = 1; diff --git a/components/hal/esp32c6/include/hal/timer_ll.h b/components/hal/esp32c6/include/hal/timer_ll.h index a9403c4bd4..592cf60e6c 100644 --- a/components/hal/esp32c6/include/hal/timer_ll.h +++ b/components/hal/esp32c6/include/hal/timer_ll.h @@ -235,6 +235,7 @@ static inline void timer_ll_set_reload_value(timg_dev_t *hw, uint32_t timer_num, * @param timer_num Timer number in the group * @return reload count value */ +__attribute__((always_inline)) static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_num) { return ((uint64_t)hw->hw_timer[timer_num].loadhi.tx_load_hi << 32) | (hw->hw_timer[timer_num].loadlo.tx_load_lo); @@ -246,6 +247,7 @@ static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_ * @param hw Timer Group register base address * @param timer_num Timer number in the group */ +__attribute__((always_inline)) static inline void timer_ll_trigger_soft_reload(timg_dev_t *hw, uint32_t timer_num) { hw->hw_timer[timer_num].load.tx_load = 1; diff --git a/components/hal/esp32h2/include/hal/timer_ll.h b/components/hal/esp32h2/include/hal/timer_ll.h index 70d0e4f8da..17574d6457 100644 --- a/components/hal/esp32h2/include/hal/timer_ll.h +++ b/components/hal/esp32h2/include/hal/timer_ll.h @@ -235,6 +235,7 @@ static inline void timer_ll_set_reload_value(timg_dev_t *hw, uint32_t timer_num, * @param timer_num Timer number in the group * @return reload count value */ +__attribute__((always_inline)) static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_num) { return ((uint64_t)hw->hw_timer[timer_num].loadhi.tx_load_hi << 32) | (hw->hw_timer[timer_num].loadlo.tx_load_lo); @@ -246,6 +247,7 @@ static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_ * @param hw Timer Group register base address * @param timer_num Timer number in the group */ +__attribute__((always_inline)) static inline void timer_ll_trigger_soft_reload(timg_dev_t *hw, uint32_t timer_num) { hw->hw_timer[timer_num].load.tx_load = 1; diff --git a/components/hal/esp32s2/include/hal/timer_ll.h b/components/hal/esp32s2/include/hal/timer_ll.h index 42daa564e3..f50a27cb2b 100644 --- a/components/hal/esp32s2/include/hal/timer_ll.h +++ b/components/hal/esp32s2/include/hal/timer_ll.h @@ -197,6 +197,7 @@ static inline void timer_ll_set_reload_value(timg_dev_t *hw, uint32_t timer_num, * @param timer_num Timer number in the group * @return reload count value */ +__attribute__((always_inline)) static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_num) { return ((uint64_t)hw->hw_timer[timer_num].loadhi.tx_load_hi << 32) | (hw->hw_timer[timer_num].loadlo.tx_load_lo); @@ -208,6 +209,7 @@ static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_ * @param hw Timer Group register base address * @param timer_num Timer number in the group */ +__attribute__((always_inline)) static inline void timer_ll_trigger_soft_reload(timg_dev_t *hw, uint32_t timer_num) { hw->hw_timer[timer_num].load.tx_load = 1; diff --git a/components/hal/esp32s3/include/hal/timer_ll.h b/components/hal/esp32s3/include/hal/timer_ll.h index f6bebcceea..f72a67efe6 100644 --- a/components/hal/esp32s3/include/hal/timer_ll.h +++ b/components/hal/esp32s3/include/hal/timer_ll.h @@ -196,6 +196,7 @@ static inline void timer_ll_set_reload_value(timg_dev_t *hw, uint32_t timer_num, * @param timer_num Timer number in the group * @return reload count value */ +__attribute__((always_inline)) static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_num) { return ((uint64_t)hw->hw_timer[timer_num].loadhi.tn_load_hi << 32) | (hw->hw_timer[timer_num].loadlo.tn_load_lo); @@ -207,6 +208,7 @@ static inline uint64_t timer_ll_get_reload_value(timg_dev_t *hw, uint32_t timer_ * @param hw Timer Group register base address * @param timer_num Timer number in the group */ +__attribute__((always_inline)) static inline void timer_ll_trigger_soft_reload(timg_dev_t *hw, uint32_t timer_num) { hw->hw_timer[timer_num].load.tn_load = 1; diff --git a/components/hal/linker.lf b/components/hal/linker.lf index adb824b320..39535f02de 100644 --- a/components/hal/linker.lf +++ b/components/hal/linker.lf @@ -30,8 +30,6 @@ entries: twai_hal_iram (noflash) if IDF_TARGET_ESP32 = n: spi_flash_hal_gpspi (noflash) - if GPTIMER_CTRL_FUNC_IN_IRAM = y: - timer_hal_iram (noflash) if GPIO_CTRL_FUNC_IN_IRAM = y: gpio_hal: gpio_hal_intr_disable (noflash) if LCD_RGB_ISR_IRAM_SAFE = y: diff --git a/components/hal/timer_hal.c b/components/hal/timer_hal.c index ae4e55467d..39f466bca9 100644 --- a/components/hal/timer_hal.c +++ b/components/hal/timer_hal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -38,3 +38,25 @@ void timer_hal_deinit(timer_hal_context_t *hal) #endif hal->dev = NULL; } + +void timer_hal_set_counter_value(timer_hal_context_t *hal, uint64_t load_val) +{ + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // - `timer_ll_set_reload_value()` will only indicate the `reload_value` + // - `timer_ll_set_reload_value()` + ``timer_ll_trigger_soft_reload()` can update the HW counter value by software + // Therefore, after updating the HW counter value, we need to restore the previous `reload_value`. + // Attention: The following process should be protected by a lock in the driver layer. + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // save current reload value + uint64_t old_reload = timer_ll_get_reload_value(hal->dev, hal->timer_id); + timer_ll_set_reload_value(hal->dev, hal->timer_id, load_val); + timer_ll_trigger_soft_reload(hal->dev, hal->timer_id); + // restore the previous reload value + timer_ll_set_reload_value(hal->dev, hal->timer_id, old_reload); +} + +uint64_t timer_hal_capture_and_get_counter_value(timer_hal_context_t *hal) +{ + timer_ll_trigger_soft_capture(hal->dev, hal->timer_id); + return timer_ll_get_counter_value(hal->dev, hal->timer_id); +} diff --git a/components/hal/timer_hal_iram.c b/components/hal/timer_hal_iram.c deleted file mode 100644 index 43bac81e72..0000000000 --- a/components/hal/timer_hal_iram.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "hal/timer_hal.h" -#include "hal/timer_ll.h" - -void timer_hal_set_counter_value(timer_hal_context_t *hal, uint64_t load_val) -{ - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - `timer_ll_set_reload_value()` will only indicate the `reload_value` - // - `timer_ll_set_reload_value()` + ``timer_ll_trigger_soft_reload()` can update the HW counter value by software - // Therefore, after updating the HW counter value, we need to restore the previous `reload_value`. - // Attention: The following process should be protected by a lock in the driver layer. - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // save current reload value - uint64_t old_reload = timer_ll_get_reload_value(hal->dev, hal->timer_id); - timer_ll_set_reload_value(hal->dev, hal->timer_id, load_val); - timer_ll_trigger_soft_reload(hal->dev, hal->timer_id); - // restore the previous reload value - timer_ll_set_reload_value(hal->dev, hal->timer_id, old_reload); -} - -uint64_t timer_hal_capture_and_get_counter_value(timer_hal_context_t *hal) -{ - timer_ll_trigger_soft_capture(hal->dev, hal->timer_id); - return timer_ll_get_counter_value(hal->dev, hal->timer_id); -} From b7aea79cb8ef7f982dd830e0ff5dcd841c96f4e0 Mon Sep 17 00:00:00 2001 From: morris Date: Mon, 7 Aug 2023 11:46:28 +0800 Subject: [PATCH 2/2] fix(gptimer): hal function placement under wrong condition timer_hal_capture_and_get_counter_value should be placed in the IRAM for speed optimization because the default ISR handler is placed in the IRAM. Closes https://github.com/espressif/esp-idf/issues/12021 --- components/driver/Kconfig | 32 +--------------- components/driver/gptimer/Kconfig.gptimer | 38 +++++++++++++++++++ components/driver/gptimer/gptimer.c | 3 +- components/driver/gptimer/linker.lf | 4 ++ docs/en/api-reference/peripherals/gptimer.rst | 5 ++- .../api-reference/peripherals/gptimer.rst | 5 ++- 6 files changed, 50 insertions(+), 37 deletions(-) create mode 100644 components/driver/gptimer/Kconfig.gptimer diff --git a/components/driver/Kconfig b/components/driver/Kconfig index f0bcbcfe72..61ee6aa290 100644 --- a/components/driver/Kconfig +++ b/components/driver/Kconfig @@ -306,37 +306,7 @@ menu "Driver Configurations" Note that, this option only controls the Analog Comparator driver log, won't affect other drivers. endmenu # Analog Comparator Configuration - menu "GPTimer Configuration" - config GPTIMER_CTRL_FUNC_IN_IRAM - bool "Place GPTimer control functions into IRAM" - default n - help - Place GPTimer control functions (like start/stop) into IRAM, - so that these functions can be IRAM-safe and able to be called in the other IRAM interrupt context. - Enabling this option can improve driver performance as well. - - config GPTIMER_ISR_IRAM_SAFE - bool "GPTimer ISR IRAM-Safe" - default n - help - Ensure the GPTimer interrupt is IRAM-Safe by allowing the interrupt handler to be - executable when the cache is disabled (e.g. SPI Flash write). - - config GPTIMER_SUPPRESS_DEPRECATE_WARN - bool "Suppress legacy driver deprecated warning" - default n - help - Wether to suppress the deprecation warnings when using legacy timer group driver (driver/timer.h). - If you want to continue using the legacy driver, and don't want to see related deprecation warnings, - you can enable this option. - - config GPTIMER_ENABLE_DEBUG_LOG - bool "Enable debug log" - default n - help - Wether to enable the debug log message for GPTimer driver. - Note that, this option only controls the GPTimer driver log, won't affect other drivers. - endmenu # GPTimer Configuration + orsource "./gptimer/Kconfig.gptimer" menu "PCNT Configuration" depends on SOC_PCNT_SUPPORTED diff --git a/components/driver/gptimer/Kconfig.gptimer b/components/driver/gptimer/Kconfig.gptimer new file mode 100644 index 0000000000..9c56414c3e --- /dev/null +++ b/components/driver/gptimer/Kconfig.gptimer @@ -0,0 +1,38 @@ +menu "GPTimer Configuration" + config GPTIMER_ISR_HANDLER_IN_IRAM + bool "Place GPTimer ISR handler into IRAM" + default y + help + Place GPTimer ISR handler into IRAM for better performance and fewer cache misses. + + config GPTIMER_CTRL_FUNC_IN_IRAM + bool "Place GPTimer control functions into IRAM" + default n + help + Place GPTimer control functions (like start/stop) into IRAM, + so that these functions can be IRAM-safe and able to be called in the other IRAM interrupt context. + Enabling this option can improve driver performance as well. + + config GPTIMER_ISR_IRAM_SAFE + bool "GPTimer ISR IRAM-Safe" + select GPTIMER_ISR_HANDLER_IN_IRAM + default n + help + Ensure the GPTimer interrupt is IRAM-Safe by allowing the interrupt handler to be + executable when the cache is disabled (e.g. SPI Flash write). + + config GPTIMER_SUPPRESS_DEPRECATE_WARN + bool "Suppress legacy driver deprecated warning" + default n + help + Wether to suppress the deprecation warnings when using legacy timer group driver (driver/timer.h). + If you want to continue using the legacy driver, and don't want to see related deprecation warnings, + you can enable this option. + + config GPTIMER_ENABLE_DEBUG_LOG + bool "Enable debug log" + default n + help + Wether to enable the debug log message for GPTimer driver. + Note that, this option only controls the GPTimer driver log, won't affect other drivers. +endmenu # GPTimer Configuration diff --git a/components/driver/gptimer/gptimer.c b/components/driver/gptimer/gptimer.c index a519e8b168..f134e8098f 100644 --- a/components/driver/gptimer/gptimer.c +++ b/components/driver/gptimer/gptimer.c @@ -480,8 +480,7 @@ static esp_err_t gptimer_select_periph_clock(gptimer_t *timer, gptimer_clock_sou return ESP_OK; } -// Put the default ISR handler in the IRAM for better performance -IRAM_ATTR static void gptimer_default_isr(void *args) +static void gptimer_default_isr(void *args) { bool need_yield = false; gptimer_t *timer = (gptimer_t *)args; diff --git a/components/driver/gptimer/linker.lf b/components/driver/gptimer/linker.lf index 1e80c4b0bd..11d7eeb26c 100644 --- a/components/driver/gptimer/linker.lf +++ b/components/driver/gptimer/linker.lf @@ -1,6 +1,8 @@ [mapping:gptimer_driver] archive: libdriver.a entries: + if GPTIMER_ISR_HANDLER_IN_IRAM = y: + gptimer: gptimer_default_isr (noflash) if GPTIMER_CTRL_FUNC_IN_IRAM = y: gptimer: gptimer_set_raw_count (noflash) gptimer: gptimer_get_raw_count (noflash) @@ -12,6 +14,8 @@ entries: [mapping:gptimer_hal] archive: libhal.a entries: + if GPTIMER_ISR_HANDLER_IN_IRAM = y: + timer_hal: timer_hal_capture_and_get_counter_value (noflash) if GPTIMER_CTRL_FUNC_IN_IRAM = y: timer_hal: timer_hal_set_counter_value (noflash) timer_hal: timer_hal_capture_and_get_counter_value (noflash) diff --git a/docs/en/api-reference/peripherals/gptimer.rst b/docs/en/api-reference/peripherals/gptimer.rst index 0967eada6b..b5890238c6 100644 --- a/docs/en/api-reference/peripherals/gptimer.rst +++ b/docs/en/api-reference/peripherals/gptimer.rst @@ -327,8 +327,9 @@ All the APIs provided by the driver are guaranteed to be thread safe, which mean Kconfig Options ^^^^^^^^^^^^^^^ -- :ref:`CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM` controls where to place the GPTimer control functions (IRAM or flash), see Section :ref:`gptimer-iram-safe` for more information. -- :ref:`CONFIG_GPTIMER_ISR_IRAM_SAFE` controls whether the default ISR handler can work when the cache is disabled, see Section :ref:`gptimer-iram-safe` for more information. +- :ref:`CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM` controls where to place the GPTimer control functions (IRAM or flash). +- :ref:`CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM` controls where to place the GPTimer ISR handler (IRAM or flash). +- :ref:`CONFIG_GPTIMER_ISR_IRAM_SAFE` controls whether the default ISR handler should be masked when the cache is disabled, see Section :ref:`gptimer-iram-safe` for more information. - :ref:`CONFIG_GPTIMER_ENABLE_DEBUG_LOG` is used to enabled the debug log output. Enable this option will increase the firmware binary size. Application Examples diff --git a/docs/zh_CN/api-reference/peripherals/gptimer.rst b/docs/zh_CN/api-reference/peripherals/gptimer.rst index 3da0738199..dd1c541732 100644 --- a/docs/zh_CN/api-reference/peripherals/gptimer.rst +++ b/docs/zh_CN/api-reference/peripherals/gptimer.rst @@ -327,8 +327,9 @@ IRAM 安全 Kconfig 选项 ^^^^^^^^^^^^^^^^^^^^^^ -- :ref:`CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM` 控制放置通用定时器控制函数(IRAM 或 flash)的位置。了解更多信息,请参考章节 :ref:`gptimer-iram-safe`。 -- :ref:`CONFIG_GPTIMER_ISR_IRAM_SAFE` 控制默认 ISR 程序在 cache 禁用时是否可以运行。了解更多信息,请参考章节 :ref:`gptimer-iram-safe`。 +- :ref:`CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM` 控制着定时器控制函数的存放位置(IRAM 或 flash)。 +- :ref:`CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM` 控制着定时器中断处理函数的存放位置(IRAM 或 flash)。 +- :ref:`CONFIG_GPTIMER_ISR_IRAM_SAFE` 控制着中断处理函数是否需要在 cache 关闭的时候被屏蔽掉。更多信息,请参阅 :ref:`gptimer-iram-safe`。 - :ref:`CONFIG_GPTIMER_ENABLE_DEBUG_LOG` 用于启用调试日志输出。启用这一选项将增加固件二进制文件大小。 应用示例