diff --git a/examples/linux/mod.rs b/examples/linux/mod.rs index 6eefe23..515abb3 100644 --- a/examples/linux/mod.rs +++ b/examples/linux/mod.rs @@ -2,6 +2,7 @@ use chrono::Timelike; use embedded_sdmmc::{Block, BlockCount, BlockDevice, BlockIdx, TimeSource, Timestamp}; +use log::trace; use std::cell::RefCell; use std::fs::{File, OpenOptions}; use std::io::prelude::*; @@ -35,6 +36,12 @@ impl BlockDevice for LinuxBlockDevice { type Error = std::io::Error; fn read(&self, blocks: &mut [Block], start_block_idx: BlockIdx) -> Result<(), Self::Error> { + trace!( + "Read {} block{} at {:#08x}", + blocks.len(), + if blocks.len() == 1 { "" } else { "s" }, + start_block_idx.into_bytes() + ); self.file .borrow_mut() .seek(SeekFrom::Start(start_block_idx.into_bytes()))?; @@ -48,6 +55,12 @@ impl BlockDevice for LinuxBlockDevice { } fn write(&self, blocks: &[Block], start_block_idx: BlockIdx) -> Result<(), Self::Error> { + trace!( + "Write {} block{} at {:#08x}", + blocks.len(), + if blocks.len() == 1 { "" } else { "s" }, + start_block_idx.into_bytes() + ); self.file .borrow_mut() .seek(SeekFrom::Start(start_block_idx.into_bytes()))?;