mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
refactor(rcc): unify the usage of clock control macros for peripherals
- Removed conditional definitions for various RCC_ATOMIC macros across multiple files, replacing them with a unified PERIPH_RCC_ATOMIC() macro. - Updated instances where specific RCC_ATOMIC macros were used to ensure consistent usage of PERIPH_RCC_ATOMIC(). - Deleted unused uart_share_hw_ctrl.h file as its functionality is now integrated into the new structure.
This commit is contained in:
@@ -25,12 +25,6 @@
|
||||
#include "esp_sleep.h"
|
||||
#endif
|
||||
|
||||
#if !SOC_RCC_IS_INDEPENDENT
|
||||
#define USB_PHY_RCC_ATOMIC() PERIPH_RCC_ATOMIC()
|
||||
#else
|
||||
#define USB_PHY_RCC_ATOMIC()
|
||||
#endif
|
||||
|
||||
static const char *USBPHY_TAG = "usb_phy";
|
||||
|
||||
#define USBPHY_NOT_INIT_ERR_STR "USB_PHY is not initialized"
|
||||
@@ -283,13 +277,13 @@ esp_err_t usb_new_phy(const usb_phy_config_t *config, usb_phy_handle_t *handle_r
|
||||
phy_context->status = USB_PHY_STATUS_IN_USE;
|
||||
|
||||
if (phy_target != USB_PHY_TARGET_UTMI) {
|
||||
USB_PHY_RCC_ATOMIC() {
|
||||
PERIPH_RCC_ATOMIC() {
|
||||
usb_wrap_hal_init(&phy_context->wrap_hal);
|
||||
}
|
||||
} else {
|
||||
#if (SOC_USB_UTMI_PHY_NUM > 0)
|
||||
usb_utmi_hal_context_t utmi_hal_context; // Unused for now
|
||||
USB_PHY_RCC_ATOMIC() {
|
||||
PERIPH_RCC_ATOMIC() {
|
||||
usb_utmi_hal_init(&utmi_hal_context);
|
||||
}
|
||||
#endif
|
||||
@@ -349,7 +343,7 @@ static void phy_uninstall(void)
|
||||
if (p_phy_ctrl_obj->ref_count == 0) {
|
||||
p_phy_ctrl_obj_free = p_phy_ctrl_obj;
|
||||
p_phy_ctrl_obj = NULL;
|
||||
USB_PHY_RCC_ATOMIC() {
|
||||
PERIPH_RCC_ATOMIC() {
|
||||
// Disable USB peripheral without reset the module
|
||||
usb_wrap_hal_disable();
|
||||
#if (SOC_USB_UTMI_PHY_NUM > 0)
|
||||
|
||||
Reference in New Issue
Block a user