Merge pull request #3507 from MathiasKoch/fix/bootloader-async-updater

fix(*): FirmwareUpdater::get_state in cases where READ_SIZE != WRITE_SIZE
This commit is contained in:
Ulf Lilleengen 2024-11-06 08:47:41 +00:00 committed by GitHub
commit e4f611b97c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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