mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 08:12:30 +00:00
Merge pull request #2411 from uzytkownik/reading-from-async-firmware-updater
boot: Take maximum of READ_SIZE and WRITE_SIZE when checking sizes, fixes #2382
This commit is contained in:
commit
8e7f477b01
@ -224,10 +224,10 @@ impl<'d, STATE: NorFlash> FirmwareState<'d, STATE> {
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// The `aligned` buffer must have a size of STATE::WRITE_SIZE, and follow the alignment rules for the flash being read from
|
||||
/// and written to.
|
||||
/// The `aligned` buffer must have a size of maximum of STATE::WRITE_SIZE and STATE::READ_SIZE,
|
||||
/// and follow the alignment rules for the flash being read from and written to.
|
||||
pub fn new(state: STATE, aligned: &'d mut [u8]) -> Self {
|
||||
assert_eq!(aligned.len(), STATE::WRITE_SIZE);
|
||||
assert_eq!(aligned.len(), STATE::WRITE_SIZE.max(STATE::READ_SIZE));
|
||||
Self { state, aligned }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user