cec3fca4ad
* 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 |
||
---|---|---|
.. | ||
apps/sntp | ||
libb64 | ||
Arduino.h | ||
base64.cpp | ||
base64.h | ||
binary.h | ||
cbuf.cpp | ||
cbuf.h | ||
Client.h | ||
esp32-hal-adc.c | ||
esp32-hal-adc.h | ||
esp32-hal-bt.c | ||
esp32-hal-bt.h | ||
esp32-hal-cpu.c | ||
esp32-hal-cpu.h | ||
esp32-hal-dac.c | ||
esp32-hal-dac.h | ||
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 | ||
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 | ||
esp32-hal.h | ||
esp8266-compat.h | ||
Esp.cpp | ||
Esp.h | ||
FunctionalInterrupt.cpp | ||
FunctionalInterrupt.h | ||
HardwareSerial.cpp | ||
HardwareSerial.h | ||
IPAddress.cpp | ||
IPAddress.h | ||
IPv6Address.cpp | ||
IPv6Address.h | ||
main.cpp | ||
MD5Builder.cpp | ||
MD5Builder.h | ||
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 | ||
WCharacter.h | ||
wiring_private.h | ||
wiring_pulse.c | ||
wiring_shift.c | ||
WMath.cpp | ||
WString.cpp | ||
WString.h |