Fix BT init compilation error

Fixes: https://github.com/espressif/arduino-esp32/issues/309
This commit is contained in:
me-no-dev 2017-04-12 20:53:21 +03:00
parent 6519a35799
commit fd81fd0ac3

View File

@ -23,11 +23,13 @@ bool btStarted(){
} }
bool btStart(){ 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){ if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){
return true; return true;
} }
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){ 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){} while(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){}
} }
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){ if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){