Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How can I use _FS_NOFSINFO ?

Status
Not open for further replies.

bianchi77

Advanced Member level 4
Advanced Member level 4
Joined
Jun 11, 2009
Messages
1,313
Helped
21
Reputation
44
Reaction score
20
Trophy points
1,318
Location
California
Visit site
Activity points
9,442
Hello Guys,

I tried to read a free space on FAT32 SDcard, based on :
http://elm-chan.org/fsw/ff/en/getfree.html

How can I use _FS_NOFSINFO ?
Because the size I got on UART was not right :
FREE SPACE ON SDCARD
Free space : 692517509 bytes Total space : 199 bytes

My SDCard is 1Gb and is being used about 30Mb

thanks
Code:
/* Get volume information and free clusters of drive 1 */
	res = f_getfree("1:", &fre_clust, &fs);
	//if (res) die(res);

	/* Get total sectors and free sectors */
	tot_sect = (fs->n_fatent - 2) * fs->csize;
	fre_sect = fre_clust * fs->csize;

	/* Print the free space (assuming 512 bytes/sector) */
	printf("%10lu KiB total drive space.\n%10lu KiB available.\n",
	tot_sect / 2, fre_sect / 2);
	sprintf_P( &temp_buffer, PSTR(" Free space : %10lu bytes "), fre_sect  );
	usart_pstr( &temp_buffer );
	sprintf_P( &temp_buffer, PSTR(" Total space : %10lu bytes "), tot_sect  );
	usart_pstr( &temp_buffer );
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top