|
@@ -481,10 +481,10 @@ void battSOCDisplay()
|
|
|
workState = ((temp&0x01)<<01)|(temp>>0x01);
|
|
|
currentSoc = UartReadMsg.data[(0x0B+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+2)*2+1];
|
|
|
}
|
|
|
-#ifdef USING_PRINTF
|
|
|
- printf("current SOC = %d\n",currentSoc);
|
|
|
- printf("work state = %d\n",workState);
|
|
|
-#endif
|
|
|
+ #ifdef USING_PRINTF1
|
|
|
+ printf("current SOC = %d\n",currentSoc);
|
|
|
+ printf("work state = %d\n",workState);
|
|
|
+ #endif
|
|
|
|
|
|
lightTimer++;
|
|
|
|
|
@@ -677,15 +677,18 @@ void battErrorStateDisplay()
|
|
|
|
|
|
if(UartReadMsg.Header[2]>0)
|
|
|
{
|
|
|
- MEMCPY(&errorState,&(UartReadMsg.data[(0x09+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+2)*2]),4);
|
|
|
+ errorState = ((UartReadMsg.data[(0x09+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+2)*2])<<8)|0|((UartReadMsg.data[(0x0A+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+2)*2])<<24)|((UartReadMsg.data[(0x0A+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+2)*2+1])<<16);
|
|
|
+ //MEMCPY(&errorState,&(UartReadMsg.data[(0x09+BATT_CELL_VOL_NUM+BATT_TEMP_NUM+2)*2]),4);
|
|
|
}
|
|
|
|
|
|
errorLightTimer++;
|
|
|
|
|
|
//errorState = testErrorState;
|
|
|
-#ifdef USING_PRINTF
|
|
|
- printf("error state = %d\n",errorState);
|
|
|
-#endif
|
|
|
+ #ifdef USING_PRINTF1
|
|
|
+ for(int k=0;k<UartReadMsg.Header[2];k++)
|
|
|
+ printf("%x ",UartReadMsg.data[k]);
|
|
|
+ printf("error state = %x\n",errorState);
|
|
|
+ #endif
|
|
|
if(errorState != 0)
|
|
|
{
|
|
|
if(errorLightTimer<(UINT8)(errorLEDFlashPeriod*errorDutyRatio))
|
|
@@ -723,7 +726,7 @@ void battLockStateDisplay(UINT8 lockState)
|
|
|
UINT8 errorLEDFlashPeriod = 10;//1000ms
|
|
|
float errorDutyRatio = 0.4;
|
|
|
|
|
|
- printf("lockState = %d\ncurrent State = %d\n",lockState,currentState);
|
|
|
+ //printf("lockState = %d\ncurrent State = %d\n",lockState,currentState);
|
|
|
if(lockState==0)//no error
|
|
|
{
|
|
|
if(currentState!=lockState)
|