mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-10-02 06:40:32 +00:00
Merge pull request #4325 from JYouren/patch-1
Only write to the flash what was read from the file
This commit is contained in:
commit
f7f5fe1120
@ -54,7 +54,7 @@ async fn main(_s: Spawner) {
|
|||||||
for chunk in APP_B.chunks(4096) {
|
for chunk in APP_B.chunks(4096) {
|
||||||
buf.0[..chunk.len()].copy_from_slice(chunk);
|
buf.0[..chunk.len()].copy_from_slice(chunk);
|
||||||
defmt::info!("writing block at offset {}", offset);
|
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;
|
offset += chunk.len() as u32;
|
||||||
}
|
}
|
||||||
watchdog.feed();
|
watchdog.feed();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user