1
0
Fork 0

add debug (remove later)

This commit is contained in:
Simon Renblad 2024-10-09 16:53:45 +08:00
parent d76f6fee0e
commit 579ae79ea3
1 changed files with 2 additions and 0 deletions

View File

@ -93,6 +93,7 @@ pub enum PartitionEntry {
impl SdReader { impl SdReader {
/// Create SdReader from SdCard /// Create SdReader from SdCard
pub fn new(sd: SdCard) -> SdReader { pub fn new(sd: SdCard) -> SdReader {
debug!("creating new sd reader from sd card");
let mut vec: Vec<u8> = Vec::with_capacity(BLOCK_SIZE); let mut vec: Vec<u8> = Vec::with_capacity(BLOCK_SIZE);
unsafe { unsafe {
vec.set_len(vec.capacity()); vec.set_len(vec.capacity());
@ -186,6 +187,7 @@ impl SdReader {
mut self, mut self,
entry: PartitionEntry, entry: PartitionEntry,
) -> Result<fatfs::FileSystem<Self>, fatfs::Error<Error>> { ) -> Result<fatfs::FileSystem<Self>, fatfs::Error<Error>> {
debug!("mounting fatfs");
let mut buffer: [u8; 4] = [0; 4]; let mut buffer: [u8; 4] = [0; 4];
self.seek(SeekFrom::Start(0x1FE))?; self.seek(SeekFrom::Start(0x1FE))?;
self.read_exact(&mut buffer[..2])?; self.read_exact(&mut buffer[..2])?;