|
@@ -18,8 +18,8 @@ void BcuDecodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
BcuRxFlag[0] = 0x01;
|
|
|
break;
|
|
|
case 0x1801D8F3:
|
|
|
- BMS_SoftwareVersion = (UINT16)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
- BMS_HardwareVersion = (UINT16)(((*(UINT8 *)(rawData + 2)) || (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
+ BMS_SoftwareVersion = (UINT16)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
+ BMS_HardwareVersion = (UINT16)(((*(UINT8 *)(rawData + 2)) | (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
BMS_ProtocolEditionH = (UINT8)(((*(UINT8 *)(rawData + 4))) & 0x3);
|
|
|
BMS_ProtocolEditionL = (UINT8)(((*(UINT8 *)(rawData + 4)) >> 2) & 0xF);
|
|
|
BcuRxFlag[1] = 0x01;
|
|
@@ -100,16 +100,16 @@ void BcuDecodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
case 0x1882D0F3:
|
|
|
BMS_PackSOC = (UINT8)(((*(UINT8 *)(rawData + 0))) & 0xFF);
|
|
|
BMS_PackSOH = (UINT8)(((*(UINT8 *)(rawData + 1))) & 0xFF);
|
|
|
- BMS_PackCurr = (UINT16)(((*(UINT8 *)(rawData + 2)) || (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
- BMS_MaxCharCurr = (UINT16)(((*(UINT8 *)(rawData + 4)) || (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
- BMS_MaxDisCharCurr = (UINT16)(((*(UINT8 *)(rawData + 6)) || (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
+ BMS_PackCurr = (UINT16)(((*(UINT8 *)(rawData + 2)) | (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
+ BMS_MaxCharCurr = (UINT16)(((*(UINT8 *)(rawData + 4)) | (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
+ BMS_MaxDisCharCurr = (UINT16)(((*(UINT8 *)(rawData + 6)) | (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
BcuRxFlag[4] = 0x01;
|
|
|
break;
|
|
|
case 0x1883D0F3:
|
|
|
- BMS_PosIns = (UINT16)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
- BMS_NegIns = (UINT16)(((*(UINT8 *)(rawData + 2)) || (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
- BMS_BattVolt = (UINT16)(((*(UINT8 *)(rawData + 4)) || (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
- BMS_LinkVolt = (UINT16)(((*(UINT8 *)(rawData + 6)) || (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
+ BMS_PosIns = (UINT16)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
+ BMS_NegIns = (UINT16)(((*(UINT8 *)(rawData + 2)) | (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
+ BMS_BattVolt = (UINT16)(((*(UINT8 *)(rawData + 4)) | (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
+ BMS_LinkVolt = (UINT16)(((*(UINT8 *)(rawData + 6)) | (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
BcuRxFlag[5] = 0x01;
|
|
|
break;
|
|
|
case 0x1884D0F3:
|
|
@@ -123,24 +123,24 @@ void BcuDecodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
BcuRxFlag[6] = 0x01;
|
|
|
break;
|
|
|
case 0x1885D0F3:
|
|
|
- BMS_MaxCellVolt = (UINT16)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
+ BMS_MaxCellVolt = (UINT16)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
BMS_MaxCellVoltCSC = (UINT8)(((*(UINT8 *)(rawData + 2))) & 0xFF);
|
|
|
BMS_MaxCellVoltNum = (UINT8)(((*(UINT8 *)(rawData + 3))) & 0xFF);
|
|
|
- BMS_AverCellVolt = (UINT16)(((*(UINT8 *)(rawData + 4)) || (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
+ BMS_AverCellVolt = (UINT16)(((*(UINT8 *)(rawData + 4)) | (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
BcuRxFlag[7] = 0x01;
|
|
|
break;
|
|
|
case 0x1886D0F3:
|
|
|
- BMS_MinCellVolt = (UINT16)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
+ BMS_MinCellVolt = (UINT16)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
BMS_MinCellVoltCSC = (UINT8)(((*(UINT8 *)(rawData + 2))) & 0xFF);
|
|
|
BMS_MinCellVoltNum = (UINT8)(((*(UINT8 *)(rawData + 3))) & 0xFF);
|
|
|
- BMS_ContChrgCurr = (UINT16)(((*(UINT8 *)(rawData + 4)) || (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
- BMS_ContDisCharCurr = (UINT16)(((*(UINT8 *)(rawData + 6)) || (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
+ BMS_ContChrgCurr = (UINT16)(((*(UINT8 *)(rawData + 4)) | (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
+ BMS_ContDisCharCurr = (UINT16)(((*(UINT8 *)(rawData + 6)) | (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
BcuRxFlag[8] = 0x01;
|
|
|
break;
|
|
|
case 0x1887D0F3:
|
|
|
- BMS_CharReqVolt = (UINT16)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
- BMS_CharReqCurr = (UINT16)(((*(UINT8 *)(rawData + 2)) || (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
- BMS_SysInsRes = (UINT16)(((*(UINT8 *)(rawData + 4)) || (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
+ BMS_CharReqVolt = (UINT16)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
+ BMS_CharReqCurr = (UINT16)(((*(UINT8 *)(rawData + 2)) | (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
+ BMS_SysInsRes = (UINT16)(((*(UINT8 *)(rawData + 4)) | (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
BMS_InsDeteSt = (UINT8)(((*(UINT8 *)(rawData + 6))) & 0x1);
|
|
|
BMS_FtCharInsLow = (UINT8)(((*(UINT8 *)(rawData + 6)) >> 1) & 0x1);
|
|
|
BMS_FtCurrSenr = (UINT8)(((*(UINT8 *)(rawData + 6)) >> 2) & 0x1);
|
|
@@ -157,17 +157,17 @@ void BcuDecodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
BcuRxFlag[9] = 0x01;
|
|
|
break;
|
|
|
case 0x1888D0F3:
|
|
|
- BMS_MaxDisCharPwr = (UINT16)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
- BMS_MaxCharPwr = (UINT16)(((*(UINT8 *)(rawData + 2)) || (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
- BMS_ContDisCharPwr = (UINT16)(((*(UINT8 *)(rawData + 4)) || (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
- BMS_ContCharPwr = (UINT16)(((*(UINT8 *)(rawData + 6)) || (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
+ BMS_MaxDisCharPwr = (UINT16)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
+ BMS_MaxCharPwr = (UINT16)(((*(UINT8 *)(rawData + 2)) | (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
+ BMS_ContDisCharPwr = (UINT16)(((*(UINT8 *)(rawData + 4)) | (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
+ BMS_ContCharPwr = (UINT16)(((*(UINT8 *)(rawData + 6)) | (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
BcuRxFlag[10] = 0x01;
|
|
|
break;
|
|
|
case 0x1889D0F3:
|
|
|
- BMS_InstEngyCons = (UINT16)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
- BMS_TotalEngyCons = (UINT16)(((*(UINT8 *)(rawData + 2)) || (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
- BMS_SOE = (UINT16)(((*(UINT8 *)(rawData + 4)) || (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
- BMS_RmanCharTime = (UINT16)(((*(UINT8 *)(rawData + 6)) || (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
+ BMS_InstEngyCons = (UINT16)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
+ BMS_TotalEngyCons = (UINT16)(((*(UINT8 *)(rawData + 2)) | (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
+ BMS_SOE = (UINT16)(((*(UINT8 *)(rawData + 4)) | (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
+ BMS_RmanCharTime = (UINT16)(((*(UINT8 *)(rawData + 6)) | (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
BcuRxFlag[11] = 0x01;
|
|
|
break;
|
|
|
case 0x188AD0F3:
|
|
@@ -181,7 +181,7 @@ void BcuDecodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
BMS_FtOverDisCharCurrDuringChar = (UINT8)(((*(UINT8 *)(rawData + 4)) >> 5) & 0x1);
|
|
|
BMS_FtCharNTC = (UINT8)(((*(UINT8 *)(rawData + 4)) >> 6) & 0x1);
|
|
|
BMS_FtELock = (UINT8)(((*(UINT8 *)(rawData + 4)) >> 7) & 0x1);
|
|
|
- BMS_CharNum = (UINT16)(((*(UINT8 *)(rawData + 5)) || (*(UINT8 *)(rawData + 6) << 8)) & 0xFFFF);
|
|
|
+ BMS_CharNum = (UINT16)(((*(UINT8 *)(rawData + 5)) | (*(UINT8 *)(rawData + 6) << 8)) & 0xFFFF);
|
|
|
BcuRxFlag[12] = 0x01;
|
|
|
break;
|
|
|
case 0x18C1D0F3:
|
|
@@ -193,7 +193,7 @@ void BcuDecodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
}
|
|
|
for (UINT8 i = 0; i < 3; i++)
|
|
|
{
|
|
|
- BMS_CellVolt[(BMS_CellVoltFramNum - 1) * 3 + i] = (UINT16)(((*(UINT8 *)(rawData + i * 2 + 2)) || (*(UINT8 *)(rawData + i * 2 + 3) << 8)) & 0xFFFF);
|
|
|
+ BMS_CellVolt[(BMS_CellVoltFramNum - 1) * 3 + i] = (UINT16)(((*(UINT8 *)(rawData + i * 2 + 2)) | (*(UINT8 *)(rawData + i * 2 + 3) << 8)) & 0xFFFF);
|
|
|
}
|
|
|
BcuRxFlag[13] = 0x01;
|
|
|
break;
|
|
@@ -287,47 +287,47 @@ void BcuDecodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
BcuRxFlag[18] = 0x01;
|
|
|
break;
|
|
|
case 0x18E5D0F3:
|
|
|
- BMS_BattRateCap = (UINT16)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
- BMS_BattRateVolt = (UINT16)(((*(UINT8 *)(rawData + 2)) || (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
- BMS_BattRateEngy = (UINT16)(((*(UINT8 *)(rawData + 4)) || (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
+ BMS_BattRateCap = (UINT16)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8)) & 0xFFFF);
|
|
|
+ BMS_BattRateVolt = (UINT16)(((*(UINT8 *)(rawData + 2)) | (*(UINT8 *)(rawData + 3) << 8)) & 0xFFFF);
|
|
|
+ BMS_BattRateEngy = (UINT16)(((*(UINT8 *)(rawData + 4)) | (*(UINT8 *)(rawData + 5) << 8)) & 0xFFFF);
|
|
|
BMS_BattType = (UINT8)(((*(UINT8 *)(rawData + 6))) & 0xF);
|
|
|
BMS_CoolType = (UINT8)(((*(UINT8 *)(rawData + 6)) >> 4) & 0x3);
|
|
|
BcuRxFlag[19] = 0x01;
|
|
|
break;
|
|
|
case 0x18E6D0F3:
|
|
|
BMS_CSC_Total = (UINT8)(((*(UINT8 *)(rawData + 0))) & 0xFF);
|
|
|
- BMS_CellTotal = (UINT16)(((*(UINT8 *)(rawData + 1)) || (*(UINT8 *)(rawData + 2) << 8)) & 0xFFFF);
|
|
|
- BMS_TempTotal = (UINT16)(((*(UINT8 *)(rawData + 3)) || (*(UINT8 *)(rawData + 4) << 8)) & 0xFFFF);
|
|
|
+ BMS_CellTotal = (UINT16)(((*(UINT8 *)(rawData + 1)) | (*(UINT8 *)(rawData + 2) << 8)) & 0xFFFF);
|
|
|
+ BMS_TempTotal = (UINT16)(((*(UINT8 *)(rawData + 3)) | (*(UINT8 *)(rawData + 4) << 8)) & 0xFFFF);
|
|
|
BMS_CellVoltLevel = (UINT8)(((*(UINT8 *)(rawData + 5))) & 0xFF);
|
|
|
BMS_CellMinVolt = (UINT8)(((*(UINT8 *)(rawData + 6))) & 0xFF);
|
|
|
BMS_CellMaxVolt = (UINT8)(((*(UINT8 *)(rawData + 7))) & 0xFF);
|
|
|
BcuRxFlag[20] = 0x01;
|
|
|
break;
|
|
|
case 0x18F1D0F3:
|
|
|
- BMS_TotalCharEngy = (UINT32)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8) || (*(UINT8 *)(rawData + 2) << 16) || (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
- BMS_TotalDisCharEngy = (UINT32)(((*(UINT8 *)(rawData + 3)) || (*(UINT8 *)(rawData + 4) << 8) || (*(UINT8 *)(rawData + 5) << 16) || (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
- BMS_SingleCharEngy = (UINT16)(((*(UINT8 *)(rawData + 6)) || (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
+ BMS_TotalCharEngy = (UINT32)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8) |(*(UINT8 *)(rawData + 2) << 16) | (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_TotalDisCharEngy = (UINT32)(((*(UINT8 *)(rawData + 3)) |(*(UINT8 *)(rawData + 4) << 8) | (*(UINT8 *)(rawData + 5) << 16) | (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_SingleCharEngy = (UINT16)(((*(UINT8 *)(rawData + 6)) |(*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
BcuRxFlag[21] = 0x01;
|
|
|
break;
|
|
|
case 0x18F2D0F3:
|
|
|
- BMS_TotalBackCharEngy = (UINT32)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8) || (*(UINT8 *)(rawData + 2) << 16) || (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
- BMS_TotalStaCharEngy = (UINT32)(((*(UINT8 *)(rawData + 3)) || (*(UINT8 *)(rawData + 4) << 8) || (*(UINT8 *)(rawData + 5) << 16) || (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_TotalBackCharEngy = (UINT32)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8) | (*(UINT8 *)(rawData + 2) << 16) | (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_TotalStaCharEngy = (UINT32)(((*(UINT8 *)(rawData + 3)) |(*(UINT8 *)(rawData + 4) << 8) | (*(UINT8 *)(rawData + 5) << 16) | (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
BcuRxFlag[22] = 0x01;
|
|
|
break;
|
|
|
case 0x18F3D0F3:
|
|
|
- BMS_TotalGunCharEngy = (UINT32)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8) || (*(UINT8 *)(rawData + 2) << 16) || (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
- BMS_TotalGunCharCapy = (UINT32)(((*(UINT8 *)(rawData + 3)) || (*(UINT8 *)(rawData + 4) << 8) || (*(UINT8 *)(rawData + 5) << 16) || (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_TotalGunCharEngy = (UINT32)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8) | (*(UINT8 *)(rawData + 2) << 16) | (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_TotalGunCharCapy = (UINT32)(((*(UINT8 *)(rawData + 3)) | (*(UINT8 *)(rawData + 4) << 8) | (*(UINT8 *)(rawData + 5) << 16) | (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
BcuRxFlag[23] = 0x01;
|
|
|
break;
|
|
|
case 0x18F4D0F3:
|
|
|
- BMS_TotalCharCapy = (UINT32)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8) || (*(UINT8 *)(rawData + 2) << 16) || (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
- BMS_TotalDisCharCapy = (UINT32)(((*(UINT8 *)(rawData + 3)) || (*(UINT8 *)(rawData + 4) << 8) || (*(UINT8 *)(rawData + 5) << 16) || (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
- BMS_SingleCharCapy = (UINT16)(((*(UINT8 *)(rawData + 6)) || (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
+ BMS_TotalCharCapy = (UINT32)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8) | (*(UINT8 *)(rawData + 2) << 16) | (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_TotalDisCharCapy = (UINT32)(((*(UINT8 *)(rawData + 3)) | (*(UINT8 *)(rawData + 4) << 8) | (*(UINT8 *)(rawData + 5) << 16) | (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_SingleCharCapy = (UINT16)(((*(UINT8 *)(rawData + 6)) | (*(UINT8 *)(rawData + 7) << 8)) & 0xFFFF);
|
|
|
BcuRxFlag[24] = 0x01;
|
|
|
break;
|
|
|
case 0x18F5D0F3:
|
|
|
- BMS_TotalBackCharCapy = (UINT32)(((*(UINT8 *)(rawData + 0)) || (*(UINT8 *)(rawData + 1) << 8) || (*(UINT8 *)(rawData + 2) << 16) || (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
- BMS_TotalStaCharCapy = (UINT32)(((*(UINT8 *)(rawData + 3)) || (*(UINT8 *)(rawData + 4) << 8) || (*(UINT8 *)(rawData + 5) << 16) || (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_TotalBackCharCapy = (UINT32)(((*(UINT8 *)(rawData + 0)) | (*(UINT8 *)(rawData + 1) << 8) | (*(UINT8 *)(rawData + 2) << 16) | (*(UINT8 *)(rawData + 3) << 24)) & 0xFFFFFF);
|
|
|
+ BMS_TotalStaCharCapy = (UINT32)(((*(UINT8 *)(rawData + 3)) | (*(UINT8 *)(rawData + 4) << 8) | (*(UINT8 *)(rawData + 5) << 16) | (*(UINT8 *)(rawData + 6) << 24)) & 0xFFFFFF);
|
|
|
BMS_HVBranNum = (UINT8)(((*(UINT8 *)(rawData + 6))) & 0xFF);
|
|
|
BMS_SingleHVBranchCellNum = (UINT8)(((*(UINT8 *)(rawData + 7))) & 0xFF);
|
|
|
BcuRxFlag[25] = 0x01;
|
|
@@ -337,7 +337,7 @@ void BcuDecodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
BMS_HVCmd = (UINT8)(((*(UINT8 *)(rawData + 0)) >> 2) & 0x3);
|
|
|
BMS_ChgSts = (UINT8)(((*(UINT8 *)(rawData + 0)) >> 4) & 0x3);
|
|
|
BMS_HVRelaySts = (UINT8)(((*(UINT8 *)(rawData + 0)) >> 6) & 0x3);
|
|
|
- BMS_HVVolt = (UINT16)(((*(UINT8 *)(rawData + 1)) || (*(UINT8 *)(rawData + 2) << 8)) & 0xFFFF);
|
|
|
+ BMS_HVVolt = (UINT16)(((*(UINT8 *)(rawData + 1)) | (*(UINT8 *)(rawData + 2) << 8)) & 0xFFFF);
|
|
|
BMS_SetTemp = (UINT8)(((*(UINT8 *)(rawData + 4))) & 0xFF);
|
|
|
BMS_Life = (UINT8)(((*(UINT8 *)(rawData + 6))) & 0xFF);
|
|
|
BMS_CRC = (UINT8)(((*(UINT8 *)(rawData + 7))) & 0xFF);
|
|
@@ -348,7 +348,7 @@ void BcuDecodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
TMS_HVRelayST = (UINT8)(((*(UINT8 *)(rawData + 0)) >> 2) & 0x3);
|
|
|
TMS_OutletTemp = (UINT8)(((*(UINT8 *)(rawData + 1))) & 0xFF);
|
|
|
TMS_InletTemp = (UINT8)(((*(UINT8 *)(rawData + 2))) & 0xFF);
|
|
|
- TMS_ReqPow = (UINT16)(((*(UINT8 *)(rawData + 5)) || (*(UINT8 *)(rawData + 6) << 8)) & 0xFFFF);
|
|
|
+ TMS_ReqPow = (UINT16)(((*(UINT8 *)(rawData + 5)) | (*(UINT8 *)(rawData + 6) << 8)) & 0xFFFF);
|
|
|
TMS_ErrCode = (UINT8)(((*(UINT8 *)(rawData + 7))) & 0x3F);
|
|
|
TMS_FaultLevel = (UINT8)(((*(UINT8 *)(rawData + 7)) >> 6) & 0x3);
|
|
|
BcuRxFlag[27] = 0x01;
|
|
@@ -769,14 +769,20 @@ void BcuEncodeFunction(UINT32 ID, UINT8 *rawData)
|
|
|
ErrTemp = GetErrorNum(ErrArray, sizeof(ErrArray) / 2);
|
|
|
EBC_FtLvl = ErrTemp / 10000;
|
|
|
EBC_FtCode = ErrTemp % 10000;
|
|
|
+
|
|
|
+ /*Test*/
|
|
|
+ EBC_LockSt = 0x02;
|
|
|
+ EBC_CnctSt = 0x01;
|
|
|
+ EBC_DisCharCnctSt = 0x01;
|
|
|
+ EBC_CharCnctSt = 0x01;
|
|
|
*(rawData + 0) = EBC_Counter;
|
|
|
- *(rawData + 1) = (EBC_CharCnctSt << 6) || (EBC_DisCharCnctSt << 4) || (EBC_CnctSt << 2) || (EBC_LockSt);
|
|
|
+ *(rawData + 1) = (EBC_CharCnctSt << 6) | (EBC_DisCharCnctSt << 4) | (EBC_CnctSt << 2) | (EBC_LockSt);
|
|
|
*(rawData + 2) = 0x00;
|
|
|
*(rawData + 3) = EBC_FtLvl;
|
|
|
*(rawData + 4) = EBC_FtCode;
|
|
|
*(rawData + 5) = 0x00;
|
|
|
*(rawData + 6) = EBC_AirPressure;
|
|
|
- *(rawData + 7) = ((EBC_State << 5) & 0x03) || ((EBC_StopChgCmd << 4) & 0x01) || ((EBC_ReqHVOff << 3) & 0x01) || ((EBC_InhiHVOn << 2) & 0x01) || ((EBC_ActHeatReq << 1) & 0x01) || ((EBC_CharSt)&0x01);
|
|
|
+ *(rawData + 7) = ((EBC_State << 5) & 0x03) | ((EBC_StopChgCmd << 4) & 0x01) | ((EBC_ReqHVOff << 3) & 0x01) | ((EBC_InhiHVOn << 2) & 0x01) | ((EBC_ActHeatReq << 1) & 0x01) | ((EBC_CharSt)&0x01);
|
|
|
break;
|
|
|
}
|
|
|
case 0x18FEF8A7:
|