Rihards Balass / 4DGL-mbed-32PTU
Revision:
19:a259bc128867
Parent:
18:829f3e2c064c
Child:
20:88e137b9ea46
--- a/Picaso_4DGL-32PTU_Response.cpp	Thu Sep 15 12:40:48 2016 +0000
+++ b/Picaso_4DGL-32PTU_Response.cpp	Thu Sep 15 13:31:53 2016 +0000
@@ -193,3 +193,27 @@
         return false;
     }
 }
+
+//**************************************************************************
+bool PICASO_4DGL :: writeByteResponse() {
+    
+#if DEBUGMODE
+    pc.printf("\n\r DEBUG: Wait for answer");
+#endif
+
+    while (index < 3) 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] > 0) {
+        index = 0; // set buffer index to 0
+        return true;
+    }
+    else {
+        index = 0;
+        return false;
+    }
+}