Merge branch 'bugfix/fix_lightsleep_current_leakage_on_usj_pad' into 'master'
fix(esp_hw_support): fix lightsleep current leakage on usb pad Closes IDF-6154 and PM-18 See merge request espressif/esp-idf!26470
This commit is contained in:
@@ -15,7 +15,15 @@
|
||||
#include "esp_intr_alloc.h"
|
||||
#include "driver/usb_serial_jtag.h"
|
||||
#include "soc/periph_defs.h"
|
||||
#include "soc/soc_caps.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
|
||||
#if !SOC_RCC_IS_INDEPENDENT
|
||||
#define USJ_RCC_ATOMIC() PERIPH_RCC_ATOMIC()
|
||||
#else
|
||||
#define USJ_RCC_ATOMIC()
|
||||
#endif
|
||||
|
||||
// The hardware buffer max size is 64
|
||||
#define USB_SER_JTAG_ENDP_SIZE (64)
|
||||
@@ -151,6 +159,11 @@ esp_err_t usb_serial_jtag_driver_install(usb_serial_jtag_driver_config_t *usb_se
|
||||
goto _exit;
|
||||
}
|
||||
|
||||
// Enable USB-Serial-JTAG peripheral module clock
|
||||
USJ_RCC_ATOMIC() {
|
||||
usb_serial_jtag_ll_enable_bus_clock(true);
|
||||
}
|
||||
|
||||
// Configure PHY
|
||||
usb_phy_ll_int_jtag_enable(&USB_SERIAL_JTAG);
|
||||
|
||||
@@ -214,6 +227,7 @@ esp_err_t usb_serial_jtag_driver_uninstall(void)
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
/* Not disable the module clock and usb_pad_enable here since the USJ stdout might still depends on it. */
|
||||
//Disable tx/rx interrupt.
|
||||
usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT);
|
||||
esp_intr_free(p_usb_serial_jtag_obj->intr_handle);
|
||||
|
||||
Reference in New Issue
Block a user