From 610991455d335663de1dd6c0c6a3e0247ffd46df Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 7 Jun 2023 09:50:25 +1000 Subject: R4 pre-emptive bringup Includes stripping out the IC-specific I2S stuff, and doing more manual volume control using pots --- src/system_fsm/booting.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/system_fsm/booting.cpp') diff --git a/src/system_fsm/booting.cpp b/src/system_fsm/booting.cpp index b14da10c..e18a8e8d 100644 --- a/src/system_fsm/booting.cpp +++ b/src/system_fsm/booting.cpp @@ -63,14 +63,12 @@ auto Booting::entry() -> void { // booting. We will transition to the error state if these aren't present. ESP_LOGI(kTag, "installing required drivers"); sSamd.reset(drivers::Samd::Create()); - auto dac_res = drivers::AudioDac::create(sGpioExpander.get()); - if (dac_res.has_error() || !sSamd || !sRelativeTouch) { + if (!sSamd || !sRelativeTouch) { events::Dispatch( FatalError()); return; } - sDac.reset(dac_res.value()); // These drivers are initialised on boot, but are recoverable (if weird) if // they fail. @@ -79,7 +77,11 @@ auto Booting::entry() -> void { // All drivers are now loaded, so we can finish initing the other state // machines. - audio::AudioState::Init(sGpioExpander.get(), sDac, sDatabase); + if (!audio::AudioState::Init(sGpioExpander.get(), sDatabase)) { + events::Dispatch( + FatalError()); + return; + } events::Dispatch( BootComplete()); -- cgit v1.2.3