|
|
View previous topic :: View next topic |
Author |
Message |
husam
Joined: 17 Feb 2010 Posts: 10 Location: jordan
|
What is "flush buffer" in mmc used for ? |
Posted: Sun Feb 21, 2010 12:14 pm |
|
|
Hi,
I'm new to MMC & SD, and I hope for some help !!!
1- What is "flush buffer" in mmc used for ?
2- I use mmcsd.c library from CCS PCWHD compiler and I saw a
function called:
Code: |
mmcsd_write_block(a, s, p);
|
I hope for someone to tell me how to use it, and the difference between
it and another function called:
Code: |
mmcsd_write_byte(a, p);
|
Thanks |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Sun Feb 21, 2010 8:53 pm |
|
|
I have not used the driver you are using but I can guess these.
When you write to an SD/MMC card you write in 512 byte blocks. What actually happens when you write to the file system the write takes place into the file buffer, not the physical media. When the file buffer is full, or you attempt to write to a different sector, or you close the file then the driver writes (flushes) the buffer to the media. However, if you have an application that only writes a few bytes at a time (say a GPS at 10 second recording intervals) you don't want to lose data that is in the buffer when you turn off the GPS without closing the file. Periodically "flushing" the file system will write the current buffer to the media.
A write_byte() function would write a single byte to the file buffer.
A write_block() function would write a sequence (block) of bytes to the file buffer. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|