4D systems Picaso uLCD 32PTU touch display library

Revision:
21:ea68a8a3cea4
Parent:
20:88e137b9ea46
Child:
22:cea582ea74c1
--- a/Picaso_4DGL-32PTU_File.cpp	Mon Sep 26 10:51:02 2016 +0000
+++ b/Picaso_4DGL-32PTU_File.cpp	Mon Sep 26 13:41:22 2016 +0000
@@ -43,3 +43,49 @@
 #endif
     return success;
 }
+
+//**************************************************************************
+// Returns the most recent error code or 0 if there were no errors.
+// Returns Error Number.
+// 1    IDE command execution error
+// 2    CARD not present
+// 3    WRONG partition type, not FAT16
+// 4    MBR sector invalid signature
+// 5    Boot Record invalid signature
+// 6    Media not mounted
+// 7    File not found in open for read
+// 8    File not open
+// 9    Fat attempt to read beyond EOF
+// 10   Reached the end of file
+// 11   Invalid cluster value > maxcls
+// 12   All root dir entry are taken
+// 13   All clusters in partition are taken
+// 14   A file with same name exist already
+// 15   Cannot init the CARD
+// 16   Cannot read the MBR
+// 17   Malloc could not allocate the FILE struct
+// 18   Mode was not r.w.
+// 19   Failure during FILE search
+// 20   Invalid Filename
+// 21   bad media
+// 22   Sector Read fail
+// 23   Sector write fail
+//**************************************************************************
+short PICASO_4DGL :: file_Error() {
+
+    char command[2] = "";
+    
+    command[0] = (FILE_ERROR >> (8*1)) & 0xff;
+    command[1] = (FILE_ERROR >> (8*0)) & 0xff;
+    
+    writeCOMMAND(command, 2);
+    short error = fileErrorResponse();
+#ifdef DEBUGMODE
+    pc.printf("\n\r DEBUG: FAT16 Error: %i\n\r", error);
+#endif
+    return error;
+}
+
+
+
+