mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(wifi): fix deinit init wifi scan fail issue
This commit is contained in:
parent
4d0d0f5d10
commit
9583c45947
@ -325,14 +325,18 @@ void IRAM_ATTR esp_wifi_bt_power_domain_on(void)
|
|||||||
_lock_acquire(&s_wifi_bt_pd_controller.lock);
|
_lock_acquire(&s_wifi_bt_pd_controller.lock);
|
||||||
if (s_wifi_bt_pd_controller.count++ == 0) {
|
if (s_wifi_bt_pd_controller.count++ == 0) {
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_PWC_REG, RTC_CNTL_WIFI_FORCE_PD);
|
||||||
|
esp_rom_delay_us(10);
|
||||||
#if !CONFIG_IDF_TARGET_ESP32
|
wifi_bt_common_module_enable();
|
||||||
|
#if CONFIG_IDF_TARGET_ESP32
|
||||||
|
DPORT_SET_PERI_REG_MASK(DPORT_CORE_RST_EN_REG, MODEM_RESET_FIELD_WHEN_PU);
|
||||||
|
DPORT_CLEAR_PERI_REG_MASK(DPORT_CORE_RST_EN_REG, MODEM_RESET_FIELD_WHEN_PU);
|
||||||
|
#else
|
||||||
// modem reset when power on
|
// modem reset when power on
|
||||||
SET_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, MODEM_RESET_FIELD_WHEN_PU);
|
SET_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, MODEM_RESET_FIELD_WHEN_PU);
|
||||||
CLEAR_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, MODEM_RESET_FIELD_WHEN_PU);
|
CLEAR_PERI_REG_MASK(SYSCON_WIFI_RST_EN_REG, MODEM_RESET_FIELD_WHEN_PU);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_ISO);
|
CLEAR_PERI_REG_MASK(RTC_CNTL_DIG_ISO_REG, RTC_CNTL_WIFI_FORCE_ISO);
|
||||||
|
wifi_bt_common_module_disable();
|
||||||
}
|
}
|
||||||
_lock_release(&s_wifi_bt_pd_controller.lock);
|
_lock_release(&s_wifi_bt_pd_controller.lock);
|
||||||
#endif // !SOC_PMU_SUPPORTED
|
#endif // !SOC_PMU_SUPPORTED
|
||||||
|
@ -1077,8 +1077,10 @@
|
|||||||
#define DPORT_RW_BTMAC_RST BIT(9)
|
#define DPORT_RW_BTMAC_RST BIT(9)
|
||||||
#define DPORT_RW_BTLP_RST BIT(10)
|
#define DPORT_RW_BTLP_RST BIT(10)
|
||||||
|
|
||||||
|
//ESP32 should not reset FE in esp_wifi_bt_power_domain_on().
|
||||||
|
//The FE of ESP32 is not in the WIFI PD power domain.
|
||||||
|
//When turning off WIFI PD, the FE will not power down, so phy_wakeup_init() did not rewrite the FE register.
|
||||||
#define MODEM_RESET_FIELD_WHEN_PU (DPORT_WIFIBB_RST | \
|
#define MODEM_RESET_FIELD_WHEN_PU (DPORT_WIFIBB_RST | \
|
||||||
DPORT_FE_RST | \
|
|
||||||
DPORT_WIFIMAC_RST | \
|
DPORT_WIFIMAC_RST | \
|
||||||
DPORT_BTBB_RST | \
|
DPORT_BTBB_RST | \
|
||||||
DPORT_BTMAC_RST | \
|
DPORT_BTMAC_RST | \
|
||||||
|
@ -443,7 +443,8 @@ extern "C" {
|
|||||||
#define DPORT_WIFI_CLK_BT_EN_V 0x61
|
#define DPORT_WIFI_CLK_BT_EN_V 0x61
|
||||||
#define DPORT_WIFI_CLK_BT_EN_S 11
|
#define DPORT_WIFI_CLK_BT_EN_S 11
|
||||||
/* Mask for clock bits used by both WIFI and Bluetooth, bit 0, 3, 6, 7, 8, 9 */
|
/* Mask for clock bits used by both WIFI and Bluetooth, bit 0, 3, 6, 7, 8, 9 */
|
||||||
#define DPORT_WIFI_CLK_WIFI_BT_COMMON_M 0x000003c9
|
#define SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M 0x000003c9
|
||||||
|
#define DPORT_WIFI_CLK_WIFI_BT_COMMON_M SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M
|
||||||
|
|
||||||
/* Digital team to check */
|
/* Digital team to check */
|
||||||
//bluetooth baseband bit11
|
//bluetooth baseband bit11
|
||||||
|
Loading…
Reference in New Issue
Block a user