Skip to content

Commit c142ce8

Browse files
committed
Do not set callback to nullptr
When radio disconnects(), it calls the callback, and if its set to nullptr, ESP32 resets.
1 parent 727f691 commit c142ce8

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

Firmware/RTK_Everywhere/Bluetooth.ino

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,26 +435,22 @@ void bluetoothStop()
435435
{
436436
if (settings.bluetoothRadioType == BLUETOOTH_RADIO_SPP_AND_BLE)
437437
{
438-
bluetoothSerialBle->register_callback(nullptr);
439438
bluetoothSerialBle->flush(); // Complete any transfers
440439
bluetoothSerialBle->disconnect(); // Drop any clients
441440
bluetoothSerialBle->end(); // Release resources
442441

443-
bluetoothSerialSpp->register_callback(nullptr);
444442
bluetoothSerialSpp->flush(); // Complete any transfers
445443
bluetoothSerialSpp->disconnect(); // Drop any clients
446444
bluetoothSerialSpp->end(); // Release resources
447445
}
448446
else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_SPP)
449447
{
450-
bluetoothSerialSpp->register_callback(nullptr);
451448
bluetoothSerialSpp->flush(); // Complete any transfers
452449
bluetoothSerialSpp->disconnect(); // Drop any clients
453450
bluetoothSerialSpp->end(); // Release resources
454451
}
455452
else if (settings.bluetoothRadioType == BLUETOOTH_RADIO_BLE)
456453
{
457-
bluetoothSerialBle->register_callback(nullptr);
458454
bluetoothSerialBle->flush(); // Complete any transfers
459455
bluetoothSerialBle->disconnect(); // Drop any clients
460456
bluetoothSerialBle->end(); // Release resources

0 commit comments

Comments
 (0)