The archive contains two folders - libsdfs, which is the wrapper for ff, and sdfs_demo, which shows how to use it.
http://www.mediafire.com/download/cdjmj ... ibsdfs.zip
It's pretty simple. You make the following protos in your project, and add -lsdfs to your link objects.
Code: Select all
extern int fs_sd_init(void);
extern int fs_sd_shutdown(void);
Supported vfs calls:
open
close
read
write
seek
tell
total
readdir
rename
unlink
stat
mkdir
rmdir
fcntl
I also added support for timestamps, so be sure your clock is set right.
The demo uses a simple file requester to allow you to select a file from the SD. It then copies that file into the root directory as "test_copy.bin" so that you can check how writing works. Press up/down to go through the list (left/right to move a page back/forward), A to select a file or enter a subdirectory, B to cancel (and not copy anything), and Y to go back one directory level.
Please let me know if you find any bugs.