SD Card Interface class. Log raw data bytes to memory addresses of your choice, or format the card and use the FAT file system to write files.
Diff: FATFileSystem/Interface/FATFileSystem.cpp
- Revision:
- 6:ddf09d859ed7
- Parent:
- 4:9a5878d316d5
--- a/FATFileSystem/Interface/FATFileSystem.cpp Sat Jan 15 05:58:22 2011 +0000 +++ b/FATFileSystem/Interface/FATFileSystem.cpp Sun Jan 16 09:20:30 2011 +0000 @@ -98,7 +98,7 @@ int FATFileSystem::rename(const char* oldname, const char* newname) { - /*char OldName[64]; + char OldName[64]; sprintf(OldName, "%d:/%s", Drive, oldname); if (f_rename((const TCHAR*)OldName, (const TCHAR*)newname)) @@ -108,8 +108,7 @@ else { return 0; - }*/ - return 0; + } } DirHandle* FATFileSystem::opendir(const char* name) @@ -141,4 +140,16 @@ { return 0; } +} + +int FATFileSystem::format(unsigned int allocationunit) +{ + if (f_mkfs(Drive, 0, allocationunit)) + { + return -1; + } + else + { + return 0; + } } \ No newline at end of file