diff options
author | Björn Stenberg <bjorn@haxx.se> | 2002-11-12 11:32:26 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2002-11-12 11:32:26 +0000 |
commit | 6fb512aba58bf221cdfcfc2a3df2148e8527883c (patch) | |
tree | e8ee8149ecf862068b7d70b2ec28ca04678227c6 /firmware/drivers | |
parent | 8a727cecdbb6f4efcea3a1b98cc1463825bdc499 (diff) | |
download | rockbox-6fb512aba58bf221cdfcfc2a3df2148e8527883c.tar.gz rockbox-6fb512aba58bf221cdfcfc2a3df2148e8527883c.zip |
Added disk space to Info menu item. (Players press + to see it.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2837 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/fat.c | 8 | ||||
-rw-r--r-- | firmware/drivers/fat.h | 1 |
2 files changed, 9 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 | ||
226 | void 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 | |||
226 | int fat_mount(int startsector) | 234 | int fat_mount(int startsector) |
227 | { | 235 | { |
228 | unsigned char buf[SECTOR_SIZE]; | 236 | unsigned char buf[SECTOR_SIZE]; |
diff --git a/firmware/drivers/fat.h b/firmware/drivers/fat.h index b23d8dfa08..8ef2982279 100644 --- a/firmware/drivers/fat.h +++ b/firmware/drivers/fat.h | |||
@@ -67,6 +67,7 @@ struct fat_dir | |||
67 | 67 | ||
68 | 68 | ||
69 | extern int fat_mount(int startsector); | 69 | extern int fat_mount(int startsector); |
70 | extern void fat_size(unsigned int* size, unsigned int* free); | ||
70 | 71 | ||
71 | extern int fat_create_dir(unsigned int currdir, char *name); | 72 | extern int fat_create_dir(unsigned int currdir, char *name); |
72 | extern int fat_startsector(void); | 73 | extern int fat_startsector(void); |