summaryrefslogtreecommitdiff
path: root/src/system_fsm/booting.cpp
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2023-07-08 12:58:07 +1000
committerailurux <ailuruxx@gmail.com>2023-07-08 12:58:07 +1000
commit3de310f6e4c170c4c4bfb789cb07ca10e5ab17b8 (patch)
tree0d13d6efa758b8c029a35c73405529dcadde3788 /src/system_fsm/booting.cpp
parentdaa3013836d619d920db3a9dc1f9cc988047a4b4 (diff)
parent8f8bc1f088b389a683735d626cbce9adb1f6dc17 (diff)
downloadtangara-fw-3de310f6e4c170c4c4bfb789cb07ca10e5ab17b8.tar.gz
Merge branch 'main' of git.sr.ht:~jacqueline/tangara-fw
Diffstat (limited to 'src/system_fsm/booting.cpp')
-rw-r--r--src/system_fsm/booting.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/system_fsm/booting.cpp b/src/system_fsm/booting.cpp
index dcfefbab..48b027d2 100644
--- a/src/system_fsm/booting.cpp
+++ b/src/system_fsm/booting.cpp
@@ -17,6 +17,7 @@
#include "spi.hpp"
#include "system_events.hpp"
#include "system_fsm.hpp"
+#include "track_queue.hpp"
#include "ui_fsm.hpp"
#include "i2c.hpp"
@@ -48,8 +49,9 @@ auto Booting::entry() -> void {
sGpios->set_listener(&sGpiosCallback);
// Start bringing up LVGL now, since we have all of its prerequisites.
+ sTrackQueue.reset(new audio::TrackQueue());
ESP_LOGI(kTag, "starting ui");
- if (!ui::UiState::Init(sGpios.get())) {
+ if (!ui::UiState::Init(sGpios.get(), sTrackQueue.get())) {
events::Dispatch<FatalError, SystemState, ui::UiState, audio::AudioState>(
FatalError());
return;
@@ -70,7 +72,7 @@ auto Booting::entry() -> void {
// state machines and inform them that the system is ready.
ESP_LOGI(kTag, "starting audio");
- if (!audio::AudioState::Init(sGpios.get(), sDatabase)) {
+ if (!audio::AudioState::Init(sGpios.get(), sDatabase, sTrackQueue.get())) {
events::Dispatch<FatalError, SystemState, ui::UiState, audio::AudioState>(
FatalError());
return;
@@ -83,6 +85,7 @@ auto Booting::entry() -> void {
auto Booting::exit() -> void {
// TODO(jacqueline): Gate this on something. Debug flag? Flashing mode?
sAppConsole = new console::AppConsole();
+ sAppConsole->sTrackQueue = sTrackQueue.get();
sAppConsole->Launch();
}