Enable bluetooth after boot, not during boot

This avoids some bluetooth-related devices being delivered before
BootComplete
This commit is contained in:
jacqueline
2024-04-23 10:19:25 +10:00
parent 84dbe074c5
commit 531475e351
2 changed files with 2 additions and 6 deletions
+2
View File
@@ -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);
-6
View File
@@ -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);