F_SPACE space;
int ret_space = f_getfreespace( f_getdrive(), &space );
if ( !ret_space )
{
/* Some Info */
iprintf("\r\nTotal Space On Drive: %lu", space.total);
iprintf("\r\nFree Space On Drive: %lu", space.free);
}
Varban, for cards > 4GB, you need to compute 64-bit (long long) values by combining the "low" and "high" 32-bit fields of F_SPACE. See the code in nburn\examples\MOD5441X\EFFS-MULTIPLE-MMC. Note "%llu" is the format to print long long unsigned.
Joe
F_SPACE space;
volatile int rv = f_getfreespace( drv, &space );
if ( rv == F_NO_ERROR ) {
long long total = ((long long)space.total_high << 32) + space.total;
long long free = ((long long)space.free_high << 32) + space.free;
long long used = ((long long)space.used_high << 32) + space.used;
long long bad = ((long long)space.bad_high << 32) + space.bad;
iprintf( "%llu total, %llu free, %llu used, %llu bad\r\n", total, free, used, bad );
}