mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(esp_hw_support): Fix deepsleep leakage after initializing USB HS phy
This commit is contained in:
@@ -19,6 +19,11 @@
|
||||
#include "driver/gpio.h"
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
#if SOC_USB_UTMI_PHY_NO_POWER_OFF_ISO
|
||||
#include "esp_private/sleep_usb.h"
|
||||
#include "esp_sleep.h"
|
||||
#endif
|
||||
|
||||
#if !SOC_RCC_IS_INDEPENDENT
|
||||
#define USB_PHY_RCC_ATOMIC() PERIPH_RCC_ATOMIC()
|
||||
#else
|
||||
@@ -293,6 +298,12 @@ esp_err_t usb_new_phy(const usb_phy_config_t *config, usb_phy_handle_t *handle_r
|
||||
}
|
||||
#endif
|
||||
|
||||
#if SOC_USB_UTMI_PHY_NO_POWER_OFF_ISO
|
||||
if (phy_target == USB_PHY_TARGET_UTMI) {
|
||||
esp_deep_sleep_register_hook(&sleep_usb_suppress_deepsleep_leakage);
|
||||
}
|
||||
#endif
|
||||
|
||||
ESP_RETURN_ON_FALSE(config, ESP_ERR_INVALID_ARG, USBPHY_TAG, "config argument is invalid");
|
||||
ESP_RETURN_ON_FALSE(phy_target < USB_PHY_TARGET_MAX, ESP_ERR_INVALID_ARG, USBPHY_TAG, "specified PHY argument is invalid");
|
||||
ESP_RETURN_ON_FALSE(config->controller < USB_PHY_CTRL_MAX, ESP_ERR_INVALID_ARG, USBPHY_TAG, "specified source argument is invalid");
|
||||
|
||||
Reference in New Issue
Block a user