Refactor async logging to synchronous; improve error handling consistency across modules.

This commit is contained in:
Kai Börnert
2026-04-13 17:03:47 +02:00
parent 964bdb0454
commit 8ce00c9d95
12 changed files with 104 additions and 121 deletions

View File

@@ -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(())
}