Skip to content

Commit 4e7d802

Browse files
committed
Fix state not set bug
1 parent 561242a commit 4e7d802

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/storage/sd_card.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl<'a> SDCardStorage<'a> {
9090
}
9191

9292
pub fn mount(&mut self, mount_path: &str, max_fds: usize) -> anyhow::Result<()> {
93-
match replace(&mut self.state, SDCardState::Init) {
93+
self.state = match replace(&mut self.state, SDCardState::Init) {
9494
SDCardState::Init => {
9595
bail!("Driver not installed yet");
9696
}
@@ -116,7 +116,6 @@ impl<'a> SDCardStorage<'a> {
116116
SDCardState::Init => None,
117117
SDCardState::DriverInstalled { driver } => Some(driver.card()),
118118
SDCardState::Mounted { card, .. } => Some(card),
119-
_ => None,
120119
}
121120
}
122121
}

src/usb/msc_device.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl Storage for SDCardStorage<'_> {
3232
..Default::default()
3333
};
3434
esp!(unsafe { tinyusb_msc_storage_init_sdmmc(&config) })
35-
.with_context(|| "Failed to initialize spiflash for msc storage")?;
35+
.with_context(|| "Failed to initialize sd for msc storage")?;
3636
Ok(())
3737
}
3838
}

0 commit comments

Comments
 (0)