|
@@ -4330,22 +4330,23 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
byte addrfirstbyte, addrsecondbyte, addrthirdbyte;
|
|
|
|
|
|
- switch (view.getId()) {
|
|
|
- case R.id.stop: //back
|
|
|
- showFlag = 5;
|
|
|
-
|
|
|
- btn_RawdataShow.setEnabled(true);
|
|
|
- btn_DiffdataShow.setEnabled(true);
|
|
|
- //btn_ReffdataShow.setEnabled(true);
|
|
|
- //btn_ManualdiffdataShow.setEnabled(true);
|
|
|
- btn_Manualreff.setEnabled(false);
|
|
|
- //btn_StylusDataShow.setEnabled(true);
|
|
|
- btn_Test.setEnabled(true);
|
|
|
- //count = 1000;
|
|
|
- //changeToNormalMode();
|
|
|
- break;
|
|
|
-
|
|
|
- default: {
|
|
|
+ //switch (view.getId()) {
|
|
|
+ if (view.getId() == R.id.stop) { //back
|
|
|
+ showFlag = 5;
|
|
|
+
|
|
|
+ btn_RawdataShow.setEnabled(true);
|
|
|
+ btn_DiffdataShow.setEnabled(true);
|
|
|
+ //btn_ReffdataShow.setEnabled(true);
|
|
|
+ //btn_ManualdiffdataShow.setEnabled(true);
|
|
|
+ btn_Manualreff.setEnabled(false);
|
|
|
+ //btn_StylusDataShow.setEnabled(true);
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+ //count = 1000;
|
|
|
+ //changeToNormalMode();
|
|
|
+ // break;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ //default: {
|
|
|
|
|
|
if (byProductType == GT7) {
|
|
|
addressH = (byte) 0x80;
|
|
@@ -4548,13 +4549,13 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
btn_StylusDataShow.setEnabled(false);
|
|
|
btn_Test.setEnabled(false);
|
|
|
|
|
|
- switch (view.getId()) {
|
|
|
- case R.id.rawdata: //Read RawData
|
|
|
+ //switch (view.getId()) {
|
|
|
+ if (view.getId() == R.id.rawdata) { //Read RawData
|
|
|
|
|
|
- showFlag = 1;
|
|
|
+ showFlag = 1;
|
|
|
|
|
|
- changeToDebugMode();
|
|
|
- //count = 1000;
|
|
|
+ changeToDebugMode();
|
|
|
+ //count = 1000;
|
|
|
/*
|
|
|
showAddressHigh = (byte)0x8b;
|
|
|
showAddressLow = (byte)0x98;
|
|
@@ -4568,252 +4569,258 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
showRawdata();
|
|
|
}
|
|
|
*/
|
|
|
- showRawdata();
|
|
|
- break;
|
|
|
-
|
|
|
- case R.id.diffdata:
|
|
|
+ showRawdata();
|
|
|
+ }
|
|
|
+ // break;
|
|
|
+ else if (view.getId() == R.id.diffdata) {
|
|
|
+ //case R.id.diffdata:
|
|
|
|
|
|
- //showFlag = 3;
|
|
|
- //if (byProductType == GT7)
|
|
|
- {
|
|
|
- showFlag = 7; //GT7系列的差值是2bytes,按照RawData的方式去显示
|
|
|
- }
|
|
|
+ //showFlag = 3;
|
|
|
+ //if (byProductType == GT7)
|
|
|
+ {
|
|
|
+ showFlag = 7; //GT7系列的差值是2bytes,按照RawData的方式去显示
|
|
|
+ }
|
|
|
|
|
|
- changeToDebugMode();
|
|
|
- //showAddressHigh = (byte)0xbb;
|
|
|
- //showAddressLow = (byte)0x10;
|
|
|
- //if (byProductType == GT7)
|
|
|
- //{
|
|
|
- // showAddressHigh = (byte)0x8a;
|
|
|
- // showAddressLow = (byte)0xc0;
|
|
|
- //}
|
|
|
- //if(count == 1000) {
|
|
|
- // tvDataContent.setText("[" + getResources().getString(R.string.diffdata) + "]");
|
|
|
- //}
|
|
|
- showRawdata();
|
|
|
+ changeToDebugMode();
|
|
|
+ //showAddressHigh = (byte)0xbb;
|
|
|
+ //showAddressLow = (byte)0x10;
|
|
|
+ //if (byProductType == GT7)
|
|
|
+ //{
|
|
|
+ // showAddressHigh = (byte)0x8a;
|
|
|
+ // showAddressLow = (byte)0xc0;
|
|
|
+ //}
|
|
|
+ //if(count == 1000) {
|
|
|
+ // tvDataContent.setText("[" + getResources().getString(R.string.diffdata) + "]");
|
|
|
+ //}
|
|
|
+ showRawdata();
|
|
|
+ }
|
|
|
+ // break;
|
|
|
|
|
|
- break;
|
|
|
+ else if (view.getId() == R.id.reffdata) {
|
|
|
+ showFlag = 4;
|
|
|
+ count = 1000;
|
|
|
+ showAddressHigh = (byte) 0x81;
|
|
|
+ showAddressLow = (byte) 0xc0;
|
|
|
+ if (byProductType == GT7) {
|
|
|
+ showAddressHigh = (byte) 0xa5;
|
|
|
+ showAddressLow = (byte) 0x58;
|
|
|
+ }
|
|
|
+ tvDataContent.setText("[" + getResources().getString(R.string.reffdata) + "]");
|
|
|
+ getRawdata();
|
|
|
+ mHandler.sendEmptyMessage(RAWDATA_MESSAGE);
|
|
|
+ btn_RawdataShow.setEnabled(true);
|
|
|
+ btn_DiffdataShow.setEnabled(true);
|
|
|
+ //btn_ReffdataShow.setEnabled(true);
|
|
|
+ //btn_ManualdiffdataShow.setEnabled(true);
|
|
|
+ //btn_Manualreff.setEnabled(false);
|
|
|
+ //btn_StylusDataShow.setEnabled(true);
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
+ }
|
|
|
+ // break;
|
|
|
|
|
|
- case R.id.reffdata:
|
|
|
- showFlag = 4;
|
|
|
+ else if (view.getId() == R.id.manualdiff) {
|
|
|
+ showFlag = 2;
|
|
|
+ btn_Manualreff.setEnabled(true);
|
|
|
+ changeToDebugMode();
|
|
|
+ showAddressHigh = (byte) 0x8b;
|
|
|
+ showAddressLow = (byte) 0x98;
|
|
|
+ if (byProductType == GT7) {
|
|
|
+ showAddressHigh = (byte) 0xbf;
|
|
|
+ showAddressLow = (byte) 0xf0;
|
|
|
+ }
|
|
|
+ if (count == 1000) {
|
|
|
+ tvDataContent.setText("[" + getResources().getString(R.string.manualdiff) + "]");
|
|
|
+ showRawdata();
|
|
|
+ } else {
|
|
|
count = 1000;
|
|
|
- showAddressHigh = (byte) 0x81;
|
|
|
- showAddressLow = (byte) 0xc0;
|
|
|
- if (byProductType == GT7) {
|
|
|
- showAddressHigh = (byte) 0xa5;
|
|
|
- showAddressLow = (byte) 0x58;
|
|
|
- }
|
|
|
- tvDataContent.setText("[" + getResources().getString(R.string.reffdata) + "]");
|
|
|
- getRawdata();
|
|
|
- mHandler.sendEmptyMessage(RAWDATA_MESSAGE);
|
|
|
- btn_RawdataShow.setEnabled(true);
|
|
|
- btn_DiffdataShow.setEnabled(true);
|
|
|
- //btn_ReffdataShow.setEnabled(true);
|
|
|
- //btn_ManualdiffdataShow.setEnabled(true);
|
|
|
- //btn_Manualreff.setEnabled(false);
|
|
|
- //btn_StylusDataShow.setEnabled(true);
|
|
|
- btn_Test.setEnabled(true);
|
|
|
- break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // break;
|
|
|
|
|
|
- case R.id.manualdiff:
|
|
|
- showFlag = 2;
|
|
|
- btn_Manualreff.setEnabled(true);
|
|
|
- changeToDebugMode();
|
|
|
+ else if (view.getId() == R.id.manualreff) { //set up manual ref
|
|
|
+ showFlag = 2;
|
|
|
+ btn_Manualreff.setEnabled(true);
|
|
|
+ count = 1000;
|
|
|
+
|
|
|
+ if (byProductType == GT7) {
|
|
|
+ showAddressHigh = (byte) 0xbf;
|
|
|
+ showAddressLow = (byte) 0xf0;
|
|
|
+ } else {
|
|
|
showAddressHigh = (byte) 0x8b;
|
|
|
showAddressLow = (byte) 0x98;
|
|
|
- if (byProductType == GT7) {
|
|
|
- showAddressHigh = (byte) 0xbf;
|
|
|
- showAddressLow = (byte) 0xf0;
|
|
|
- }
|
|
|
- if (count == 1000) {
|
|
|
- tvDataContent.setText("[" + getResources().getString(R.string.manualdiff) + "]");
|
|
|
- showRawdata();
|
|
|
- } else {
|
|
|
- count = 1000;
|
|
|
- }
|
|
|
- break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // break;
|
|
|
|
|
|
- case R.id.manualreff: //set up manual ref
|
|
|
- showFlag = 2;
|
|
|
- btn_Manualreff.setEnabled(true);
|
|
|
- count = 1000;
|
|
|
+ else if (view.getId() == R.id.stylusdata) { //主动笔数据
|
|
|
+ if (byProductType == GT7) //GT7系列才显示
|
|
|
+ {
|
|
|
+ showFlag = 8;
|
|
|
|
|
|
- if (byProductType == GT7) {
|
|
|
- showAddressHigh = (byte) 0xbf;
|
|
|
- showAddressLow = (byte) 0xf0;
|
|
|
- } else {
|
|
|
- showAddressHigh = (byte) 0x8b;
|
|
|
- showAddressLow = (byte) 0x98;
|
|
|
- }
|
|
|
- break;
|
|
|
+ changeToDebugMode();
|
|
|
|
|
|
- case R.id.stylusdata: //主动笔数据
|
|
|
- if (byProductType == GT7) //GT7系列才显示
|
|
|
- {
|
|
|
- showFlag = 8;
|
|
|
+ textGridLayout.removeAllViews();
|
|
|
|
|
|
- changeToDebugMode();
|
|
|
+ textGridLayout.setColumnCount(rownum + 1); //列数=感应数
|
|
|
+ textGridLayout.setRowCount(colnum + 1); //行数=驱动数
|
|
|
|
|
|
- textGridLayout.removeAllViews();
|
|
|
+ showAddressHigh = (byte) 0xDD;
|
|
|
+ showAddressLow = (byte) 0x58;
|
|
|
|
|
|
- textGridLayout.setColumnCount(rownum + 1); //列数=感应数
|
|
|
- textGridLayout.setRowCount(colnum + 1); //行数=驱动数
|
|
|
+ if (count == 1000) {
|
|
|
+ tvDataContent.setText("[" + getResources().getString(R.string.stylusdata) + "]");
|
|
|
+ showRawdata();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // break;
|
|
|
|
|
|
- showAddressHigh = (byte) 0xDD;
|
|
|
- showAddressLow = (byte) 0x58;
|
|
|
+ else if (view.getId() == R.id.testting) { //start test
|
|
|
|
|
|
- if (count == 1000) {
|
|
|
- tvDataContent.setText("[" + getResources().getString(R.string.stylusdata) + "]");
|
|
|
- showRawdata();
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
+ if (edit_search.getText().length() == 0) {
|
|
|
+ Toast.makeText(this, getResources().getString(R.string.nameandformat), Toast.LENGTH_SHORT).show();
|
|
|
|
|
|
- case R.id.testting: //start test
|
|
|
+ edt_ColNum.setText("");
|
|
|
+ edt_RowNum.setText("");
|
|
|
|
|
|
- if (edit_search.getText().length() == 0) {
|
|
|
- Toast.makeText(this, getResources().getString(R.string.nameandformat), Toast.LENGTH_SHORT).show();
|
|
|
+ btn_RawdataShow.setEnabled(true);
|
|
|
+ btn_DiffdataShow.setEnabled(true);
|
|
|
+ //btn_ReffdataShow.setEnabled(true);
|
|
|
+ //btn_ManualdiffdataShow.setEnabled(true);
|
|
|
+ //btn_Manualreff.setEnabled(false);
|
|
|
+ //btn_StylusDataShow.setEnabled(true);
|
|
|
+ btn_Test.setEnabled(true);
|
|
|
|
|
|
- edt_ColNum.setText("");
|
|
|
- edt_RowNum.setText("");
|
|
|
+ //break;
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- btn_RawdataShow.setEnabled(true);
|
|
|
- btn_DiffdataShow.setEnabled(true);
|
|
|
- //btn_ReffdataShow.setEnabled(true);
|
|
|
- //btn_ManualdiffdataShow.setEnabled(true);
|
|
|
- //btn_Manualreff.setEnabled(false);
|
|
|
- //btn_StylusDataShow.setEnabled(true);
|
|
|
- btn_Test.setEnabled(true);
|
|
|
+ addrfirstbyte = (byte) 0x01;
|
|
|
+ addrsecondbyte = (byte) 0x01;
|
|
|
+ addrthirdbyte = (byte) 0x74;
|
|
|
+ ;
|
|
|
+ byte msubcommand = (byte) 0x12; //最高位置1,写命令18 DISABLE_DIGITER_INTERFACE
|
|
|
+ byte mdata = (byte) 0x00;
|
|
|
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- addrfirstbyte = (byte) 0x01;
|
|
|
- addrsecondbyte = (byte) 0x01;
|
|
|
- addrthirdbyte = (byte) 0x74;
|
|
|
- ;
|
|
|
- byte msubcommand = (byte) 0x12; //最高位置1,写命令18 DISABLE_DIGITER_INTERFACE
|
|
|
- byte mdata = (byte) 0x00;
|
|
|
+ SystemClock.sleep(10);
|
|
|
|
|
|
- if (!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ msubcommand = (byte) 0x2B; //最高位置1,写命令43 DISABLE_ESD_CHECK
|
|
|
+ mdata = (byte) 0x00;
|
|
|
|
|
|
- SystemClock.sleep(10);
|
|
|
+ if (!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- msubcommand = (byte) 0x2B; //最高位置1,写命令43 DISABLE_ESD_CHECK
|
|
|
- mdata = (byte) 0x00;
|
|
|
+ //send 0x00 to [0x10174],清除标志
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 1);
|
|
|
+ SystemClock.sleep(15);
|
|
|
|
|
|
- if (!IicWriteOneByte(addrfirstbyte, addrsecondbyte, addrthirdbyte, msubcommand, mdata)) {
|
|
|
- return;
|
|
|
- }
|
|
|
+ //send 0x00 0x00 0x04 0x04 0x08 0x00 to [0x10174],通知GT29XX,send cfg
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x04;
|
|
|
+ mBytes[4] = 0x08;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
|
|
|
- //send 0x00 to [0x10174],清除标志
|
|
|
- mBytes[0] = 0x00;
|
|
|
- iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 1);
|
|
|
- SystemClock.sleep(15);
|
|
|
-
|
|
|
- //send 0x00 0x00 0x04 0x04 0x08 0x00 to [0x10174],通知GT29XX,send cfg
|
|
|
- mBytes[0] = 0x00;
|
|
|
- mBytes[1] = 0x00;
|
|
|
- mBytes[2] = 0x04;
|
|
|
- mBytes[3] = 0x04;
|
|
|
- mBytes[4] = 0x08;
|
|
|
- mBytes[5] = 0x00;
|
|
|
- iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
-
|
|
|
- //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已准备好,可以send cfg
|
|
|
- do {
|
|
|
- SystemClock.sleep(30);
|
|
|
- iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
- } while (mBytes[0] != (byte) 0x80);
|
|
|
+ //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已准备好,可以send cfg
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
+ } while (mBytes[0] != (byte) 0x80);
|
|
|
|
|
|
- //配置
|
|
|
- for (int i = 0; i < iConfigSize; i++) {
|
|
|
- mBytes[i] = byConfigBak[i];
|
|
|
- }
|
|
|
+ //配置
|
|
|
+ for (int i = 0; i < iConfigSize; i++) {
|
|
|
+ mBytes[i] = byConfigBak[i];
|
|
|
+ }
|
|
|
|
|
|
- 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);
|
|
|
-
|
|
|
- //计算配置的checksum,不含64字节的head buffer
|
|
|
- long lchecksum = 0;
|
|
|
- for (int i = 64; i < (iconfiglen + 64 - 4); i += 2) {
|
|
|
- int vb = ((mBytes[i + 1] & 0xFF) << 8) + (mBytes[i] & 0xFF);
|
|
|
- lchecksum = lchecksum + vb;
|
|
|
- }
|
|
|
+ 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);
|
|
|
+
|
|
|
+ //计算配置的checksum,不含64字节的head buffer
|
|
|
+ long lchecksum = 0;
|
|
|
+ for (int i = 64; i < (iconfiglen + 64 - 4); i += 2) {
|
|
|
+ int vb = ((mBytes[i + 1] & 0xFF) << 8) + (mBytes[i] & 0xFF);
|
|
|
+ lchecksum = lchecksum + vb;
|
|
|
+ }
|
|
|
|
|
|
- mBytes[iconfiglen + 64 - 4] = (byte) (lchecksum & 0x000000ff);
|
|
|
- mBytes[iconfiglen + 64 - 3] = (byte) ((lchecksum & 0x0000ff00) >> 8);
|
|
|
- mBytes[iconfiglen + 64 - 2] = (byte) ((lchecksum & 0x00ff0000) >> 16);
|
|
|
- mBytes[iconfiglen + 64 - 1] = (byte) ((lchecksum & 0xff000000) >> 24);
|
|
|
+ mBytes[iconfiglen + 64 - 4] = (byte) (lchecksum & 0x000000ff);
|
|
|
+ mBytes[iconfiglen + 64 - 3] = (byte) ((lchecksum & 0x0000ff00) >> 8);
|
|
|
+ mBytes[iconfiglen + 64 - 2] = (byte) ((lchecksum & 0x00ff0000) >> 16);
|
|
|
+ mBytes[iconfiglen + 64 - 1] = (byte) ((lchecksum & 0xff000000) >> 24);
|
|
|
|
|
|
- if (byProductType == GT29336) {
|
|
|
- addrfirstbyte = (byte) 0x01;
|
|
|
- addrsecondbyte = (byte) 0x3B;
|
|
|
- addrthirdbyte = (byte) 0x74;
|
|
|
- } else {
|
|
|
- addrfirstbyte = (byte) 0x01;
|
|
|
- addrsecondbyte = (byte) 0x21;
|
|
|
- addrthirdbyte = (byte) 0x8C;
|
|
|
- }
|
|
|
+ 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
|
|
|
+ //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!!";
|
|
|
- // stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
- //} else {
|
|
|
- // stMessageLog = "Recall check config success!!";
|
|
|
- // stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
- //}
|
|
|
+ //if (!recallCheck((byte)0x01, (byte)0x3B, (byte)0x74, mBytes, 0, iconfiglen + 64)) {
|
|
|
+ // stMessageLog = "Recall check config error!!";
|
|
|
+ // stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
+ //} else {
|
|
|
+ // stMessageLog = "Recall check config success!!";
|
|
|
+ // stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
+ //}
|
|
|
|
|
|
- SystemClock.sleep(8);
|
|
|
+ SystemClock.sleep(8);
|
|
|
|
|
|
- //send 0x00 0x00 0x04 0x05 0x09 0x00 to [0x10174],通知GT29XX,cfg发送完毕
|
|
|
- mBytes[0] = 0x00;
|
|
|
- mBytes[1] = 0x00;
|
|
|
- mBytes[2] = 0x04;
|
|
|
- mBytes[3] = 0x05;
|
|
|
- mBytes[4] = 0x09;
|
|
|
- mBytes[5] = 0x00;
|
|
|
- iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
+ //send 0x00 0x00 0x04 0x05 0x09 0x00 to [0x10174],通知GT29XX,cfg发送完毕
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x05;
|
|
|
+ mBytes[4] = 0x09;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
|
|
|
- //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已接收配置
|
|
|
- do {
|
|
|
- SystemClock.sleep(30);
|
|
|
- iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
- if (mBytes[0] == (byte) 0x03) {
|
|
|
- //stMessageLog = "Config checksum is error!!";
|
|
|
- //stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
- break;
|
|
|
- }
|
|
|
+ //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已接收配置
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
+ if (mBytes[0] == (byte) 0x03) {
|
|
|
+ //stMessageLog = "Config checksum is error!!";
|
|
|
+ //stMessageLogShow = stMessageLogShow.concat(stMessageLog);
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
- } while (mBytes[0] != (byte) 0x80);
|
|
|
+ } while (mBytes[0] != (byte) 0x80);
|
|
|
|
|
|
- SystemClock.sleep(15);
|
|
|
+ SystemClock.sleep(15);
|
|
|
|
|
|
- //send 0x00 0x00 0x04 0x06 0x0A 0x00 to [0x10174],通知GT29XX,流程完成
|
|
|
- mBytes[0] = 0x00;
|
|
|
- mBytes[1] = 0x00;
|
|
|
- mBytes[2] = 0x04;
|
|
|
- mBytes[3] = 0x06;
|
|
|
- mBytes[4] = 0x0A;
|
|
|
- mBytes[5] = 0x00;
|
|
|
- iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
+ //send 0x00 0x00 0x04 0x06 0x0A 0x00 to [0x10174],通知GT29XX,流程完成
|
|
|
+ mBytes[0] = 0x00;
|
|
|
+ mBytes[1] = 0x00;
|
|
|
+ mBytes[2] = 0x04;
|
|
|
+ mBytes[3] = 0x06;
|
|
|
+ mBytes[4] = 0x0A;
|
|
|
+ mBytes[5] = 0x00;
|
|
|
+ iicWrite32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 0, 6);
|
|
|
|
|
|
- //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已完成
|
|
|
- do {
|
|
|
- SystemClock.sleep(30);
|
|
|
- iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
- } while (mBytes[0] != (byte) 0x80);
|
|
|
+ //30ms一次轮询[0x10174],如果是0x80,说明GT29XX已完成
|
|
|
+ do {
|
|
|
+ SystemClock.sleep(30);
|
|
|
+ iicRead32Bits((byte) 0x01, (byte) 0x01, (byte) 0x74, mBytes, 1);
|
|
|
+ } while (mBytes[0] != (byte) 0x80);
|
|
|
|
|
|
/*
|
|
|
if (edt_Maximum.getText().length() == 0)
|
|
@@ -4867,25 +4874,26 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
showRawdata();
|
|
|
}
|
|
|
*/
|
|
|
- for (int i = 0; i < 52 * 75; i++) {
|
|
|
- byOverMaxCount[i] = 0;
|
|
|
- byLessMinCount[i] = 0;
|
|
|
- byOverAdjCount[i] = 0;
|
|
|
- }
|
|
|
+ for (int i = 0; i < 52 * 75; i++) {
|
|
|
+ byOverMaxCount[i] = 0;
|
|
|
+ byLessMinCount[i] = 0;
|
|
|
+ byOverAdjCount[i] = 0;
|
|
|
+ }
|
|
|
|
|
|
- bTestMaxResult = true;
|
|
|
- bTestMinResult = true;
|
|
|
+ bTestMaxResult = true;
|
|
|
+ bTestMinResult = true;
|
|
|
|
|
|
- showFlag = 6;
|
|
|
- byTestCount = 0;
|
|
|
- byMaximumOverCount = 0;
|
|
|
- byMinimumOverCount = 0;
|
|
|
- byReTestCount = 0;
|
|
|
- if (count == 1000) {
|
|
|
- //tvDataContent.setText("["+getResources().getString(R.string.rawdata)+"]");
|
|
|
- showRawdata();
|
|
|
- }
|
|
|
- break;
|
|
|
+ showFlag = 6;
|
|
|
+ byTestCount = 0;
|
|
|
+ byMaximumOverCount = 0;
|
|
|
+ byMinimumOverCount = 0;
|
|
|
+ byReTestCount = 0;
|
|
|
+ if (count == 1000) {
|
|
|
+ //tvDataContent.setText("["+getResources().getString(R.string.rawdata)+"]");
|
|
|
+ showRawdata();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // break;
|
|
|
/*
|
|
|
case R.id.stop: //back
|
|
|
showFlag = 5;
|
|
@@ -4901,11 +4909,11 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
//changeToNormalMode();
|
|
|
break;
|
|
|
*/
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
+ // default:
|
|
|
+ // break;
|
|
|
+ //}
|
|
|
+ //}
|
|
|
+ //break;
|
|
|
}
|
|
|
}
|
|
|
|