From 0bbc2805fc54ed81a4024dd5fd144215c7ca8cca Mon Sep 17 00:00:00 2001 From: zwl Date: Fri, 1 Sep 2023 18:08:33 +0800 Subject: [PATCH] fix(phy): Fix ble phy_enable/disable api invoking issue for esp32c2,esp32h2 and esp32c6 --- components/bt/controller/esp32c2/bt.c | 12 ++++++------ components/bt/controller/esp32c6/bt.c | 10 +++++----- components/bt/controller/esp32h2/bt.c | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/components/bt/controller/esp32c2/bt.c b/components/bt/controller/esp32c2/bt.c index 38ce336250..25c585bd34 100644 --- a/components/bt/controller/esp32c2/bt.c +++ b/components/bt/controller/esp32c2/bt.c @@ -240,7 +240,7 @@ struct ext_funcs_t ext_funcs_ro = { ._ecc_gen_key_pair = esp_ecc_gen_key_pair, ._ecc_gen_dh_key = esp_ecc_gen_dh_key, ._esp_reset_rpa_moudle = esp_reset_rpa_moudle, - ._esp_bt_track_pll_cap = bt_track_pll_cap, + ._esp_bt_track_pll_cap = NULL, .magic = EXT_FUNC_MAGIC_VALUE, }; @@ -465,7 +465,7 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg) r_ble_rtc_wake_up_state_clr(); esp_pm_lock_release(s_pm_lock); #endif // CONFIG_PM_ENABLE - esp_phy_disable(); + esp_phy_disable(PHY_MODEM_BT); s_ble_active = false; } @@ -474,7 +474,7 @@ IRAM_ATTR void controller_wakeup_cb(void *arg) if (s_ble_active) { return; } - esp_phy_enable(); + esp_phy_enable(PHY_MODEM_BT); // need to check if need to call pm lock here #ifdef CONFIG_PM_ENABLE esp_pm_lock_acquire(s_pm_lock); @@ -750,7 +750,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode) esp_pm_lock_acquire(s_pm_lock); #endif // CONFIG_PM_ENABLE // init phy - esp_phy_enable(); + esp_phy_enable(PHY_MODEM_BT); s_ble_active = true; } // init bb @@ -772,7 +772,7 @@ error: coex_disable(); #endif if (s_ble_active) { - esp_phy_disable(); + esp_phy_disable(PHY_MODEM_BT); #if CONFIG_PM_ENABLE esp_pm_lock_release(s_pm_lock); #endif // CONFIG_PM_ENABLE @@ -792,7 +792,7 @@ esp_err_t esp_bt_controller_disable(void) } if (s_ble_active) { - esp_phy_disable(); + esp_phy_disable(PHY_MODEM_BT); #if CONFIG_PM_ENABLE esp_pm_lock_release(s_pm_lock); #endif // CONFIG_PM_ENABLE diff --git a/components/bt/controller/esp32c6/bt.c b/components/bt/controller/esp32c6/bt.c index 49d5050c19..4b7c517511 100644 --- a/components/bt/controller/esp32c6/bt.c +++ b/components/bt/controller/esp32c6/bt.c @@ -487,7 +487,7 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg) sleep_retention_do_extra_retention(true); #endif // SOC_PM_RETENTION_HAS_CLOCK_BUG #endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */ - esp_phy_disable(); + esp_phy_disable(PHY_MODEM_BT); #ifdef CONFIG_PM_ENABLE esp_pm_lock_release(s_pm_lock); #endif // CONFIG_PM_ENABLE @@ -506,7 +506,7 @@ IRAM_ATTR void controller_wakeup_cb(void *arg) sleep_retention_do_extra_retention(false); #endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE && SOC_PM_RETENTION_HAS_CLOCK_BUG */ #endif //CONFIG_PM_ENABLE - esp_phy_enable(); + esp_phy_enable(PHY_MODEM_BT); s_ble_active = true; } @@ -889,7 +889,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode) #if CONFIG_PM_ENABLE esp_pm_lock_acquire(s_pm_lock); #endif // CONFIG_PM_ENABLE - esp_phy_enable(); + esp_phy_enable(PHY_MODEM_BT); esp_btbb_enable(); s_ble_active = true; } @@ -910,7 +910,7 @@ error: #endif if (s_ble_active) { esp_btbb_disable(); - esp_phy_disable(); + esp_phy_disable(PHY_MODEM_BT); #if CONFIG_PM_ENABLE esp_pm_lock_release(s_pm_lock); #endif // CONFIG_PM_ENABLE @@ -933,7 +933,7 @@ esp_err_t esp_bt_controller_disable(void) #endif if (s_ble_active) { esp_btbb_disable(); - esp_phy_disable(); + esp_phy_disable(PHY_MODEM_BT); #if CONFIG_PM_ENABLE esp_pm_lock_release(s_pm_lock); #endif // CONFIG_PM_ENABLE diff --git a/components/bt/controller/esp32h2/bt.c b/components/bt/controller/esp32h2/bt.c index 1336dd222c..99a33f6ede 100644 --- a/components/bt/controller/esp32h2/bt.c +++ b/components/bt/controller/esp32h2/bt.c @@ -473,7 +473,7 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg) #if CONFIG_FREERTOS_USE_TICKLESS_IDLE r_ble_rtc_wake_up_state_clr(); #endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */ - esp_phy_disable(); + esp_phy_disable(PHY_MODEM_BT); #ifdef CONFIG_PM_ENABLE esp_pm_lock_release(s_pm_lock); #endif // CONFIG_PM_ENABLE @@ -489,7 +489,7 @@ IRAM_ATTR void controller_wakeup_cb(void *arg) esp_pm_lock_acquire(s_pm_lock); r_ble_rtc_wake_up_state_clr(); #endif //CONFIG_PM_ENABLE - esp_phy_enable(); + esp_phy_enable(PHY_MODEM_BT); s_ble_active = true; } @@ -867,7 +867,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode) #if CONFIG_PM_ENABLE esp_pm_lock_acquire(s_pm_lock); #endif // CONFIG_PM_ENABLE - esp_phy_enable(); + esp_phy_enable(PHY_MODEM_BT); s_ble_active = true; } esp_btbb_enable(); @@ -888,7 +888,7 @@ error: #endif esp_btbb_disable(); if (s_ble_active) { - esp_phy_disable(); + esp_phy_disable(PHY_MODEM_BT); #if CONFIG_PM_ENABLE esp_pm_lock_release(s_pm_lock); #endif // CONFIG_PM_ENABLE @@ -911,7 +911,7 @@ esp_err_t esp_bt_controller_disable(void) #endif esp_btbb_disable(); if (s_ble_active) { - esp_phy_disable(); + esp_phy_disable(PHY_MODEM_BT); #if CONFIG_PM_ENABLE esp_pm_lock_release(s_pm_lock); #endif // CONFIG_PM_ENABLE