|
@@ -3255,22 +3255,22 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
|
|
|
//gnSenMaxNum最大75,gnDrvMaxNum最大52(考虑可转换的通道)
|
|
|
byte[] pBuf = new byte[75 * 52 * 2];
|
|
|
- //byte[] ShortResult = new byte[8];
|
|
|
+ byte[] ShortResult = new byte[64];
|
|
|
//stBerlinShortResult short_res;
|
|
|
|
|
|
//read buffer [0x020410]
|
|
|
- if (!iicRead32Bits((byte)0x02, (byte)0x04, (byte)0x10, mBytes, 8))
|
|
|
+ if (!iicRead32Bits((byte)0x02, (byte)0x04, (byte)0x10, ShortResult, 8))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
ichecksum = 0;
|
|
|
for (int i = 0; i < 6; i++) {
|
|
|
- int vb = mBytes[i] & 0xFF;
|
|
|
+ int vb = ShortResult[i] & 0xFF;
|
|
|
ichecksum = ichecksum + vb;
|
|
|
}
|
|
|
|
|
|
- if (ichecksum != ((int)(mBytes[7] & 0xFF) * 256 + (mBytes[6] & 0xFF)))
|
|
|
+ if (ichecksum != ((int)(ShortResult[7] & 0xFF) * 256 + (ShortResult[6] & 0xFF)))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
@@ -3286,23 +3286,23 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
//short_res.sxgnd_short_num = mBytes[5];
|
|
|
|
|
|
//Tx/Rx & GND/VDD
|
|
|
- if (((mBytes[0] & 0x08) >> 3) == 1) {
|
|
|
+ if (((ShortResult[0] & 0x08) >> 3) == 1) {
|
|
|
ret = CheckGndVddShortChn();
|
|
|
}
|
|
|
|
|
|
//Tx & Tx
|
|
|
- if ((mBytes[0] & 0x01) == 1) {
|
|
|
- ret = CheckTxTxShortChn(mBytes[1]);
|
|
|
+ if ((ShortResult[0] & 0x01) == 1) {
|
|
|
+ ret = CheckTxTxShortChn(ShortResult[1]);
|
|
|
}
|
|
|
|
|
|
//Rx & Rx
|
|
|
- if (((mBytes[0] & 0x02) >> 1) == 1) {
|
|
|
- ret = CheckRxRxShortChn(mBytes[2]);
|
|
|
+ if (((ShortResult[0] & 0x02) >> 1) == 1) {
|
|
|
+ ret = CheckRxRxShortChn(ShortResult[2]);
|
|
|
}
|
|
|
|
|
|
//Tx & Rx
|
|
|
- if (((mBytes[0] & 0x04) >> 2) == 1) {
|
|
|
- ret = CheckTxRxShortChn(mBytes[3]);
|
|
|
+ if (((ShortResult[0] & 0x04) >> 2) == 1) {
|
|
|
+ ret = CheckTxRxShortChn(ShortResult[3]);
|
|
|
}
|
|
|
|
|
|
return ret;
|
|
@@ -3345,7 +3345,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
r = (float)((150500 / (float)diff_code) - 60);//TODO berlinD 145000 -15
|
|
|
r = r >= 0 ? r : 0;
|
|
|
|
|
|
- chn = GetDriverChn(chn);
|
|
|
+ //chn = GetDriverChn(chn);
|
|
|
|
|
|
if (r < m_drv_gnd_vdd_resistor_threshold && chn < 255)
|
|
|
{
|
|
@@ -3363,7 +3363,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
r = ((float)(1.25 * 1024 * (3.3 - 1.25) * 99) / (float)diff_code) - 60;//TODO berlinD *93 -20
|
|
|
r = r >= 0 ? r : 0;
|
|
|
|
|
|
- chn = GetDriverChn(chn);
|
|
|
+ //chn = GetDriverChn(chn);
|
|
|
|
|
|
if (r < m_drv_gnd_vdd_resistor_threshold && chn < 255)
|
|
|
{
|
|
@@ -3398,7 +3398,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
r = (float)((150500 / (float)diff_code) - 60);//TODO BerlinB 145000 -15
|
|
|
r = r >= 0 ? r : 0;
|
|
|
|
|
|
- chn = GetSensorChn(chn);
|
|
|
+ //chn = GetSensorChn(chn);
|
|
|
|
|
|
if (r < m_sen_gnd_vdd_resistor_threshold && chn < 255)
|
|
|
{
|
|
@@ -3416,7 +3416,7 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
r = ((float)(1.25 * 1024 * (3.3 - 1.25) * 99) / (float)diff_code) - 60;
|
|
|
r = r >= 0 ? r : 0;
|
|
|
|
|
|
- chn = GetSensorChn(chn);
|
|
|
+ //chn = GetSensorChn(chn);
|
|
|
|
|
|
if (r < m_sen_gnd_vdd_resistor_threshold && chn < 255)
|
|
|
{
|
|
@@ -3443,12 +3443,15 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
int size = 4 + 2 * gnDrvMaxNum + 2; //BERLIN_SHORT_HEAD是4
|
|
|
int nAddr = 0x049A;
|
|
|
|
|
|
+ String chn_id1_isRx;
|
|
|
+ String chn_id2_isRx;
|
|
|
+
|
|
|
int i;
|
|
|
for (i = 0; i < nNum; i++)
|
|
|
{
|
|
|
|
|
|
//read buffer [0x2049A]
|
|
|
- if (!iicRead32Bits((byte)0x02, (byte)((nAddr & 0xff00) >> 8), (byte)(nAddr & 0x00ff), mBytes, size))
|
|
|
+ if (!iicRead32Bits((byte)0x02, (byte)((nAddr & 0xff00) >> 8), (byte)(nAddr & 0xff), mBytes, size))
|
|
|
{
|
|
|
return false;
|
|
|
}
|
|
@@ -3472,13 +3475,34 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
r = (float)(1.0 * self_code * 74 / short_code - 74) + 20;//TODO berlinD
|
|
|
r = r >= 0 ? r : 0;
|
|
|
|
|
|
- chn_id1 = GetDriverChn(chn_id1);
|
|
|
+ //chn_id1 = GetDriverChn(chn_id1);
|
|
|
|
|
|
- chn_id2 = GetDriverChn(chn_id2);
|
|
|
+ //chn_id2 = GetDriverChn(chn_id2);
|
|
|
|
|
|
if (r < m_drv_drv_resistor_threshold && chn_id1 < 255 && chn_id2 < 255)
|
|
|
{
|
|
|
- Update_log = Update_log.concat("[Short-Circuit Test]Tx" + Integer.toString(chn_id1) + " and Tx"
|
|
|
+ //TX/RX可以互换,这里要做判断转换
|
|
|
+ chn_id1_isRx = "Tx";
|
|
|
+ if (chn_id1 < 9) //通道序号小于9时
|
|
|
+ {
|
|
|
+ //如果在driver配置里找不到该通道序号,说明改通道用作sensor
|
|
|
+ if (GetDriverChn(chn_id1) == 255) {
|
|
|
+ chn_id1 += 66;
|
|
|
+ chn_id1_isRx = "Rx";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ chn_id2_isRx = "Tx";
|
|
|
+ if (chn_id2 < 9) //通道序号小于9时
|
|
|
+ {
|
|
|
+ //如果在driver配置里找不到该通道序号,说明改通道用作sensor
|
|
|
+ if (GetDriverChn(chn_id2) == 255) {
|
|
|
+ chn_id2 += 66;
|
|
|
+ chn_id2_isRx = "Rx";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Update_log = Update_log.concat("[Short-Circuit Test]" + chn_id1_isRx + Integer.toString(chn_id1) + " and " + chn_id2_isRx
|
|
|
+ Integer.toString(chn_id2) + ": " + Integer.toString((int)r) + "K Ohm\n");
|
|
|
|
|
|
mHandler.sendEmptyMessage(TEST_DATA_MESSAGE);
|
|
@@ -3530,9 +3554,9 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
r = (float)(1.0 * self_code * 74 / short_code - 74) + 20;
|
|
|
r = r >= 0 ? r : 0;
|
|
|
|
|
|
- chn_id1 = GetSensorChn(chn_id1);
|
|
|
+ //chn_id1 = GetSensorChn(chn_id1);
|
|
|
|
|
|
- chn_id2 = GetSensorChn(chn_id2);
|
|
|
+ //chn_id2 = GetSensorChn(chn_id2);
|
|
|
|
|
|
if (r < m_drv_sen_resistor_threshold && chn_id1 < 255 && chn_id2 < 255)
|
|
|
{
|
|
@@ -3588,9 +3612,9 @@ public class DataAnalysis extends AppCompatActivity
|
|
|
r = (float)(1.0 * self_code * 74 / short_code - 74) + 20;
|
|
|
r = r >= 0 ? r : 0;
|
|
|
|
|
|
- chn_id1 = GetSensorChn(chn_id1);
|
|
|
+ //chn_id1 = GetSensorChn(chn_id1);
|
|
|
|
|
|
- chn_id2 = GetDriverChn(chn_id2);
|
|
|
+ //chn_id2 = GetDriverChn(chn_id2);
|
|
|
|
|
|
if (r < m_drv_drv_resistor_threshold && chn_id1 < 255 && chn_id2 < 255)
|
|
|
{
|