Skip to content

Commit

Permalink
Fix littlefs macros
Browse files Browse the repository at this point in the history
With the littlefs update to 0.5.0 the error was changed from an enum to a wrapper with associated constants.
  • Loading branch information
sosthene-nitrokey committed Jan 17, 2025
1 parent 53a86f7 commit 4c28752
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/drivers/flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ macro_rules! littlefs2_filesystem {
::write(&mut self.flash_gordon, Self::BASE_OFFSET + off, data);
ret
.map(|_| data.len())
.map_err(|_| littlefs2::io::Error::Io)
.map_err(|_| littlefs2::io::Error::IO)
}

fn erase(&mut self, off: usize, len: usize) -> LfsResult<usize> {
Expand All @@ -459,7 +459,7 @@ macro_rules! littlefs2_filesystem {
for i in 0..pages {
<$crate::drivers::flash::FlashGordon as $crate::traits::flash::WriteErase<$crate::drivers::flash::U512, $crate::drivers::flash::U512>>
::erase_page(&mut self.flash_gordon, first_page + i)
.map_err(|_| littlefs2::io::Error::Io)?;
.map_err(|_| littlefs2::io::Error::IO)?;
}
Ok(512 * len)
}
Expand Down Expand Up @@ -545,7 +545,7 @@ macro_rules! littlefs2_prince_filesystem {
});
ret
.map(|_| data.len())
.map_err(|_| littlefs2::io::Error::Io)
.map_err(|_| littlefs2::io::Error::IO)
}

fn erase(&mut self, off: usize, len: usize) -> LfsResult<usize> {
Expand All @@ -555,7 +555,7 @@ macro_rules! littlefs2_prince_filesystem {
<$crate::drivers::flash::FlashGordon as
$crate::traits::flash::WriteErase<$crate::drivers::flash::U512, $crate::drivers::flash::U512>>
::erase_page(&mut self.flash_gordon, first_page + i)
.map_err(|_| littlefs2::io::Error::Io)?;
.map_err(|_| littlefs2::io::Error::IO)?;
}
Ok(512 * len)
}
Expand Down

0 comments on commit 4c28752

Please sign in to comment.