Skip to content

Commit ad42dfa

Browse files
committed
fix sdcard size truncation
1 parent d3ff76d commit ad42dfa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sdmmc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ macro_rules! sdmmc {
11871187

11881188
fn num_blocks(&self) -> Result<embedded_sdmmc::BlockCount, Self::Error> {
11891189
let sdmmc = self.sdmmc.borrow_mut();
1190-
Ok(embedded_sdmmc::BlockCount(sdmmc.card()?.size() as u32 / 512u32))
1190+
Ok(embedded_sdmmc::BlockCount((sdmmc.card()?.size() / 512u64) as u32))
11911191
}
11921192

11931193
}

0 commit comments

Comments
 (0)