diff --git a/include/AppState.h b/include/AppState.h index fea7e40..9bbb8ac 100644 --- a/include/AppState.h +++ b/include/AppState.h @@ -35,6 +35,7 @@ public: private: void unmarshal_mission_select(uint8_t* data); + void unmarshal_ami(uint8_t* data); // This is optional so that we can still run the code on a PC without I2C std::optional i2c_dev_file; diff --git a/src/AppState.cpp b/src/AppState.cpp index 8002b0d..ab8a611 100644 --- a/src/AppState.cpp +++ b/src/AppState.cpp @@ -92,6 +92,9 @@ void AppState::poll() { case AppView::MISSION_SELECT: unmarshal_mission_select(data); break; + case AppView::AMI: + unmarshal_ami(data); + break; default: throw std::runtime_error(fmt::format("Unknown view: {}", view)); } @@ -104,4 +107,9 @@ Mission AppState::get_mission() const { return mission; } void AppState::unmarshal_mission_select(uint8_t* data) { mission = static_cast(data[1]); spdlog::info("Mission after poll: {}", mission); +} + +void AppState::unmarshal_ami(uint8_t* data) { + mission = static_cast(data[1]); + spdlog::info("Mission after poll: {}", mission); } \ No newline at end of file