Skip to content

Commit

Permalink
change(pm/ext1): replace esp_sleep_clear_ext1_wakeup_io by esp_sleep_…
Browse files Browse the repository at this point in the history
…disable_ext1_wakeup_io
  • Loading branch information
10086loutianhao committed Nov 20, 2023
1 parent b86d550 commit ea7cfc4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions components/esp_hw_support/include/esp_sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ esp_err_t esp_sleep_enable_ext0_wakeup(gpio_num_t gpio_num, int level);
*
* @note Call this func will reset the previous ext1 configuration.
*
* @note This function will be deprecated in release/v6.0. Please switch to use `esp_sleep_enable_ext1_wakeup_io` and `esp_sleep_clear_ext1_wakeup_io`
* @note This function will be deprecated in release/v6.0. Please switch to use `esp_sleep_enable_ext1_wakeup_io` and `esp_sleep_disable_ext1_wakeup_io`
*
* @param io_mask Bit mask of GPIO numbers which will cause wakeup. Only GPIOs
* which have RTC functionality can be used in this bit map.
Expand Down Expand Up @@ -297,8 +297,8 @@ esp_err_t esp_sleep_enable_ext1_wakeup(uint64_t io_mask, esp_sleep_ext1_wakeup_m
* @brief Enable ext1 wakeup pins with IO masks.
*
* This will append selected IOs to the wakeup IOs, it will not reset previously enabled IOs.
* To reset specific previously enabled IOs, call esp_sleep_clear_ext1_wakeup_io with the io_mask.
* To reset all the enabled IOs, call esp_sleep_clear_ext1_wakeup_io(0).
* To reset specific previously enabled IOs, call esp_sleep_disable_ext1_wakeup_io with the io_mask.
* To reset all the enabled IOs, call esp_sleep_disable_ext1_wakeup_io(0).
*
* This function uses external wakeup feature of RTC controller.
* It will work even if RTC peripherals are shut down during sleep.
Expand Down Expand Up @@ -360,7 +360,7 @@ esp_err_t esp_sleep_enable_ext1_wakeup_io(uint64_t io_mask, esp_sleep_ext1_wakeu
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG if any of the selected GPIOs is not an RTC GPIO.
*/
esp_err_t esp_sleep_clear_ext1_wakeup_io(uint64_t io_mask);
esp_err_t esp_sleep_disable_ext1_wakeup_io(uint64_t io_mask);

#if SOC_PM_SUPPORT_EXT1_WAKEUP_MODE_PER_PIN
/**
Expand Down Expand Up @@ -401,7 +401,7 @@ esp_err_t esp_sleep_clear_ext1_wakeup_io(uint64_t io_mask);
* or mode is invalid
*/
esp_err_t esp_sleep_enable_ext1_wakeup_with_level_mask(uint64_t io_mask, uint64_t level_mask)
__attribute__((deprecated("please use 'esp_sleep_enable_ext1_wakeup_io' and 'esp_sleep_clear_ext1_wakeup_io' instead")));
__attribute__((deprecated("please use 'esp_sleep_enable_ext1_wakeup_io' and 'esp_sleep_disable_ext1_wakeup_io' instead")));

#endif // SOC_PM_SUPPORT_EXT1_WAKEUP_MODE_PER_PIN
#endif // SOC_PM_SUPPORT_EXT1_WAKEUP
Expand Down
4 changes: 2 additions & 2 deletions components/esp_hw_support/sleep_modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ esp_err_t esp_sleep_enable_ext1_wakeup(uint64_t io_mask, esp_sleep_ext1_wakeup_m
return ESP_ERR_INVALID_ARG;
}
// Reset all EXT1 configs
esp_sleep_clear_ext1_wakeup_io(0);
esp_sleep_disable_ext1_wakeup_io(0);

return esp_sleep_enable_ext1_wakeup_io(io_mask, level_mode);
}
Expand Down Expand Up @@ -1533,7 +1533,7 @@ esp_err_t esp_sleep_enable_ext1_wakeup_io(uint64_t io_mask, esp_sleep_ext1_wakeu
return ESP_OK;
}

esp_err_t esp_sleep_clear_ext1_wakeup_io(uint64_t io_mask)
esp_err_t esp_sleep_disable_ext1_wakeup_io(uint64_t io_mask)
{
if (io_mask == 0) {
s_config.ext1_rtc_gpio_mask = 0;
Expand Down
2 changes: 1 addition & 1 deletion docs/en/api-reference/system/sleep_modes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ RTC peripherals or RTC memories do not need to be powered on during sleep in thi

:cpp:func:`esp_sleep_enable_ext1_wakeup_io` function can be used to append ext1 wakeup IO and set corresponding wakeup level.

:cpp:func:`esp_sleep_clear_ext1_wakeup_io` function can be used to remove ext1 wakeup IO.
:cpp:func:`esp_sleep_disable_ext1_wakeup_io` function can be used to remove ext1 wakeup IO.

.. only:: SOC_PM_SUPPORT_EXT1_WAKEUP_MODE_PER_PIN

Expand Down
2 changes: 1 addition & 1 deletion docs/en/migration-guides/release-5.x/5.3/system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ System
Power Management
-----------------------

* ``esp_sleep_enable_ext1_wakeup_with_level_mask`` is deprecated, use ``esp_sleep_enable_ext1_wakeup_io`` and ``esp_sleep_clear_ext1_wakeup_io`` instead.
* ``esp_sleep_enable_ext1_wakeup_with_level_mask`` is deprecated, use ``esp_sleep_enable_ext1_wakeup_io`` and ``esp_sleep_disable_ext1_wakeup_io`` instead.
2 changes: 1 addition & 1 deletion docs/zh_CN/api-reference/system/sleep_modes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ RTC 控制器中内嵌定时器,可用于在预定义的时间到达后唤醒

可调用 :cpp:func:`esp_sleep_enable_ext1_wakeup_io` 函数可用于增加 ext1 唤醒 IO 并设置相应的唤醒电平。

可调用 :cpp:func:`esp_sleep_clear_ext1_wakeup_io` 函数可用于移除 ext1 唤醒 IO。
可调用 :cpp:func:`esp_sleep_disable_ext1_wakeup_io` 函数可用于移除 ext1 唤醒 IO。

.. only:: SOC_PM_SUPPORT_EXT1_WAKEUP_MODE_PER_PIN

Expand Down

0 comments on commit ea7cfc4

Please sign in to comment.