KSM edits to RA8875

Dependents:   Liz_Test_Code

Revision:
177:8620cdfcdbf2
Parent:
176:4ab96d33a8ec
--- a/RA8875_Touch.cpp	Sun Mar 24 14:49:49 2019 +0000
+++ b/RA8875_Touch.cpp	Thu Jul 11 14:02:46 2019 +0000
@@ -69,7 +69,7 @@
         touchSample = 0;
         touchState = no_cal;
         //touchTicker.attach_us(callback(this, &RA8875::_TouchTicker), TOUCH_TICKER_uS);
-        #if (MBED_MAJOR_VERSION >= 5) || (MBED_LIBRARY_VERSION > 122)   // Is this the right version?
+        #if (MBED_MAJOR_VERSION >= 5) || (MBED_LIBRARY_VERSION > 128)   // Is this the right version?
         touchTicker.attach_us(callback(this, &RA8875::_TouchTicker), TOUCH_TICKER_uS);
         #else
         touchTicker.attach_us(this, &RA8875::_TouchTicker, TOUCH_TICKER_uS);
@@ -113,7 +113,7 @@
         touchState = no_cal;
         if (bTpEnable == TP_ENABLE) {
             //touchTicker.attach_us(callback(this, &RA8875::_TouchTicker), TOUCH_TICKER_uS);
-            #if (MBED_MAJOR_VERSION >= 5) || (MBED_LIBRARY_VERSION > 122)   // Is this the right version?
+            #if (MBED_MAJOR_VERSION >= 5) || (MBED_LIBRARY_VERSION > 128)   // Is this the right version?
             touchTicker.attach_us(callback(this, &RA8875::_TouchTicker), TOUCH_TICKER_uS);
             #else
             touchTicker.attach_us(this, &RA8875::_TouchTicker, TOUCH_TICKER_uS);
@@ -309,7 +309,7 @@
         if (ts != no_touch) {
             panelTouched = true;
             numberOfTouchPoints = 1;
-
+            INFO("Raw Values: (%d, %d)", a2dX, a2dY);
             if (tpMatrix.Divider != 0) {
                 /* Operation order is important since we are doing integer */
                 /*  math. Make sure you add all terms together before      */
@@ -321,7 +321,9 @@
                 touchInfo[0].coordinates.y = ( (tpMatrix.Dn * a2dX) +
                                   (tpMatrix.En * a2dY) + tpMatrix.Fn
                                 ) / tpMatrix.Divider ;
+                INFO("Calced Values: (%d, %d)", touchInfo[0].coordinates.x, touchInfo[0].coordinates.y);
             } else {
+                INFO("NO CAL!!");
                 ts = no_cal;
             }
         } else {
@@ -420,7 +422,7 @@
 
 void RA8875::_TouchTicker(void)
 {
-    INFO("_TouchTicker()");
+    //INFO("_TouchTicker()");
     if (timeSinceTouch.read_us() > NOTOUCH_TIMEOUT_uS) {
         touchSample = 0;
         if (touchState == held)