Merge pull request #4325 from JYouren/patch-1

Only write to the flash what was read from the file
This commit is contained in:
Dario Nieuwenhuis 2025-06-22 21:03:28 +00:00 committed by GitHub
commit f7f5fe1120
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,7 +54,7 @@ async fn main(_s: Spawner) {
for chunk in APP_B.chunks(4096) {
buf.0[..chunk.len()].copy_from_slice(chunk);
defmt::info!("writing block at offset {}", offset);
writer.write(offset, &buf.0[..]).unwrap();
writer.write(offset, &buf.0[..chunk.len()]).unwrap();
offset += chunk.len() as u32;
}
watchdog.feed();