From 1947134844b8feb70a29121df6afca7f8ccdcfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Wed, 13 Nov 2024 16:18:46 +0100 Subject: [PATCH] Fix littlefs macros With the littlefs update to 0.5.0 the error was changed from an enum to a wrapper with associated constants. --- src/drivers/flash.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/flash.rs b/src/drivers/flash.rs index 3f325c3..350ca4d 100644 --- a/src/drivers/flash.rs +++ b/src/drivers/flash.rs @@ -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 { @@ -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) } @@ -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 { @@ -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) }