Enable bluetooth after boot, not during boot
This avoids some bluetooth-related devices being delivered before BootComplete
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user