mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'ble_dev/added_modem_reset_on_ble' into 'master'
feat(ble): added modem reset on c2 h2 and c6 See merge request espressif/esp-idf!26387
This commit is contained in:
commit
83943ed3c4
@ -628,6 +628,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
|||||||
#endif
|
#endif
|
||||||
esp_phy_modem_init();
|
esp_phy_modem_init();
|
||||||
periph_module_enable(PERIPH_BT_MODULE);
|
periph_module_enable(PERIPH_BT_MODULE);
|
||||||
|
periph_module_reset(PERIPH_BT_MODULE);
|
||||||
|
|
||||||
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
|
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
|
||||||
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "osi coex funcs reg failed");
|
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "osi coex funcs reg failed");
|
||||||
@ -685,6 +686,7 @@ controller_init_err:
|
|||||||
ble_controller_deinit();
|
ble_controller_deinit();
|
||||||
modem_deint:
|
modem_deint:
|
||||||
esp_phy_modem_deinit();
|
esp_phy_modem_deinit();
|
||||||
|
periph_module_disable(PERIPH_BT_MODULE);
|
||||||
#if CONFIG_BT_NIMBLE_ENABLED
|
#if CONFIG_BT_NIMBLE_ENABLED
|
||||||
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
|
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
|
||||||
#endif // CONFIG_BT_NIMBLE_ENABLED
|
#endif // CONFIG_BT_NIMBLE_ENABLED
|
||||||
@ -711,6 +713,8 @@ esp_err_t esp_bt_controller_deinit(void)
|
|||||||
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
|
||||||
ble_controller_deinit();
|
ble_controller_deinit();
|
||||||
|
|
||||||
|
periph_module_disable(PERIPH_BT_MODULE);
|
||||||
|
|
||||||
#if CONFIG_BT_NIMBLE_ENABLED
|
#if CONFIG_BT_NIMBLE_ENABLED
|
||||||
/* De-initialize default event queue */
|
/* De-initialize default event queue */
|
||||||
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
|
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
|
||||||
|
@ -725,6 +725,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
|||||||
#endif // CONFIG_BT_NIMBLE_ENABLED
|
#endif // CONFIG_BT_NIMBLE_ENABLED
|
||||||
/* Enable BT-related clocks */
|
/* Enable BT-related clocks */
|
||||||
modem_clock_module_enable(PERIPH_BT_MODULE);
|
modem_clock_module_enable(PERIPH_BT_MODULE);
|
||||||
|
modem_clock_module_mac_reset(PERIPH_BT_MODULE);
|
||||||
/* Select slow clock source for BT momdule */
|
/* Select slow clock source for BT momdule */
|
||||||
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
|
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
|
||||||
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
|
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
|
||||||
|
@ -707,6 +707,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
|
|||||||
|
|
||||||
/* Enable BT-related clocks */
|
/* Enable BT-related clocks */
|
||||||
modem_clock_module_enable(PERIPH_BT_MODULE);
|
modem_clock_module_enable(PERIPH_BT_MODULE);
|
||||||
|
modem_clock_module_mac_reset(PERIPH_BT_MODULE);
|
||||||
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
|
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
|
||||||
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
|
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
|
||||||
slow_clk_freq = 100000;
|
slow_clk_freq = 100000;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user