A board support package for the LPC4088 Display Module.

Dependencies:   DM_HttpServer DM_USBHost

Dependents:   lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more

Fork of DMSupport by EmbeddedArtists AB

Files at this revision

API Documentation at this revision

Comitter:
embeddedartists
Date:
Fri Dec 19 16:41:25 2014 +0100
Parent:
13:2c60e28503f8
Child:
15:ea906527c0b3
Commit message:
- Fixed bug in QSPI file system where an unformatted QSPI file system could still open folders

Changed in this revision

FileSystems/QSPIFileSystem.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/FileSystems/QSPIFileSystem.cpp	Fri Dec 19 12:10:19 2014 +0100
+++ b/FileSystems/QSPIFileSystem.cpp	Fri Dec 19 16:41:25 2014 +0100
@@ -1402,16 +1402,18 @@
 
 DirHandle *QSPIFileSystem::opendir(const char *name)
 {
-  FileHandle* fh = open(name, O_RDONLY);
-  if (fh != NULL) {
-    // Attempting to open a file as a dir
-    delete fh;
-    return NULL;
-  }
-  
-//     printf("opendir: name '%s'\n", name);
-  if (strlen(name) <= HEADER_DNAME_MAXLEN) {
-    return QSPIDirHandle::openDir(name);
+  if (isformatted()) {
+    FileHandle* fh = open(name, O_RDONLY);
+    if (fh != NULL) {
+      // Attempting to open a file as a dir
+      delete fh;
+      return NULL;
+    }
+    
+//       printf("opendir: name '%s'\n", name);
+    if (strlen(name) <= HEADER_DNAME_MAXLEN) {
+      return QSPIDirHandle::openDir(name);
+    }
   }
   return NULL;
 }