From 2c3bacd96457b13f6c2f2a7e9ef28ed6f8311d1f Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Wed, 8 Jan 2020 11:45:29 +0100 Subject: [PATCH] common: Implement Storage::clear() in Mx25l. --- src/common/mx25l.rs | 4 ++++ src/common/storage.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/common/mx25l.rs b/src/common/mx25l.rs index 388d311..ea2b8c1 100644 --- a/src/common/mx25l.rs +++ b/src/common/mx25l.rs @@ -191,4 +191,8 @@ impl Storage for Mx25l { Ok(()) } + + fn clear(&mut self) { + self.erase_all(); + } } diff --git a/src/common/storage.rs b/src/common/storage.rs index 784a1f6..c6d3fb7 100644 --- a/src/common/storage.rs +++ b/src/common/storage.rs @@ -29,4 +29,6 @@ pub trait Storage { fn read(&self, address: usize, buffer: &mut [u8]); fn write(&mut self, address: usize, buffer: &[u8; 4096]) -> Result<(), Error>; + + fn clear(&mut self); } -- 2.30.2