Jelajahi Sumber

1、修改配置下发的函数地址增量,并显示提示配置版本,能下发GT2933/36/31的配置
2、测试开短路时增加GT2933/36/31的区别,对应的命令及数据地址修改,测试前关闭hop和normalize,ESD检测和s8xxx响应INT中断功能,测试完后复位触控IC并恢复以上。
GT2933/36能测试最大最小值和短路,GT2931能测试最大最小值,在读原始值同步标志时做了读20次超时处理,因为GT2931可能读不到同步标志,短路测试待开发
3、测试完后,如果最大最小值有异常才显示数据,测试pass则不显示数据

robbin 2 tahun lalu
induk
melakukan
1f58f758e2

+ 0 - 6
.idea/compiler.xml

@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="CompilerConfiguration">
-    <bytecodeTargetLevel target="11" />
-  </component>
-</project>

+ 0 - 7
.idea/encodings.xml

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="Encoding">
-    <file url="file://$PROJECT_DIR$/app/build.gradle" charset="GBK" />
-    <file url="PROJECT" charset="UTF-8" />
-  </component>
-</project>

+ 0 - 2
.idea/gradle.xml

@@ -1,10 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="GradleMigrationSettings" migrationVersion="1" />
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
-        <option name="testRunner" value="PLATFORM" />
         <option name="distributionType" value="DEFAULT_WRAPPED" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
         <option name="modules">

+ 0 - 45
.idea/jarRepositories.xml

@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="RemoteRepositoriesConfiguration">
-    <remote-repository>
-      <option name="id" value="central" />
-      <option name="name" value="Maven Central repository" />
-      <option name="url" value="https://repo1.maven.org/maven2" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="jboss.community" />
-      <option name="name" value="JBoss Community repository" />
-      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="BintrayJCenter" />
-      <option name="name" value="BintrayJCenter" />
-      <option name="url" value="https://jcenter.bintray.com/" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="maven" />
-      <option name="name" value="maven" />
-      <option name="url" value="https://jitpack.io" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="Google" />
-      <option name="name" value="Google" />
-      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="C:\Users\tiancai\AppData\Local\Android\Sdk\extras\google\m2repository" />
-      <option name="name" value="C:\Users\tiancai\AppData\Local\Android\Sdk\extras\google\m2repository" />
-      <option name="url" value="file:/$USER_HOME$/AppData/Local/Android/Sdk/extras/google/m2repository/" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="C:\Users\tiancai\AppData\Local\Android\Sdk\extras\m2repository" />
-      <option name="name" value="C:\Users\tiancai\AppData\Local\Android\Sdk\extras\m2repository" />
-      <option name="url" value="file:/$USER_HOME$/AppData/Local/Android/Sdk/extras/m2repository/" />
-    </remote-repository>
-    <remote-repository>
-      <option name="id" value="C:\Users\tiancai\AppData\Local\Android\Sdk\extras\android\m2repository" />
-      <option name="name" value="C:\Users\tiancai\AppData\Local\Android\Sdk\extras\android\m2repository" />
-      <option name="url" value="file:/$USER_HOME$/AppData/Local/Android/Sdk/extras/android/m2repository/" />
-    </remote-repository>
-  </component>
-</project>

+ 1 - 1
.idea/misc.xml

@@ -29,7 +29,7 @@
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 0 - 1
.idea/runConfigurations.xml

@@ -3,7 +3,6 @@
   <component name="RunConfigurationProducerService">
     <option name="ignoredProducers">
       <set>
-        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
         <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
         <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
         <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />

+ 3 - 3
app/build.gradle

@@ -13,14 +13,14 @@ android {
     android.applicationVariants.all {
         variant ->
             variant.outputs.all{
-                //此处指定生成的apk文件名
-                outputFileName = "WingCoolAPK_V3.0.0_20220916_debug.apk"
+                //姝ゅ�鎸囧畾鐢熸垚鐨刟pk鏂囦欢鍚�
+                outputFileName = "WingCoolAPK_V3.0.1_20230425_debug.apk"
             }
     }
     lintOptions {
         checkReleaseBuilds false
         abortOnError false
-        // 防止在发布的时候出现因MissingTranslation导致Build Failed!
+        // 闃叉�鍦ㄥ彂甯冪殑鏃跺€欏嚭鐜板洜MissingTranslation瀵艰嚧Build Failed!
         disable 'MissingTranslation'
     }
     buildTypes {

+ 13 - 7
app/src/main/java/com/example/administrator/wingcool_gt9_apk/Config.java

@@ -3576,6 +3576,8 @@ public class Config extends AppCompatActivity
 
                 iicWrite32Bits(addrfirstbyte, addrsecondbyte, addrthirdbyte, mBufferData,0,iconfiglen + 64);
 
+                SystemClock.sleep(30);
+
                 if (!recallCheck(addrfirstbyte, addrsecondbyte, addrthirdbyte, mBufferData, 0, iconfiglen + 64)) {
                     stMessageLog = "Recall check config error!!";
                     stMessageLogShow = stMessageLogShow.concat(stMessageLog);
@@ -3638,7 +3640,7 @@ public class Config extends AppCompatActivity
                 }while(mBytes[0] != (byte)0x80);
 
                 //mShow.setText("Send cfg finish!!");
-                stMessageLog = "Send config finish!!";
+                stMessageLog = "Send config finish!! Config Version:0x" + Integer.toHexString(mBufferData[34]);
                 stMessageLogShow = stMessageLogShow.concat(stMessageLog);
                 mShow.setText(stMessageLogShow);
 
@@ -3678,7 +3680,7 @@ public class Config extends AppCompatActivity
                 checksum = 0;
                 checksum2 = 0;
 
-
+                stMessageLogShow = "";
                 /*
                 //read [0x10174] = 0x80 or 0x01,表示上条命令已执行完毕,或当前固件处于空闲状态
                 do {
@@ -3770,6 +3772,10 @@ public class Config extends AppCompatActivity
 
                 //SystemClock.sleep(2);
 
+                stMessageLog = "Read config finish!! Config Version:0x" + mConfigShow[34];
+                stMessageLogShow = stMessageLogShow.concat(stMessageLog);
+                mShow.setText(stMessageLogShow);
+
                 iicRead32Bits((byte)0x01, (byte)0x00, (byte)0x2B, mBytes, 4);  //read Sensor ID
                 tvVenderID.setText("VenderID:"+Integer.toString(mBytes[0] & 0xFF));
 
@@ -4200,9 +4206,9 @@ public class Config extends AppCompatActivity
             iicWriteData[j] = 0x00;
         }
 
-        //int address1 = ((addressHigh&0xff)<<8);
-        //int address2 = addressLow&0xff;
-        long address = ((long)addrfirstbyte << 16) | ((long)addrsecondbyte << 8) | addrthirdbyte;
+        int address1 = ((addrsecondbyte&0xff)<<8);
+        int address2 = addrthirdbyte&0xff;
+        int address = address1|address2;
 
         int sendTimes = length/57 + 1;  //预计是向下取整,所以+1
 
@@ -4233,8 +4239,8 @@ public class Config extends AppCompatActivity
             }
 
             address = address + 57;
-            iicWriteData[2] = (byte)(address >> 16);
-            iicWriteData[3] = (byte)(address>>8);
+            //iicWriteData[2] = (byte)((address & 0xFF0000) >> 16);
+            iicWriteData[3] = (byte)(address >> 8);
             iicWriteData[4] = (byte)address;
         }
 

+ 369 - 123
app/src/main/java/com/example/administrator/wingcool_gt9_apk/DataAnalysis.java

@@ -93,6 +93,8 @@ public class DataAnalysis extends AppCompatActivity
     private byte byProductType = 0;
     private static final byte GT9 = 0x01;
     private static final byte GT7 = 0x02;
+    private static final byte GT29336 = 0x03;
+    private static final byte GT2931 = 0x04;
 
     private Button btn_RawdataShow;
     private Button btn_DiffdataShow;
@@ -934,9 +936,16 @@ public class DataAnalysis extends AppCompatActivity
                             mUsbDeviceConnection.claimInterface(mUsbInterface, true);
                             if(null != mUsbEndpointIn){
                                 iProductId = usbDevice.getProductId();
-                                if ((iProductId == 0x0819) || (iProductId == 0x8191) || (iProductId == 0x0528))
+                                //if ((iProductId == 0x0819) || (iProductId == 0x8191) || (iProductId == 0x0528))
+                                //{
+                                //    byProductType = GT7;
+                                //}
+                                if ((iProductId == 0x0829) || (iProductId == 0x0528))
                                 {
-                                    byProductType = GT7;
+                                    byProductType = GT29336;
+                                }
+                                else{
+                                    byProductType = GT2931;
                                 }
                                 mHandler.sendEmptyMessage(CONNECTED_SUCCESS);
                             }
@@ -1261,9 +1270,9 @@ public class DataAnalysis extends AppCompatActivity
             iicWriteData[j] = 0x00;
         }
 
-        //int address1 = ((addressHigh&0xff)<<8);
-        //int address2 = addressLow&0xff;
-        long address = ((long)addrfirstbyte << 16) | ((long)addrsecondbyte << 8) | addrthirdbyte;
+        int address1 = ((addrsecondbyte&0xff)<<8);
+        int address2 = addrthirdbyte&0xff;
+        int address = address1|address2;
 
         int sendTimes = length/57 + 1;  //预计是向下取整,所以+1
 
@@ -1294,8 +1303,8 @@ public class DataAnalysis extends AppCompatActivity
             }
 
             address = address + 57;
-            iicWriteData[2] = (byte)(address >> 16);
-            iicWriteData[3] = (byte)(address>>8);
+            //iicWriteData[2] = (byte)((address & 0xFF0000) >> 16);
+            iicWriteData[3] = (byte)(address >> 8);
             iicWriteData[4] = (byte)address;
         }
 
@@ -1329,27 +1338,55 @@ public class DataAnalysis extends AppCompatActivity
 
     private boolean changeToDebugMode() {
         int i;
-
+        int length = 0;
         //switch to read data mode
-        if (showFlag == 1) {  //send 0x00 0x00 0x04 0x02 0x06 0x00 to [0x10174],read rawdata
-            mBytes[0] = 0x00;
-            mBytes[1] = 0x00;
-            mBytes[2] = 0x04;
-            mBytes[3] = 0x02;
-            mBytes[4] = 0x06;
-            mBytes[5] = 0x00;
+        if (showFlag == 1) {
+            if (byProductType == GT29336) {  //send 0x00 0x00 0x04 0x02 0x06 0x00 to [0x10174],read rawdata
+                mBytes[0] = 0x00;
+                mBytes[1] = 0x00;
+                mBytes[2] = 0x04;
+                mBytes[3] = 0x02;
+                mBytes[4] = 0x06;
+                mBytes[5] = 0x00;
+
+                length = 6;
+            }else {
+                mBytes[0] = 0x00;
+                mBytes[1] = 0x00;
+                mBytes[2] = 0x05;
+                mBytes[3] = (byte)0x90;
+                mBytes[4] = (byte)0x81;
+                mBytes[5] = 0x16;
+                mBytes[6] = 0x01;
+
+                length = 7;
+            }
         }
-        else if (showFlag == 3)  //send 0x00 0x00 0x04 0x01 0x05 0x00 to [0x10174],read diffdata
+        else if (showFlag == 3)
         {
-            mBytes[0] = 0x00;
-            mBytes[1] = 0x00;
-            mBytes[2] = 0x04;
-            mBytes[3] = 0x01;
-            mBytes[4] = 0x05;
-            mBytes[5] = 0x00;
+            if (byProductType == GT29336) {  //send 0x00 0x00 0x04 0x01 0x05 0x00 to [0x10174],read diffdata
+                mBytes[0] = 0x00;
+                mBytes[1] = 0x00;
+                mBytes[2] = 0x04;
+                mBytes[3] = 0x01;
+                mBytes[4] = 0x05;
+                mBytes[5] = 0x00;
+
+                length = 6;
+            }else {
+                mBytes[0] = 0x00;
+                mBytes[1] = 0x00;
+                mBytes[2] = 0x05;
+                mBytes[3] = (byte)0x90;
+                mBytes[4] = (byte)0x82;
+                mBytes[5] = 0x17;
+                mBytes[6] = 0x01;
+
+                length = 7;
+            }
         }
         for (i = 0; i < 5; i++) {
-            if (!iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6)) {
+            if (!iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, length)) {
                 SystemClock.sleep(1);
                 continue;
             }
@@ -1374,17 +1411,31 @@ public class DataAnalysis extends AppCompatActivity
     private boolean changeToNormalMode() {
 
         int i;
+        int length = 0;
 
-        //switch to normal mode, send 0x00 0x00 0x04 0x02 0x06 0x00 to [0x10174]
-        mBytes[0] = 0x00;
-        mBytes[1] = 0x00;
-        mBytes[2] = 0x04;
-        mBytes[3] = 0x00;
-        mBytes[4] = 0x04;
-        mBytes[5] = 0x00;
+        if (byProductType == GT29336) {  //switch to normal mode, send 0x00 0x00 0x04 0x00 0x04 0x00 to [0x10174]
+            mBytes[0] = 0x00;
+            mBytes[1] = 0x00;
+            mBytes[2] = 0x04;
+            mBytes[3] = 0x00;
+            mBytes[4] = 0x04;
+            mBytes[5] = 0x00;
+
+            length = 6;
+        }else {
+            mBytes[0] = 0x00;
+            mBytes[1] = 0x00;
+            mBytes[2] = 0x05;
+            mBytes[3] = (byte)0x91;
+            mBytes[4] = (byte)0x81;
+            mBytes[5] = 0x17;
+            mBytes[6] = 0x01;
+
+            length = 7;
+        }
 
         for (i = 0; i < 5; i++) {
-            if (!iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6)) {
+            if (!iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, length)) {
                 SystemClock.sleep(1);
                 continue;
             }else{
@@ -1414,18 +1465,28 @@ public class DataAnalysis extends AppCompatActivity
         switch (showFlag){
             case 1:  //rawdata
             case 6:  //test
-                if (!iicRead32Bits((byte)0x01, (byte)0xA6, (byte)0X7C, mRawdataBytes, ilength))
-                {
-                    return false;
+                if (byProductType == GT29336) {
+                    if (!iicRead32Bits((byte) 0x01, (byte) 0xA6, (byte) 0x7C, mRawdataBytes, ilength)) {
+                        return false;
+                    }
+                }else {
+                    if (!iicRead32Bits((byte) 0x01, (byte) 0x3D, (byte) 0x70, mRawdataBytes, ilength)) {
+                        return false;
+                    }
                 }
                 break;
             //case 2:  //manual diffdata
             //case 4:  //reffdata
             //case 7:  //GT7的rawdata低位在前
             case 3:  //diffdata
-                if (!iicRead32Bits((byte)0x01, (byte)0xC1, (byte)0X4C, mRawdataBytes, ilength))
-                {
-                    return false;
+                if (byProductType == GT29336) {
+                    if (!iicRead32Bits((byte) 0x01, (byte) 0xC1, (byte) 0x4C, mRawdataBytes, ilength)) {
+                        return false;
+                    }
+                }else {
+                    if (!iicRead32Bits((byte) 0x01, (byte) 0x04, (byte) 0xB2, mRawdataBytes, ilength)) {
+                        return false;
+                    }
                 }
                 break;
 
@@ -1464,10 +1525,14 @@ public class DataAnalysis extends AppCompatActivity
             iDataShow[i] = (short)datatemp[i];
         }
 
-        //clear sync flag, [0x010274] = 0
-        if (!IicWriteOneByte((byte)0x01, (byte)0x02, (byte)0x74, (byte)0x0f, (byte)0))
-        {
-            return false;
+        if (byProductType == GT29336) {  //clear sync flag, [0x010274] = 0
+            if (!IicWriteOneByte((byte) 0x01, (byte) 0x02, (byte) 0x74, (byte) 0x0f, (byte) 0)) {
+                return false;
+            }
+        }else {
+            if (!IicWriteOneByte((byte) 0x01, (byte) 0x03, (byte) 0x08, (byte) 0x0f, (byte) 0)) {
+                return false;
+            }
         }
 
         return true;
@@ -1497,6 +1562,8 @@ public class DataAnalysis extends AppCompatActivity
                 byte msubcommand = (byte) 0x0f;
                 byte mdata = (byte) 0x00;
 
+                byte addrfirstbyte, addrsecondbyte, addrthirdbyte;
+
                 if (byProductType == GT7) {
                     maddressHigh = (byte) 0x82;
                 }
@@ -1522,7 +1589,7 @@ public class DataAnalysis extends AppCompatActivity
                     stTestLog = getResources().getString(R.string.startmaxmintest);
                     stTestLogShow = stTestLogShow.concat(stTestLog);
                 }
-
+                int checktimes;
                 while(showFlag != 4) {
 
                     if(count-- == 0)
@@ -1530,15 +1597,21 @@ public class DataAnalysis extends AppCompatActivity
                         count = 0;
                     }
 
+                    checktimes = 0;
                     while(true) {
-                        //轮询读取0x010274
-                        if (!iicRead32Bits((byte)0x01, (byte)0x02, (byte)0x74, mBytes, 1))
-                        {
-                            SystemClock.sleep(1);
-                            continue;
+                        if (byProductType == GT29336) {
+                            if (!iicRead32Bits((byte) 0x01, (byte) 0x02, (byte) 0x74, mBytes, 1)) {  //轮询读取0x010274
+                                SystemClock.sleep(1);
+                                continue;
+                            }
+                        }else {
+                            if (!iicRead32Bits((byte) 0x01, (byte) 0x03, (byte) 0x08, mBytes, 1)) {  //轮询读取0x010308
+                                SystemClock.sleep(1);
+                                continue;
+                            }
                         }
 
-                        if (mBytes[0] == (byte)0x80)
+                        if (mBytes[0] == (byte)0x80)  //读到0x80则跳出去读数据
                         {
                             if (showFlag != 6) {
                                 if (byDisplayFrame == byDisplayFrameCount) {
@@ -1550,6 +1623,11 @@ public class DataAnalysis extends AppCompatActivity
 
                             break;
                         }
+
+                        if (checktimes++ > 20)  //轮询了20次没读到0x80,超时跳出去读数据
+                        {
+                            break;
+                        }
                     }
                     if (byDisplayFrame == byDisplayFrameCount) {
 
@@ -1630,7 +1708,19 @@ public class DataAnalysis extends AppCompatActivity
 
                                         int iConfigSize = 64 + (int)(byConfigBak[60] & 0xFF) * 256 + (byConfigBak[59] & 0xFF);   //the head lend is 64
 
-                                        iicWrite32Bits((byte)0x01, (byte)0x3B, (byte)0x74, byConfigBak,0,iConfigSize);
+                                        if (byProductType == GT29336) {
+                                            addrfirstbyte = (byte)0x01;
+                                            addrsecondbyte = (byte)0x3B;
+                                            addrthirdbyte = (byte)0x74;
+                                        }
+                                        else
+                                        {
+                                            addrfirstbyte = (byte)0x01;
+                                            addrsecondbyte = (byte)0x21;
+                                            addrthirdbyte = (byte)0x8C;
+                                        }
+
+                                        iicWrite32Bits(addrfirstbyte, addrsecondbyte, addrthirdbyte, byConfigBak,0,iConfigSize);
 
                                         //if (!recallCheck((byte)0x01, (byte)0x3B, (byte)0x74, mBytes, 0, iconfiglen + 64)) {
                                         //    stMessageLog = "Recall check config error!!";
@@ -1820,8 +1910,8 @@ public class DataAnalysis extends AppCompatActivity
                     break;
 
                 case CONNECTED_SUCCESS: //连接成功
-                    btn_RawdataShow.setEnabled(true);
-                    btn_DiffdataShow.setEnabled(true);
+                    //btn_RawdataShow.setEnabled(true);
+                    //btn_DiffdataShow.setEnabled(true);
                     //btn_ReffdataShow.setEnabled(true);
                     //btn_ManualdiffdataShow.setEnabled(true);
                     //btn_Manualreff.setEnabled(false);
@@ -2057,53 +2147,57 @@ public class DataAnalysis extends AppCompatActivity
                                 stTestLog = getResources().getString(R.string.testng);
                             }
 
-                            i = 0;
-                            //控制行数
-                            for (int row = 0; row < rownum; row++) {
-                                //控制列数
-                                for (int col = 0; col < colnum + 1; col++) {
+                            if (bTestMaxResult == false || bTestMinResult == false)
+                            {
+                                i = 0;
+                                //控制行数
+                                for (int row = 0; row < rownum; row++) {
+                                    //控制列数
+                                    for (int col = 0; col < colnum + 1; col++) {
 
-                                    TextView textView = new TextView(mContext);
-                                    GridLayout.LayoutParams params = new GridLayout.LayoutParams();
+                                        TextView textView = new TextView(mContext);
+                                        GridLayout.LayoutParams params = new GridLayout.LayoutParams();
 
-                                    if (col == 0) {
-                                        dv = Integer.toString(row);
-                                    } else {
+                                        if (col == 0) {
+                                            dv = Integer.toString(row);
+                                        } else {
 
-                                        dv = Integer.toString(datatemp[i]);
+                                            dv = Integer.toString(datatemp[i]);
 
-                                        //if ((bypDrvShortFlag[col - 1] == 0x55) || (bypSenShortFlag[row] == 0x55)) {
-                                        //    textView.setTextColor(Color.parseColor("#FF0000"));  //红色
-                                        //}
+                                            //if ((bypDrvShortFlag[col - 1] == 0x55) || (bypSenShortFlag[row] == 0x55)) {
+                                            //    textView.setTextColor(Color.parseColor("#FF0000"));  //红色
+                                            //}
 
-                                        if (bTestMaxResult == false) {
-                                            if (byOverMaxCount[i] > 1) {  //最大值
-                                                textView.setTextColor(Color.parseColor("#FF0000"));  //黄色
+                                            //if (bTestMaxResult == false)
+                                            {
+                                                if (byOverMaxCount[i] > 1) {  //最大值
+                                                    textView.setTextColor(Color.parseColor("#FF0000"));  //黄色
+                                                }
                                             }
-                                        }
 
-                                        if (bTestMinResult == false) {
-                                            if (byLessMinCount[i] > 1) {  //最大值
-                                                textView.setTextColor(Color.parseColor("#FFFF00"));  //黄色
+                                            //if (bTestMinResult == false)
+                                            {
+                                                if (byLessMinCount[i] > 1) {  //最大值
+                                                    textView.setTextColor(Color.parseColor("#FFFF00"));  //黄色
+                                                }
                                             }
-                                        }
 
-                                        params.width = 50;
+                                            params.width = 50;
 
-                                        i++;
-                                    }
+                                            i++;
+                                        }
 
-                                    textView.setText(dv);
-                                    textView.setGravity(Gravity.CENTER);
-                                    params.setMargins(2, 1, 2, 1);
-                                    textGridLayout.addView(textView, params);
+                                        textView.setText(dv);
+                                        textView.setGravity(Gravity.CENTER);
+                                        params.setMargins(2, 1, 2, 1);
+                                        textGridLayout.addView(textView, params);
+                                    }
                                 }
                             }
-
                             //showFlag = 5;  //stop
                             btTestStep = 2;
-                            btn_RawdataShow.setEnabled(true);
-                            btn_DiffdataShow.setEnabled(true);
+                            //btn_RawdataShow.setEnabled(true);
+                            //btn_DiffdataShow.setEnabled(true);
                             //btn_ReffdataShow.setEnabled(true);
                             //btn_ManualdiffdataShow.setEnabled(true);
                             //btn_Manualreff.setEnabled(false);
@@ -3559,25 +3653,42 @@ public class DataAnalysis extends AppCompatActivity
 
         //Tx/Rx & GND/VDD
         if (((ShortResult[0] & 0x08) >> 3)  == 1) {
-            ret = CheckGndVddShortChn();
+            if (!CheckGndVddShortChn())
+            {
+                ret = false;
+            }
         }
 
         //Tx & Tx
         if ((ShortResult[0] & 0x01) == 1) {
-            ret = CheckTxTxShortChn(ShortResult[1]);
+            if (!CheckTxTxShortChn(ShortResult[1]))
+            {
+                ret = false;
+            }
         }
 
         //Rx & Rx
         if (((ShortResult[0] & 0x02) >> 1)  == 1)  {
-            ret = CheckRxRxShortChn(ShortResult[2]);
+            if (!CheckRxRxShortChn(ShortResult[2]))
+            {
+                ret = false;
+            }
         }
 
         //Tx & Rx
         if (((ShortResult[0] & 0x04) >> 2)  == 1)  {
-            ret = CheckTxRxShortChn(ShortResult[3]);
+            if (!CheckTxRxShortChn(ShortResult[3]))
+            {
+                ret = false;
+            }
         }
 
-        return ret;
+        if (!ret)
+        {
+            return false;
+        }
+
+        return true;
     }
 
     int m_drv_gnd_vdd_resistor_threshold =500;
@@ -3703,7 +3814,12 @@ public class DataAnalysis extends AppCompatActivity
             }
         }
 
-        return ret;
+        if (!ret)
+        {
+            return false;
+        }
+
+        return true;
     }
 
     int m_drv_drv_resistor_threshold = 800;
@@ -3788,7 +3904,12 @@ public class DataAnalysis extends AppCompatActivity
             nAddr += size;
         }
 
-        return ret;
+        if (!ret)
+        {
+            return false;
+        }
+
+        return true;
     }
 
     int m_drv_sen_resistor_threshold = 800;
@@ -3832,7 +3953,7 @@ public class DataAnalysis extends AppCompatActivity
 
                     if (r < m_drv_sen_resistor_threshold && chn_id1 < 255 && chn_id2 < 255)
                     {
-                        Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(chn_id1) + " and Tx"
+                        Update_log = Update_log.concat("[Short-Circuit Test]Rx" + Integer.toString(chn_id1) + " and Rx"
                                 + Integer.toString(chn_id2) + ": " + Integer.toString((int)r) + "K Ohm\n");
 
                         mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
@@ -3846,7 +3967,12 @@ public class DataAnalysis extends AppCompatActivity
             nAddr += size;
         }
 
-        return ret;
+        if (!ret)
+        {
+            return false;
+        }
+
+        return true;
     }
 
 
@@ -3904,7 +4030,12 @@ public class DataAnalysis extends AppCompatActivity
             nAddr += size;
         }
 
-        return ret;
+        if (!ret)
+        {
+            return false;
+        }
+
+        return true;
     }
 
     private void GT29xxShortTestProc()
@@ -3926,11 +4057,23 @@ public class DataAnalysis extends AppCompatActivity
             Update_log += ", short test run code failed, test is NG!!";
             mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
 
+            //msubcommand = (byte)0x04 ;  //最高位置1。写命令4 rst IC
             if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
                 Update_log += "Reset touch IC failed!";
                 mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
-                return;
+                //return;
             }
+
+            SystemClock.sleep(30);
+
+            msubcommand = (byte)0x11 ;  //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
+            IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
+
+            SystemClock.sleep(10);
+
+            msubcommand = (byte)0x2A ;  //最高位置1,写命令42 ENABLE_ESD_CHECK
+            IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
+
             return;
         }
 
@@ -3939,11 +4082,22 @@ public class DataAnalysis extends AppCompatActivity
             Update_log += ", Short Test Send Param failed, test is NG!!";
             mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
 
+            //msubcommand = (byte)0x04 ;  //最高位置1。写命令4 rst IC
             if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
                 Update_log += "Reset touch IC failed!";
                 mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
-                return;
+                //return;
             }
+
+            SystemClock.sleep(30);
+
+            msubcommand = (byte)0x11 ;  //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
+            IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
+
+            SystemClock.sleep(10);
+
+            msubcommand = (byte)0x2A ;  //最高位置1,写命令42 ENABLE_ESD_CHECK
+            IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
             return;
         }
 
@@ -3952,11 +4106,23 @@ public class DataAnalysis extends AppCompatActivity
             Update_log += ", Wait For Short Test Finish failed, test is NG!!";
             mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
 
+            //msubcommand = (byte)0x04 ;  //最高位置1。写命令4 rst IC
             if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
                 Update_log = "Reset touch IC failed!";
                 mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
-                return;
+                //return;
             }
+
+            SystemClock.sleep(30);
+
+            msubcommand = (byte)0x11 ;  //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
+            IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
+
+            SystemClock.sleep(10);
+
+            msubcommand = (byte)0x2A ;  //最高位置1,写命令42 ENABLE_ESD_CHECK
+            IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
+
             return;
         }
 
@@ -3965,22 +4131,43 @@ public class DataAnalysis extends AppCompatActivity
             Update_log += getResources().getString(R.string.shorttestng);
             mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
 
+            //msubcommand = (byte)0x04 ;  //最高位置1。写命令4 rst IC
             if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
                 Update_log = "Reset touch IC failed!";
                 mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
-                return;
+                //return;
             }
+
+            SystemClock.sleep(30);
+
+            msubcommand = (byte)0x11 ;  //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
+            IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
+
+            SystemClock.sleep(10);
+
+            msubcommand = (byte)0x2A ;  //最高位置1,写命令42 ENABLE_ESD_CHECK
+            IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
             return;
         }
 
         if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
             Update_log = "Reset touch IC failed, short-circuit test NG!!";
             mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
-            return;
+            //return;
+        }else {
+            Update_log += getResources().getString(R.string.testpass);
+            mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
         }
 
-        Update_log += getResources().getString(R.string.testpass);
-        mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
+        SystemClock.sleep(30);
+
+        msubcommand = (byte)0x11 ;  //最高位置1,写命令17 ENABLE_DIGITER_INTERFACE
+        IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
+
+        SystemClock.sleep(10);
+
+        msubcommand = (byte)0x2A ;  //最高位置1,写命令42 ENABLE_ESD_CHECK
+        IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata);
     }
 
     //------------------------------------GT29xx short circuit test code end---------------------------------------------------------------//
@@ -3994,7 +4181,7 @@ public class DataAnalysis extends AppCompatActivity
         byte addressL;
         int iConfigSize = 0;
 
-
+        byte addrfirstbyte, addrsecondbyte, addrthirdbyte;
 
         if (byProductType == GT7)
         {
@@ -4058,21 +4245,47 @@ public class DataAnalysis extends AppCompatActivity
 
             //SystemClock.sleep(2);
 
-            //read buffer [0x13B74]
-            iicRead32Bits((byte)0x01, (byte)0x3B, (byte)0x74, mBytes, 63);  //read config head
+            if (byProductType == GT29336) {
+                addrfirstbyte = (byte)0x01;
+                addrsecondbyte = (byte)0x3B;
+                addrthirdbyte = (byte)0x74;
+            }else {
+                addrfirstbyte = (byte)0x01;
+                addrsecondbyte = (byte)0x21;
+                addrthirdbyte = (byte)0x8C;
+            }
+
+            //read buffer [0x13B74]/[0X1218C]
+            iicRead32Bits(addrfirstbyte, addrsecondbyte, addrthirdbyte, mBytes, 63);  //read config head
 
             iConfigSize = 64 + (int)(mBytes[60] & 0xFF) * 256 + (mBytes[59] & 0xFF);   //the head lend is 64
 
-            iicRead32Bits((byte)0x01, (byte)0x3B, (byte)0x74, mBytes, iConfigSize);  //read config
+            iicRead32Bits(addrfirstbyte, addrsecondbyte, addrthirdbyte, mBytes, iConfigSize);  //read config
 
             SystemClock.sleep(5);
 
-            for (int i = 0; i < 52; i++) {
-                bypCfgDrv[i] = mBytes[69 + i];
-            }
+            if (byProductType == GT29336) {
+                for (int i = 0; i < 52; i++) {
+                    bypCfgDrv[i] = mBytes[69 + i];
+                }
+
+                for (int i = 0; i < 75; i++) {
+                    bypCfgSen[i] = mBytes[121 + i];
+                }
 
-            for (int i = 0; i < 75; i++) {
-                bypCfgSen[i] = mBytes[121 + i];
+                colnum = (mBytes[67] & 0xFF) ;  //Drv Num
+                rownum = (mBytes[68] & 0xFF) ;  //Sen Num
+            }else {
+                for (int i = 0; i < 20; i++) {
+                    bypCfgDrv[i] = mBytes[68 + i];
+                }
+
+                for (int i = 0; i < 40; i++) {
+                    bypCfgSen[i] = mBytes[88 + i];
+                }
+
+                colnum = (mBytes[66] & 0xFF) ;  //Drv Num
+                rownum = (mBytes[67] & 0xFF) ;  //Sen Num
             }
 
             //备份配置
@@ -4080,9 +4293,6 @@ public class DataAnalysis extends AppCompatActivity
                 byConfigBak[i] = mBytes[i];
             }
 
-            colnum = (mBytes[67] & 0xFF) ;
-            rownum = (mBytes[68] & 0xFF) ;
-
             //send 0x00 0x00 0x04 0x08 0x0C 0x00 to [0x10174],通知GT29XX,通信结束
             mBytes[0] = 0x00;
             mBytes[1] = 0x00;
@@ -4182,6 +4392,7 @@ public class DataAnalysis extends AppCompatActivity
 
         switch (view.getId()) {
             case R.id.rawdata:   //Read RawData
+            /*
                 showFlag =1;
 
                 changeToDebugMode();
@@ -4197,10 +4408,11 @@ public class DataAnalysis extends AppCompatActivity
                     tvDataContent.setText("[" + getResources().getString(R.string.rawdata) + "]");
                     showRawdata();
                 }
-
+            */
                 break;
 
             case R.id.diffdata:
+            /*
                 showFlag = 3;
                 if (byProductType == GT7)
                 {
@@ -4219,6 +4431,7 @@ public class DataAnalysis extends AppCompatActivity
                     tvDataContent.setText("[" + getResources().getString(R.string.diffdata) + "]");
                     showRawdata();
                 }
+            */
                 break;
 
             case R.id.reffdata:
@@ -4310,8 +4523,8 @@ public class DataAnalysis extends AppCompatActivity
                     edt_ColNum.setText("");
                     edt_RowNum.setText("");
 
-                    btn_RawdataShow.setEnabled(true);
-                    btn_DiffdataShow.setEnabled(true);
+                    //btn_RawdataShow.setEnabled(true);
+                    //btn_DiffdataShow.setEnabled(true);
                     //btn_ReffdataShow.setEnabled(true);
                     //btn_ManualdiffdataShow.setEnabled(true);
                     //btn_Manualreff.setEnabled(false);
@@ -4321,6 +4534,25 @@ public class DataAnalysis extends AppCompatActivity
                     break;
                 }
 
+                addrfirstbyte = (byte)0x01;
+                addrsecondbyte = (byte)0x01;
+                addrthirdbyte = (byte)0x74;;
+                byte msubcommand = (byte)0x12;  //最高位置1,写命令18 DISABLE_DIGITER_INTERFACE
+                byte mdata = (byte)0x00;
+
+                if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
+                    return;
+                }
+
+                SystemClock.sleep(10);
+
+                msubcommand = (byte)0x2B;  //最高位置1,写命令43 DISABLE_ESD_CHECK
+                mdata = (byte)0x00;
+
+                if(!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
+                    return;
+                }
+
                 //send 0x00 to [0x10174],清除标志
                 mBytes[0] = 0x00;
                 iicWrite32Bits((byte)0x01, (byte)0x01, (byte)0x74, mBytes,0,1);
@@ -4346,9 +4578,12 @@ public class DataAnalysis extends AppCompatActivity
                      mBytes[i] = byConfigBak[i];
                 }
 
-                mBytes[287] = (byte)((mBytes[287] & 0xFF) - 4);  // disable hopping [287],0x04
-                mBytes[1118] = (byte)((mBytes[1118] & 0xFF) - 3);  // disable normalize [1118],0x03
-
+                if (byProductType == GT29336) {
+                    mBytes[287] = (byte) ((mBytes[287] & 0xFF) - 4);  // disable hopping [385],0x04
+                    mBytes[1120] = (byte) ((mBytes[1120] & 0xFF) - 3);  // disable NormalizeEn & NormalizeCheckEn [1120],0x03
+                }else {
+                    //todo
+                }
                 //配置长度(不含head buffer长度)
                 int iconfiglen = (int)(mBytes[60] & 0xFF) * 256 + (mBytes[59] & 0xFF);
 
@@ -4364,7 +4599,18 @@ public class DataAnalysis extends AppCompatActivity
                 mBytes[iconfiglen + 64 - 2] = (byte)((lchecksum & 0x00ff0000) >> 16);
                 mBytes[iconfiglen + 64 - 1] = (byte)((lchecksum & 0xff000000) >> 24);
 
-                iicWrite32Bits((byte)0x01, (byte)0x3B, (byte)0x74, mBytes,0,iconfiglen + 64);
+                if (byProductType == GT29336) {
+                    addrfirstbyte = (byte)0x01;
+                    addrsecondbyte = (byte)0x3B;
+                    addrthirdbyte = (byte)0x74;
+                }else {
+                    addrfirstbyte = (byte)0x01;
+                    addrsecondbyte = (byte)0x21;
+                    addrthirdbyte = (byte)0x8C;
+                }
+
+                //iicWrite32Bits((byte)0x01, (byte)0x3B, (byte)0x74, mBytes,0,iconfiglen + 64);
+                iicWrite32Bits(addrfirstbyte, addrsecondbyte, addrthirdbyte, mBytes, 0, iconfiglen + 64);  //read config
 
                 //if (!recallCheck((byte)0x01, (byte)0x3B, (byte)0x74, mBytes, 0, iconfiglen + 64)) {
                 //    stMessageLog = "Recall check config error!!";
@@ -4490,8 +4736,8 @@ public class DataAnalysis extends AppCompatActivity
             case R.id.stop:    //back
                 showFlag = 5;
 
-                btn_RawdataShow.setEnabled(true);
-                btn_DiffdataShow.setEnabled(true);
+                //btn_RawdataShow.setEnabled(true);
+                //btn_DiffdataShow.setEnabled(true);
                 //btn_ReffdataShow.setEnabled(true);
                 //btn_ManualdiffdataShow.setEnabled(true);
                 btn_Manualreff.setEnabled(false);
@@ -4554,8 +4800,8 @@ public class DataAnalysis extends AppCompatActivity
                 case 8:  //stylusdata
                     showFlag = 5;
 
-                    btn_RawdataShow.setEnabled(true);
-                    btn_DiffdataShow.setEnabled(true);
+                    //btn_RawdataShow.setEnabled(true);
+                    //btn_DiffdataShow.setEnabled(true);
                     //btn_ReffdataShow.setEnabled(true);
                     //btn_ManualdiffdataShow.setEnabled(true);
                     btn_Manualreff.setEnabled(false);

+ 1 - 1
app/src/main/res/values-en/strings.xml

@@ -107,7 +107,7 @@
     <string name="companyaddr">Address:Room 2008, Chuangxingda Business Building, No.36 Liuxian 3rd Road, Baoan District, Shenzhen</string>
     <string name="telephonenum">Telephone:186 8896 1937</string>
     <string name="emailaddr">Email:max@wingcool.cn</string>
-    <string name="version">APK Version:v3.0.0_20220916-Debug Version</string>
+    <string name="version">APK Version:v3.0.1_20230425-Debug Version</string>
 
     <!-- other -->
     <string name="app_name">WingCoolAPK</string>

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -107,7 +107,7 @@
     <string name="companyaddr">地址:深圳市宝安区留仙三路 36 号创兴达商务大厦 2008 室</string>
     <string name="telephonenum">电话:186 8896 1937</string>
     <string name="emailaddr">邮箱:max@wingcool.cn</string>
-    <string name="version">APK版本:v3.0.0_20220916-debug版本</string>
+    <string name="version">APK版本:v3.0.1_20230425-debug版本</string>
 
     <!-- other -->
     <string name="app_name">WingCoolAPK</string>