|
@@ -294,14 +294,17 @@ void BcuDecodeFunction(uint32 ID, uint8 *rawData)
|
|
BcuRxFlag[13] = 0x01;
|
|
BcuRxFlag[13] = 0x01;
|
|
break;
|
|
break;
|
|
case 0x18C2D0F3:
|
|
case 0x18C2D0F3:
|
|
|
|
+ {
|
|
|
|
+ uint8 tempType = 6;
|
|
|
|
+ uint8 csc_maxCode = 10;
|
|
|
|
+ uint8 tempCount = 0,offvalue = 0;
|
|
BMS_CellTempFramNum = (UINT8)(((*(UINT8 *)(rawData + 0))) & 0xFF);
|
|
BMS_CellTempFramNum = (UINT8)(((*(UINT8 *)(rawData + 0))) & 0xFF);
|
|
BMS_CSC_Code = (UINT8)(((*(UINT8 *)(rawData + 1))) & 0xFF);
|
|
BMS_CSC_Code = (UINT8)(((*(UINT8 *)(rawData + 1))) & 0xFF);
|
|
- if (BMS_CSC_Code == 0 || BMS_CSC_Code > 8)
|
|
|
|
|
|
+ if (BMS_CSC_Code == 0 || BMS_CSC_Code > csc_maxCode)
|
|
{
|
|
{
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- uint8 tempCount = 0,offvalue = 0;
|
|
|
|
- if(BMS_CellTempFramNum%2==0)
|
|
|
|
|
|
+ if(BMS_CellTempFramNum%2==0 && tempType==8)
|
|
{
|
|
{
|
|
tempCount = 2;
|
|
tempCount = 2;
|
|
offvalue = 6;
|
|
offvalue = 6;
|
|
@@ -313,12 +316,13 @@ void BcuDecodeFunction(uint32 ID, uint8 *rawData)
|
|
}
|
|
}
|
|
for(uint8 i=0; i<tempCount; i++)
|
|
for(uint8 i=0; i<tempCount; i++)
|
|
{
|
|
{
|
|
- if (((BMS_CSC_Code - 1) * 8 + i + offvalue) < sizeof(BMS_CellTemp) && ((UINT8)(((*(UINT8 *)(rawData + 2 + i))) & 0xFF) >= 10))
|
|
|
|
|
|
+ if (((BMS_CSC_Code - 1) * tempType + i + offvalue) < sizeof(BMS_CellTemp) && ((UINT8)(((*(UINT8 *)(rawData + 2 + i))) & 0xFF) >= 10))
|
|
{
|
|
{
|
|
- BMS_CellTemp[(BMS_CSC_Code - 1) * 8 + i + offvalue] = (UINT8)(((*(UINT8 *)(rawData + 2 + i))) & 0xFF)- 10;
|
|
|
|
|
|
+ BMS_CellTemp[(BMS_CSC_Code - 1) * tempType + i + offvalue] = (UINT8)(((*(UINT8 *)(rawData + 2 + i))) & 0xFF)- 10;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
BcuRxFlag[14] = 0x01;
|
|
BcuRxFlag[14] = 0x01;
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
case 0x18E1D0F3:
|
|
case 0x18E1D0F3:
|
|
BMS_Checksum = 0;
|
|
BMS_Checksum = 0;
|