Ok(())
}
+ fn erase(&mut self, address: usize) -> Result<(), Error> {
+ self.erase_sector(address)
+ }
+
fn clear(&mut self) {
self.erase_all();
}
fn write(&mut self, address: usize, buffer: &[u8; 4096]) -> Result<(), Error>;
+ fn erase(&mut self, address: usize) -> Result<(), Error>;
+
fn clear(&mut self);
}
Ok(())
}
+ fn erase(&mut self, address: usize) -> Result<(), Error> {
+ if (address & 4095) != 0 {
+ return Err(Error::UnalignedAddress);
+ }
+
+ for i in 0..4096 {
+ self.actual[address + i] = 0xff;
+ }
+
+ Ok(())
+
+ }
+
fn clear(&mut self) {
self.actual = vec![0xff; MEMORY_SIZE].into_boxed_slice();
}