Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FATFileSystem by
Revision 5:29903470cfbf, committed 2015-09-29
- Comitter:
- dexterg
- Date:
- Tue Sep 29 21:29:45 2015 +0000
- Parent:
- 3:e960e2b81a3c
- Commit message:
- F1
Changed in this revision
| FATFileHandle.cpp | Show annotated file Show diff for this revision Revisions of this file |
| FATFileSystem.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/FATFileHandle.cpp Mon Mar 17 14:09:00 2014 +0000
+++ b/FATFileHandle.cpp Tue Sep 29 21:29:45 2015 +0000
@@ -39,18 +39,18 @@
UINT n;
FRESULT res = f_write(&_fh, buffer, length, &n);
if (res) {
- debug_if(FFS_DBG, "f_write() failed: %d", res);
+ //debug_if(FFS_DBG, "f_write() failed: %d", res);
return -1;
}
return n;
}
ssize_t FATFileHandle::read(void* buffer, size_t length) {
- debug_if(FFS_DBG, "read(%d)\n", length);
+ //debug_if(FFS_DBG, "read(%d)\n", length);
UINT n;
FRESULT res = f_read(&_fh, buffer, length, &n);
if (res) {
- debug_if(FFS_DBG, "f_read() failed: %d\n", res);
+ //debug_if(FFS_DBG, "f_read() failed: %d\n", res);
return -1;
}
return n;
@@ -68,10 +68,10 @@
}
FRESULT res = f_lseek(&_fh, position);
if (res) {
- debug_if(FFS_DBG, "lseek failed: %d\n", res);
+ //debug_if(FFS_DBG, "lseek failed: %d\n", res);
return -1;
} else {
- debug_if(FFS_DBG, "lseek OK, returning %i\n", _fh.fptr);
+ //debug_if(FFS_DBG, "lseek OK, returning %i\n", _fh.fptr);
return _fh.fptr;
}
}
@@ -79,7 +79,7 @@
int FATFileHandle::fsync() {
FRESULT res = f_sync(&_fh);
if (res) {
- debug_if(FFS_DBG, "f_sync() failed: %d\n", res);
+ //debug_if(FFS_DBG, "f_sync() failed: %d\n", res);
return -1;
}
return 0;
--- a/FATFileSystem.cpp Mon Mar 17 14:09:00 2014 +0000
+++ b/FATFileSystem.cpp Tue Sep 29 21:29:45 2015 +0000
@@ -43,12 +43,12 @@
FATFileSystem *FATFileSystem::_ffs[_VOLUMES] = {0};
FATFileSystem::FATFileSystem(const char* n) : FileSystemLike(n) {
- debug_if(FFS_DBG, "FATFileSystem(%s)\n", n);
+ //debug_if(FFS_DBG, "FATFileSystem(%s)\n", n);
for(int i=0; i<_VOLUMES; i++) {
if(_ffs[i] == 0) {
_ffs[i] = this;
_fsid = i;
- debug_if(FFS_DBG, "Mounting [%s] on ffs drive [%d]\n", _name, _fsid);
+ //debug_if(FFS_DBG, "Mounting [%s] on ffs drive [%d]\n", _name, _fsid);
f_mount(i, &_fs);
return;
}
@@ -66,7 +66,7 @@
}
FileHandle *FATFileSystem::open(const char* name, int flags) {
- debug_if(FFS_DBG, "open(%s) on filesystem [%s], drv [%d]\n", name, _name, _fsid);
+ //debug_if(FFS_DBG, "open(%s) on filesystem [%s], drv [%d]\n", name, _name, _fsid);
char n[64];
sprintf(n, "%d:/%s", _fsid, name);
@@ -90,7 +90,7 @@
FIL fh;
FRESULT res = f_open(&fh, n, openmode);
if (res) {
- debug_if(FFS_DBG, "f_open('w') failed: %d\n", res);
+ //debug_if(FFS_DBG, "f_open('w') failed: %d\n", res);
return NULL;
}
if (flags & O_APPEND) {
@@ -102,7 +102,7 @@
int FATFileSystem::remove(const char *filename) {
FRESULT res = f_unlink(filename);
if (res) {
- debug_if(FFS_DBG, "f_unlink() failed: %d\n", res);
+ //debug_if(FFS_DBG, "f_unlink() failed: %d\n", res);
return -1;
}
return 0;
@@ -111,7 +111,7 @@
int FATFileSystem::format() {
FRESULT res = f_mkfs(_fsid, 0, 512); // Logical drive number, Partitioning rule, Allocation unit size (bytes per cluster)
if (res) {
- debug_if(FFS_DBG, "f_mkfs() failed: %d\n", res);
+ //debug_if(FFS_DBG, "f_mkfs() failed: %d\n", res);
return -1;
}
return 0;
