KSM edits to RA8875

Dependents:   Liz_Test_Code

Revision:
127:db7f2c704693
Parent:
124:1690a7ae871c
Child:
128:3c74ba4533dc
--- a/RA8875_Touch.cpp	Sat Aug 06 15:09:34 2016 +0000
+++ b/RA8875_Touch.cpp	Sat Aug 06 20:04:23 2016 +0000
@@ -248,19 +248,15 @@
             numberOfTouchPoints = 1;
 
             if (tpMatrix.Divider != 0) {
-
                 /* Operation order is important since we are doing integer */
                 /*  math. Make sure you add all terms together before      */
                 /*  dividing, so that the remainder is not rounded off     */
                 /*  prematurely.                                           */
                 touchInfo[0].coordinates.x = ( (tpMatrix.An * a2dX) +
-                                  (tpMatrix.Bn * a2dY) +
-                                  tpMatrix.Cn
+                                  (tpMatrix.Bn * a2dY) + tpMatrix.Cn
                                 ) / tpMatrix.Divider ;
-
                 touchInfo[0].coordinates.y = ( (tpMatrix.Dn * a2dX) +
-                                  (tpMatrix.En * a2dY) +
-                                  tpMatrix.Fn
+                                  (tpMatrix.En * a2dY) + tpMatrix.Fn
                                 ) / tpMatrix.Divider ;
             } else {
                 ts = no_cal;
@@ -275,8 +271,9 @@
         if (TouchPoint) {
             *TouchPoint = touchInfo[0].coordinates;
             ts = touchInfo[0].touchCode;
+        } else {
+            ts = touch;
         }
-        ts = touch;
     }
     return ts;
 }