diff options
Diffstat (limited to 'src/system_fsm/system_fsm.cpp')
| -rw-r--r-- | src/system_fsm/system_fsm.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/system_fsm/system_fsm.cpp b/src/system_fsm/system_fsm.cpp index ca191324..9cca7eda 100644 --- a/src/system_fsm/system_fsm.cpp +++ b/src/system_fsm/system_fsm.cpp @@ -6,6 +6,7 @@ #include "system_fsm.hpp" #include "audio_fsm.hpp" +#include "driver/gpio.h" #include "event_queue.hpp" #include "gpios.hpp" #include "relative_wheel.hpp" @@ -23,6 +24,15 @@ std::unique_ptr<drivers::SdStorage> SystemState::sStorage; console::AppConsole* SystemState::sAppConsole; +void check_interrupts_cb(TimerHandle_t timer) { + if (!gpio_get_level(GPIO_NUM_34)) { + events::System().Dispatch(internal::GpioInterrupt{}); + } + if (!gpio_get_level(GPIO_NUM_35)) { + events::System().Dispatch(internal::SamdInterrupt{}); + } +} + void SystemState::react(const FatalError& err) { if (!is_in_state<states::Error>()) { transit<states::Error>(); |
