Require erase address to be aligned to page size
This commit is contained in:
parent
5a265661bb
commit
f0027c9fe0
1 changed files with 1 additions and 1 deletions
|
@ -72,7 +72,7 @@ impl<'d> Flash<'d> {
|
||||||
if to < from || to as usize > FLASH_END {
|
if to < from || to as usize > FLASH_END {
|
||||||
return Err(Error::Size);
|
return Err(Error::Size);
|
||||||
}
|
}
|
||||||
if ((to - from) as usize % ERASE_SIZE) != 0 {
|
if (from as usize % ERASE_SIZE) != 0 || (to as usize % ERASE_SIZE) != 0 {
|
||||||
return Err(Error::Unaligned);
|
return Err(Error::Unaligned);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue