|
@@ -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);
|