summaryrefslogtreecommitdiff
path: root/src/system_fsm
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-01-17 11:48:40 +1100
committerjacqueline <me@jacqueline.id.au>2024-01-17 11:48:40 +1100
commit71b46730394979ea528d152dbe884cc35c368759 (patch)
tree516b3af32f8822a5f900ea10fd6ffba2e3de1ebb /src/system_fsm
parent7cdcd44e0ca10ebdc796638190ed1d9b45d99ef0 (diff)
downloadtangara-fw-71b46730394979ea528d152dbe884cc35c368759.tar.gz
all screens basically working, but bluetooth is rough
Diffstat (limited to 'src/system_fsm')
-rw-r--r--src/system_fsm/CMakeLists.txt6
-rw-r--r--src/system_fsm/booting.cpp4
-rw-r--r--src/system_fsm/include/system_events.hpp5
3 files changed, 9 insertions, 6 deletions
diff --git a/src/system_fsm/CMakeLists.txt b/src/system_fsm/CMakeLists.txt
index 8535a0e7..e98d4653 100644
--- a/src/system_fsm/CMakeLists.txt
+++ b/src/system_fsm/CMakeLists.txt
@@ -3,7 +3,9 @@
# SPDX-License-Identifier: GPL-3.0-only
idf_component_register(
- SRCS "system_fsm.cpp" "running.cpp" "booting.cpp" "idle.cpp" "service_locator.cpp"
+ SRCS "system_fsm.cpp" "running.cpp" "booting.cpp" "idle.cpp"
+ "service_locator.cpp"
INCLUDE_DIRS "include"
- REQUIRES "tinyfsm" "drivers" "database" "ui" "result" "events" "audio" "app_console" "battery" "locale")
+ REQUIRES "tinyfsm" "drivers" "database" "ui" "result" "events" "audio"
+ "app_console" "battery" "locale")
target_compile_options(${COMPONENT_LIB} PRIVATE ${EXTRA_WARNINGS})
diff --git a/src/system_fsm/booting.cpp b/src/system_fsm/booting.cpp
index 7bc92a17..898eb6aa 100644
--- a/src/system_fsm/booting.cpp
+++ b/src/system_fsm/booting.cpp
@@ -46,9 +46,7 @@ namespace states {
[[maybe_unused]] static const char kTag[] = "BOOT";
static auto bt_event_cb(drivers::bluetooth::Event ev) -> void {
- if (ev == drivers::bluetooth::Event::kKnownDevicesChanged) {
- events::Ui().Dispatch(BluetoothDevicesChanged{});
- }
+ events::Ui().Dispatch(BluetoothEvent{.event = ev});
}
static const TickType_t kInterruptCheckPeriod = pdMS_TO_TICKS(100);
diff --git a/src/system_fsm/include/system_events.hpp b/src/system_fsm/include/system_events.hpp
index 4ead9f2f..54e0aa9c 100644
--- a/src/system_fsm/include/system_events.hpp
+++ b/src/system_fsm/include/system_events.hpp
@@ -9,6 +9,7 @@
#include <memory>
#include "battery.hpp"
+#include "bluetooth_types.hpp"
#include "database.hpp"
#include "haptics.hpp"
#include "service_locator.hpp"
@@ -54,7 +55,9 @@ struct BatteryStateChanged : tinyfsm::Event {
battery::Battery::BatteryState new_state;
};
-struct BluetoothDevicesChanged : tinyfsm::Event {};
+struct BluetoothEvent : tinyfsm::Event {
+ drivers::bluetooth::Event event;
+};
struct HapticTrigger : tinyfsm::Event {
drivers::Haptics::Effect effect;