Enable bluetooth after boot, not during boot

This avoids some bluetooth-related devices being delivered before
BootComplete
custom
jacqueline 1 year ago
parent 84dbe074c5
commit 531475e351
  1. 2
      src/audio/audio_fsm.cpp
  2. 6
      src/system_fsm/booting.cpp

@ -442,6 +442,8 @@ void Uninitialised::react(const system_fsm::BootComplete& ev) {
drivers::NvsStorage::Output::kHeadphones) {
sOutput = sI2SOutput;
} else {
// Ensure Bluetooth gets enabled if it's the default sink.
sServices->bluetooth().Enable();
sOutput = sBtOutput;
}
sOutput->mode(IAudioOutput::Modes::kOnPaused);

@ -109,12 +109,6 @@ auto Booting::entry() -> void {
sServices->nvs(), sServices->bg_worker()));
sServices->bluetooth().SetEventHandler(bt_event_cb);
if (sServices->nvs().OutputMode() ==
drivers::NvsStorage::Output::kBluetooth) {
ESP_LOGI(kTag, "enabling bluetooth");
sServices->bluetooth().Enable();
}
BootComplete ev{.services = sServices};
events::Audio().Dispatch(ev);
events::Ui().Dispatch(ev);

Loading…
Cancel
Save