Rihards Balass / 4DGL-mbed-32PTU
Revision:
14:561cb06a2739
Parent:
13:1a0800957412
Child:
15:86bdf382e6f7
--- a/Picaso_4DGL-32PTU_main.cpp	Thu Sep 15 08:04:37 2016 +0000
+++ b/Picaso_4DGL-32PTU_main.cpp	Thu Sep 15 09:48:59 2016 +0000
@@ -322,12 +322,9 @@
 #if DEBUGMODE
     pc.printf("\n\r DEBUG: Wait for answer");
 #endif
-    while (index < count) {
-        wait_ms(100); // wait for screen answer
-#if DEBUGMODE
-        //pc.printf(",");
-#endif
-    }
+
+    while (index < count) wait_ms(100); // wait for screen answer
+    
 #if DEBUGMODE
     pc.printf("\n\r DEBUG: Answer = ");
     pc.printf("%02X %02X %02X\n\r", rxBuf[0], rxBuf[1], rxBuf[2]);
@@ -354,3 +351,26 @@
         return false;
     }
 }
+
+//**************************************************************************
+bool PICASO_4DGL :: writeSectorResponse(int count) {
+    
+#if DEBUGMODE
+    pc.printf("\n\r DEBUG: Wait for answer");
+#endif
+    while (index < count) wait_ms(100); // wait for screen answer
+    
+#if DEBUGMODE
+    pc.printf("\n\r DEBUG: Answer = ");
+    pc.printf("%02X %02X %02X\n\r", rxBuf[0], rxBuf[1], rxBuf[2]);
+#endif
+    
+    if (rxBuf[2] == 1) {
+        index = 0; // set buffer index to 0
+        return true;
+    }
+    else {
+        index = 0;
+        return false;
+    }
+}