summaryrefslogtreecommitdiff
path: root/firmware/drivers/fat.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/fat.c')
-rw-r--r--firmware/drivers/fat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index ad1a7a0c82..38223edc6a 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -223,6 +223,14 @@ int fat_startsector(void)
223 return fat_bpb.startsector; 223 return fat_bpb.startsector;
224} 224}
225 225
226void fat_size(unsigned int* size, unsigned int* free)
227{
228 if (size)
229 *size = fat_bpb.dataclusters * fat_bpb.bpb_secperclus / 2;
230 if (free)
231 *free = fat_bpb.fsinfo.freecount * fat_bpb.bpb_secperclus / 2;
232}
233
226int fat_mount(int startsector) 234int fat_mount(int startsector)
227{ 235{
228 unsigned char buf[SECTOR_SIZE]; 236 unsigned char buf[SECTOR_SIZE];