Fix get_state in cases where WRITE_SIZE != 1

This commit is contained in:
Mathias 2024-11-06 09:17:29 +01:00
parent 5bc4796b96
commit 682504eb0e

View File

@ -304,7 +304,7 @@ impl<'d, STATE: NorFlash> FirmwareState<'d, STATE> {
/// `mark_booted`.
pub async fn get_state(&mut self) -> Result<State, FirmwareUpdaterError> {
self.state.read(0, &mut self.aligned).await?;
Ok(State::from(&self.aligned))
Ok(State::from(&self.aligned[..STATE::WRITE_SIZE]))
}
/// Mark to trigger firmware swap on next boot.