Fix BT init compilation error
Fixes: https://github.com/espressif/arduino-esp32/issues/309
This commit is contained in:
parent
6519a35799
commit
fd81fd0ac3
@ -23,11 +23,13 @@ bool btStarted(){
|
||||
}
|
||||
|
||||
bool btStart(){
|
||||
esp_bt_controller_config_t cfg;
|
||||
memset(&cfg, 0, sizeof(esp_bt_controller_config_t));
|
||||
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){
|
||||
return true;
|
||||
}
|
||||
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){
|
||||
esp_bt_controller_init();
|
||||
esp_bt_controller_init(&cfg);
|
||||
while(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){}
|
||||
}
|
||||
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){
|
||||
|
Loading…
Reference in New Issue
Block a user