Refactor async logging to synchronous; improve error handling consistency across modules.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::hal::Box;
|
||||
use crate::fat_error::FatResult;
|
||||
use crate::hal::Box;
|
||||
use async_trait::async_trait;
|
||||
use bincode::{Decode, Encode};
|
||||
use chrono::{DateTime, Utc};
|
||||
@@ -26,7 +26,7 @@ pub trait RTCModuleInteraction {
|
||||
async fn set_rtc_time(&mut self, time: &DateTime<Utc>) -> FatResult<()>;
|
||||
|
||||
fn write(&mut self, offset: u32, data: &[u8]) -> FatResult<()>;
|
||||
fn read(&mut self, offset:u32, data: &mut [u8]) -> FatResult<()>;
|
||||
fn read(&mut self, offset: u32, data: &mut [u8]) -> FatResult<()>;
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, PartialEq, Debug, Default, Encode, Decode)]
|
||||
@@ -67,7 +67,7 @@ impl RTCModuleInteraction for DS3231Module {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn read(&mut self, offset:u32, data: &mut [u8]) -> FatResult<()> {
|
||||
fn read(&mut self, offset: u32, data: &mut [u8]) -> FatResult<()> {
|
||||
self.storage.read(offset, data)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user