summaryrefslogtreecommitdiff
path: root/stm/sdcard.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-02-13 23:21:02 +0000
committerDamien George <damien.p.george@gmail.com>2014-02-13 23:21:02 +0000
commit70d7a83c74812a517ef0489877becb075d164630 (patch)
tree3ac8e9b1792cebd37f31460dd0c3483f9eb6e926 /stm/sdcard.c
parenta8d404e0e1cfc3ad1fb171b5515f2685af4ffeca (diff)
stm: If SD card inserted on hard reset, it is the medium for USB MSD.
Diffstat (limited to 'stm/sdcard.c')
-rw-r--r--stm/sdcard.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stm/sdcard.c b/stm/sdcard.c
index 119027efa..d0ec45a23 100644
--- a/stm/sdcard.c
+++ b/stm/sdcard.c
@@ -95,6 +95,12 @@ void sdcard_power_off(void) {
SD_DeInit();
}
+uint64_t sdcard_get_capacity_in_bytes(void) {
+ SD_CardInfo SDCardInfo;
+ SD_GetCardInfo(&SDCardInfo);
+ return SDCardInfo.CardCapacity;
+}
+
bool sdcard_read_block(uint8_t *dest, uint32_t block_num) {
// TODO return error if not powered on