mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
fix(gpio): Revert the fix for RTCIO config should be written if LPIO clk exists
revert the main logic in acb49e9520
The fix causes deep sleep wakeup IO unable to reset back to GPIO after
waking up from deep sleep.
This commit is contained in:
@@ -457,6 +457,9 @@ esp_err_t gpio_config_as_analog(gpio_num_t gpio_num)
|
|||||||
#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
|
#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
|
||||||
if (rtc_gpio_is_valid_gpio(gpio_num)) {
|
if (rtc_gpio_is_valid_gpio(gpio_num)) {
|
||||||
rtc_gpio_deinit(gpio_num);
|
rtc_gpio_deinit(gpio_num);
|
||||||
|
rtc_gpio_set_direction(gpio_num, RTC_GPIO_MODE_DISABLED);
|
||||||
|
rtc_gpio_pullup_dis(gpio_num);
|
||||||
|
rtc_gpio_pulldown_dis(gpio_num);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
|
|||||||
@@ -64,19 +64,12 @@ esp_err_t rtc_gpio_deinit(gpio_num_t gpio_num)
|
|||||||
{
|
{
|
||||||
ESP_RETURN_ON_FALSE(rtc_gpio_is_valid_gpio(gpio_num), ESP_ERR_INVALID_ARG, RTCIO_TAG, "RTCIO number error");
|
ESP_RETURN_ON_FALSE(rtc_gpio_is_valid_gpio(gpio_num), ESP_ERR_INVALID_ARG, RTCIO_TAG, "RTCIO number error");
|
||||||
RTCIO_ENTER_CRITICAL();
|
RTCIO_ENTER_CRITICAL();
|
||||||
if (io_mux_is_lp_io_in_use(gpio_num)) {
|
// Select GPIO as Digital GPIO
|
||||||
// Select GPIO as Digital GPIO
|
rtcio_hal_function_select(rtc_io_number_get(gpio_num), RTCIO_LL_FUNC_DIGITAL);
|
||||||
rtcio_hal_function_select(rtc_io_number_get(gpio_num), RTCIO_LL_FUNC_DIGITAL);
|
// TODO: IDF-14951 Turning off the lp io clock might affect other lp peripherals. Temporary disabled.
|
||||||
#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
|
#if SOC_LP_IO_CLOCK_IS_INDEPENDENT && !CONFIG_IDF_TARGET_ESP32H4
|
||||||
// Disable any configuration of the RTC IO that may affect the GPIO behavior
|
io_mux_force_disable_lp_io_clock(gpio_num);
|
||||||
rtc_gpio_set_direction(gpio_num, RTC_GPIO_MODE_DISABLED);
|
|
||||||
rtc_gpio_pullup_dis(gpio_num);
|
|
||||||
rtc_gpio_pulldown_dis(gpio_num);
|
|
||||||
#endif
|
#endif
|
||||||
#if SOC_LP_IO_CLOCK_IS_INDEPENDENT
|
|
||||||
io_mux_force_disable_lp_io_clock(gpio_num);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
RTCIO_EXIT_CRITICAL();
|
RTCIO_EXIT_CRITICAL();
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user