summaryrefslogtreecommitdiff
path: root/src/system_fsm/booting.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-11-24 07:18:14 +1100
committerjacqueline <me@jacqueline.id.au>2023-11-24 07:41:48 +1100
commit230721cd6271f3239b42e1d2471f8db15bebd712 (patch)
treecc27ec975261742dca8c9acf87b806f5933faae8 /src/system_fsm/booting.cpp
parent2b095948b81cbde28ac84e7a572d472301a50af1 (diff)
downloadtangara-fw-230721cd6271f3239b42e1d2471f8db15bebd712.tar.gz
Periodically check int lines instead of relying on interrupts
Diffstat (limited to 'src/system_fsm/booting.cpp')
-rw-r--r--src/system_fsm/booting.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/system_fsm/booting.cpp b/src/system_fsm/booting.cpp
index e7080e9b..c9a0a2d2 100644
--- a/src/system_fsm/booting.cpp
+++ b/src/system_fsm/booting.cpp
@@ -51,6 +51,8 @@ static auto bt_event_cb(drivers::bluetooth::Event ev) -> void {
}
}
+static const TickType_t kInterruptCheckPeriod = pdMS_TO_TICKS(100);
+
auto Booting::entry() -> void {
ESP_LOGI(kTag, "beginning tangara boot");
sServices.reset(new ServiceLocator());
@@ -109,6 +111,10 @@ auto Booting::exit() -> void {
sAppConsole = new console::AppConsole();
sAppConsole->sServices = sServices;
sAppConsole->Launch();
+
+ TimerHandle_t timer = xTimerCreate("INTERRUPTS", kInterruptCheckPeriod, true,
+ NULL, check_interrupts_cb);
+ xTimerStart(timer, portMAX_DELAY);
}
auto Booting::react(const BootComplete& ev) -> void {