|
@@ -364,7 +364,13 @@ void BattLockFunc(void)
|
|
void BattWorkDelayFunc(UINT8 battWorkCurrentState)
|
|
void BattWorkDelayFunc(UINT8 battWorkCurrentState)
|
|
{
|
|
{
|
|
static UINT16 workDelayCounter = 0;
|
|
static UINT16 workDelayCounter = 0;
|
|
-
|
|
|
|
|
|
+ static UINT8 battWorkCurrentStateTemp = 0;
|
|
|
|
+ if(battWorkCurrentStateTemp!=battWorkCurrentState)
|
|
|
|
+ {
|
|
|
|
+ workDelayCounter = 0;
|
|
|
|
+ battWorkCurrentStateTemp = battWorkCurrentState;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (battWorkCurrentState == BATT_IDLE_SYM && BattWorkStateDelay == BATT_DISCHARGE_SYM) //从放电转静置 60s延时
|
|
if (battWorkCurrentState == BATT_IDLE_SYM && BattWorkStateDelay == BATT_DISCHARGE_SYM) //从放电转静置 60s延时
|
|
{
|
|
{
|
|
workDelayCounter++;
|
|
workDelayCounter++;
|
|
@@ -383,7 +389,7 @@ void BattWorkDelayFunc(UINT8 battWorkCurrentState)
|
|
BattWorkStateDelay = battWorkCurrentState;
|
|
BattWorkStateDelay = battWorkCurrentState;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if (battWorkCurrentState == BATT_DISCHARGE_SYM && (battI > 10010) && BattWorkStateDelay != BATT_DISCHARGE_SYM) //从 充电或者静置 转放电 2s延时
|
|
|
|
|
|
+ else if (battWorkCurrentState == BATT_DISCHARGE_SYM && BattWorkStateDelay != BATT_DISCHARGE_SYM) //从 充电或者静置 转放电 2s延时
|
|
{
|
|
{
|
|
workDelayCounter++;
|
|
workDelayCounter++;
|
|
if (workDelayCounter >= 2)
|
|
if (workDelayCounter >= 2)
|
|
@@ -406,6 +412,8 @@ void BattWorkDelayFunc(UINT8 battWorkCurrentState)
|
|
BattWorkStateDelay = battWorkCurrentState;
|
|
BattWorkStateDelay = battWorkCurrentState;
|
|
workDelayCounter = 0;
|
|
workDelayCounter = 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //printf("cnt:%d,delay:%d,st:%d,I:%d\n",workDelayCounter,BattWorkStateDelay,battWorkCurrentState,battI);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
/**
|
|
/**
|