LoRa_Access_Point

Files at this revision

API Documentation at this revision

Comitter:
lukas_formanek
Date:
Mon Mar 25 19:21:43 2019 +0000
Parent:
10:28e685e5ff7f
Commit message:
Working SD

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
diff -r 28e685e5ff7f -r cfdaf73ebcd9 FATFileHandle.cpp
--- a/FATFileHandle.cpp	Mon Jul 10 15:37:41 2017 +0000
+++ b/FATFileHandle.cpp	Mon Mar 25 19:21:43 2019 +0000
@@ -21,7 +21,7 @@
  */
 #include "ff.h"
 #include "ffconf.h"
-#include "mbed_debug.h"
+//#include "mbed_debug.h"
 
 #include "FATFileHandle.h"
 
@@ -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;
diff -r 28e685e5ff7f -r cfdaf73ebcd9 FATFileSystem.cpp
--- a/FATFileSystem.cpp	Mon Jul 10 15:37:41 2017 +0000
+++ b/FATFileSystem.cpp	Mon Mar 25 19:21:43 2019 +0000
@@ -22,7 +22,7 @@
 #include "mbed.h"
 
 #include "ffconf.h"
-#include "mbed_debug.h"
+//#include "mbed_debug.h"
 
 #include "FATFileSystem.h"
 #include "FATFileHandle.h"
@@ -43,13 +43,13 @@
 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[0] = '0' + i;
             _fsid[1] = '\0';
-            debug_if(FFS_DBG, "Mounting [%s] on ffs drive [%s]\n", getName(), _fsid);
+//            debug_if(FFS_DBG, "Mounting [%s] on ffs drive [%s]\n", getName(), _fsid);
             f_mount(&_fs, _fsid, 0);
             return;
         }
@@ -67,7 +67,7 @@
 }
 
 FileHandle *FATFileSystem::open(const char* name, int flags) {
-    debug_if(FFS_DBG, "open(%s) on filesystem [%s], drv [%s]\n", name, getName(), _fsid);
+//    debug_if(FFS_DBG, "open(%s) on filesystem [%s], drv [%s]\n", name, getName(), _fsid);
     char n[64];
     sprintf(n, "%s:/%s", _fsid, name);
 
@@ -91,7 +91,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) {
@@ -113,7 +113,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;
@@ -122,7 +122,7 @@
 int FATFileSystem::rename(const char *oldname, const char *newname) {
     FRESULT res = f_rename(oldname, newname);
     if (res) {
-        debug_if(FFS_DBG, "f_rename() failed: %d\n", res);
+//        debug_if(FFS_DBG, "f_rename() failed: %d\n", res);
         return -1;
     }
     return 0;
@@ -131,7 +131,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;