arduino-esp32/cores/esp32
rgot-org cec3fca4ad Fix BluetoothSerial crash when restart (#3471)
* Update esp32-hal-bt.c

BluetoothSerial crash when restart:  this is because the BT controller remains in state  ESP_BT_CONTROLLER_STATUS_INITED instead of state  ESP_BT_CONTROLLER_STATUS_IDLE after the end() method.
in file esp_bt.h it is specified

> @brief Enable BT controller.
>                Due to a known issue, you cannot call esp_bt_controller_enable() a second time
>                 to change the controller mode dynamically. To change controller mode, call
>                esp_bt_controller_disable() and then call esp_bt_controller_enable() with the new mode.

after **esp_bt_controller_disable()** the controller remains in state INITED so we do call the **esp_bt_controller_deinit()** function to put the controller into state IDLE.

i have modified the **esp32-hal-bt.c** file
line 57 and next
(i have insert the esp_bt_controller_deinit() function so the controller go into Idle state)
```c++
bool btStop(){
    if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){
		log_i("bt stopped");
        return true;
    }
    if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED){
		log_i("bt enabled");
        if (esp_bt_controller_disable()) {
            log_e("BT Disable failed");
            return false;
        }
        while(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED);
    }
    if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){
		log_i("inited");
		if (esp_bt_controller_deinit()) {
			log_e("BT deint failed");
			return false;
		}
		while (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED);
        return true;
    }
    log_e("BT Stop failed");
    return false;
}
```

* Update esp32-hal-bt.c

remove while to avoid infinite loop
2019-11-11 18:31:09 +01:00
..
apps/sntp Update IDF to 3.2-3276a13 and esptool.py to 2.5.0 (#1878) 2018-09-21 08:39:36 +02:00
libb64 use libbase64 macro to calculate base64 length (#2007) 2018-11-19 17:01:38 +01:00
Arduino.h Use std::abs for a float-compatible abs() function (#2738) 2019-05-11 11:18:39 +03:00
base64.cpp
base64.h
binary.h
cbuf.cpp Fix cbuf not being able to hold the full length 2017-01-24 17:57:44 +02:00
cbuf.h
Client.h Remove extra connects from Client.h (#3191) 2019-09-09 09:36:22 +03:00
esp32-hal-adc.c Add Arduino SAM compatible analogReadResolution and Non-Blocking ADC api 2017-03-03 15:53:20 +02:00
esp32-hal-adc.h
esp32-hal-bt.c Fix BluetoothSerial crash when restart (#3471) 2019-11-11 18:31:09 +01:00
esp32-hal-bt.h BT define the hal methods even if BT is disabled (but return false) 2017-05-06 18:50:20 +03:00
esp32-hal-cpu.c
esp32-hal-cpu.h Handle APB frequency change (#2250) 2019-01-09 10:07:54 +01:00
esp32-hal-dac.c
esp32-hal-dac.h Missing include gpio.h in esp32-hal-dac.h (#1512) 2018-06-19 11:33:17 +03:00
esp32-hal-gpio.c
esp32-hal-gpio.h
esp32-hal-i2c.c
esp32-hal-i2c.h
esp32-hal-ledc.c
esp32-hal-ledc.h
esp32-hal-log.h
esp32-hal-matrix.c
esp32-hal-matrix.h
esp32-hal-misc.c
esp32-hal-psram.c
esp32-hal-psram.h
esp32-hal-rmt.c
esp32-hal-rmt.h
esp32-hal-sigmadelta.c
esp32-hal-sigmadelta.h
esp32-hal-spi.c SPI: Fix discarded-qalifiers warning when compiling with all warnings (#3458) 2019-11-11 17:44:49 +01:00
esp32-hal-spi.h
esp32-hal-time.c
esp32-hal-timer.c
esp32-hal-timer.h
esp32-hal-touch.c
esp32-hal-touch.h
esp32-hal-uart.c
esp32-hal-uart.h Implement Tx only Flush (#3433) 2019-11-11 15:37:35 +01:00
esp32-hal.h Allow selecting in IDF the running core for Arduino's core tasks 2019-04-13 17:13:13 +02:00
esp8266-compat.h
Esp.cpp Inline ESP::getCycleCount() to make it safe to call from ISRs (#3165) 2019-09-11 14:29:53 +03:00
Esp.h
FunctionalInterrupt.cpp
FunctionalInterrupt.h
HardwareSerial.cpp
HardwareSerial.h
IPAddress.cpp
IPAddress.h const correctness (#89) 2016-12-12 01:32:55 +02:00
IPv6Address.cpp
IPv6Address.h
main.cpp
MD5Builder.cpp
MD5Builder.h initial import 2016-10-06 07:09:44 -06:00
pgmspace.h
Print.cpp
Print.h
Printable.h
Server.h
stdlib_noniso.c
stdlib_noniso.h
Stream.cpp
Stream.h
StreamString.cpp
StreamString.h
Udp.h initial import 2016-10-06 07:09:44 -06:00
WCharacter.h
wiring_private.h
wiring_pulse.c
wiring_shift.c
WMath.cpp
WString.cpp
WString.h