diff --git a/Core/Inc/rpi.h b/Core/Inc/rpi.h index c51c892..8e55154 100644 --- a/Core/Inc/rpi.h +++ b/Core/Inc/rpi.h @@ -29,5 +29,6 @@ void rpi_init(I2C_HandleTypeDef *handle); void rpi_update_tx_buffer(); void rpi_update_tx_buffer_mission_select(); +void rpi_update_tx_buffer_ami(); #endif // __RPI_H diff --git a/Core/Src/rpi.c b/Core/Src/rpi.c index 1642895..c72926b 100644 --- a/Core/Src/rpi.c +++ b/Core/Src/rpi.c @@ -35,14 +35,22 @@ void rpi_update_tx_buffer() { case VIEW_MISSION_SELECT: rpi_update_tx_buffer_mission_select(); break; + case VIEW_AMI: + rpi_update_tx_buffer_ami(); + break; default: Error_Handler(); } } + void rpi_update_tx_buffer_mission_select() { i2c_tx_buf[1] = stw_state.view_state.mission_select.selection; } +void rpi_update_tx_buffer_ami() { + i2c_tx_buf[1] = stw_state.view_state.ami.current_mission; +} + void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *handle) { switch (rpi_i2c_state) { case RPI_I2C_SENDING_DATA_SIZE: