deinit Bluetooth while device starts if not compiled
This commit is contained in:
parent
9e079fe642
commit
ad33f8fc76
@ -272,7 +272,7 @@ void stop_BLEscan(void) {
|
||||
ESP_ERROR_CHECK(esp_ble_gap_register_callback(NULL));
|
||||
ESP_ERROR_CHECK(esp_bluedroid_disable());
|
||||
ESP_ERROR_CHECK(esp_bluedroid_deinit());
|
||||
btStop(); // disable & deinit bt_controller
|
||||
btStop(); // disable bt_controller
|
||||
ESP_ERROR_CHECK(esp_coex_preference_set((
|
||||
esp_coex_prefer_t)ESP_COEX_PREFER_WIFI)); // configure Wifi/BT coexist lib
|
||||
ESP_LOGI(TAG, "Bluetooth scanner stopped");
|
||||
|
@ -176,7 +176,14 @@ void setup() {
|
||||
} else
|
||||
btStop();
|
||||
#else
|
||||
// remove bluetooth stack to gain more free memory
|
||||
ESP_ERROR_CHECK(esp_bluedroid_disable());
|
||||
ESP_ERROR_CHECK(esp_bluedroid_deinit());
|
||||
btStop();
|
||||
ESP_ERROR_CHECK(esp_bt_controller_deinit());
|
||||
ESP_ERROR_CHECK(esp_bt_mem_release(ESP_BT_MODE_BTDM));
|
||||
ESP_ERROR_CHECK(esp_coex_preference_set((
|
||||
esp_coex_prefer_t)ESP_COEX_PREFER_WIFI)); // configure Wifi/BT coexist lib
|
||||
#endif
|
||||
|
||||
// initialize button
|
||||
|
Loading…
Reference in New Issue
Block a user