chore: 📎 + fmt

This commit is contained in:
2025-10-18 20:40:38 +02:00
parent 6357ec773f
commit 1db3f7af64
26 changed files with 548 additions and 578 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::config::Configuration;
use bincode::{config, Decode, Encode};
@@ -65,7 +65,7 @@ impl RTCModuleInteraction for DS3231Module {
let (header, len): (BackupHeader, usize) =
bincode::decode_from_slice(&header_page_buffer[..], CONFIG)?;
log::info!("Raw header is {:?} with size {}", header_page_buffer, len);
log::info!("Raw header is {header_page_buffer:?} with size {len}");
Ok(header)
}
@@ -97,7 +97,7 @@ impl RTCModuleInteraction for DS3231Module {
async fn backup_config(&mut self, offset: usize, bytes: &[u8]) -> FatResult<()> {
//skip header and write after
self.storage
.write((BACKUP_HEADER_MAX_SIZE + offset) as u32, &bytes)?;
.write((BACKUP_HEADER_MAX_SIZE + offset) as u32, bytes)?;
Ok(())
}
@@ -113,11 +113,7 @@ impl RTCModuleInteraction for DS3231Module {
};
let config = config::standard();
let encoded = bincode::encode_into_slice(&header, &mut header_page_buffer, config)?;
log::info!(
"Raw header is {:?} with size {}",
header_page_buffer,
encoded
);
log::info!("Raw header is {header_page_buffer:?} with size {encoded}");
self.storage.write(0, &header_page_buffer)?;
Ok(())
}