|
@@ -58,22 +58,22 @@ void LockAndUnlockCtrl()
|
|
CtrlFlg = Unlock;
|
|
CtrlFlg = Unlock;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else //正常工作模式,暂时为空
|
|
|
|
|
|
+ else //正常工作模式
|
|
{
|
|
{
|
|
switch(ebcd_st_ebcWork)
|
|
switch(ebcd_st_ebcWork)
|
|
{
|
|
{
|
|
- case 0://行车状态,自动进入,默认状态
|
|
|
|
|
|
+ case DriveMode://行车状态,自动进入,默认状态
|
|
{
|
|
{
|
|
PSwtDrv_Interface(_PSWT_INDEX_EBCLEDCONTROL,0);//行车状态换电指示灯关闭
|
|
PSwtDrv_Interface(_PSWT_INDEX_EBCLEDCONTROL,0);//行车状态换电指示灯关闭
|
|
if(bled_flg_handShake==1)
|
|
if(bled_flg_handShake==1)
|
|
{
|
|
{
|
|
- ebcd_st_ebcWork = 1;
|
|
|
|
|
|
+ ebcd_st_ebcWork = CommuMode;//进入通讯状态
|
|
bled_flg_handShake = 0;
|
|
bled_flg_handShake = 0;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- case 1://通讯状态,握手才能进入
|
|
|
|
|
|
+ case CommuMode://通讯状态,握手才能进入
|
|
{
|
|
{
|
|
BleConCounter = BleConCounter + 10;
|
|
BleConCounter = BleConCounter + 10;
|
|
if((BleConCounter%1000)<500)//换电指示灯闪烁
|
|
if((BleConCounter%1000)<500)//换电指示灯闪烁
|
|
@@ -87,16 +87,15 @@ void LockAndUnlockCtrl()
|
|
|
|
|
|
if(BleConCounter>=60*1000||bled_flg_backToDrv == 1)
|
|
if(BleConCounter>=60*1000||bled_flg_backToDrv == 1)
|
|
{
|
|
{
|
|
- ebcd_st_ebcWork = 0;//切换到行车状态
|
|
|
|
|
|
+ ebcd_st_ebcWork = DriveMode;//切换到行车状态
|
|
BleConCounter = 0;
|
|
BleConCounter = 0;
|
|
bled_flg_backToDrv = 0;
|
|
bled_flg_backToDrv = 0;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- else if(BattCD_stWakeupU.B.bLogic==0&&(bled_flg_toSwapMod==1 || BattCD_stWakeupU.B.bWkpSig1==1))
|
|
|
|
|
|
+ else if(BattCD_stWakeupU.B.bLogic==0 && BattCD_stWakeupU.B.bWkpSig1==1)
|
|
{
|
|
{
|
|
- ebcd_st_ebcWork = 2;//切换到换电状态
|
|
|
|
|
|
+ ebcd_st_ebcWork = SwapMode;//切换到换电状态
|
|
BleConCounter = 0;
|
|
BleConCounter = 0;
|
|
- bled_flg_toSwapMod = 0;
|
|
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
if(bled_st_dataTrans==1)
|
|
if(bled_st_dataTrans==1)
|
|
@@ -106,19 +105,19 @@ void LockAndUnlockCtrl()
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- case 2://换电状态
|
|
|
|
|
|
+ case SwapMode://换电状态
|
|
{
|
|
{
|
|
PSwtDrv_Interface(_PSWT_INDEX_EBCLEDCONTROL,1);//换电状态换电指示灯常亮
|
|
PSwtDrv_Interface(_PSWT_INDEX_EBCLEDCONTROL,1);//换电状态换电指示灯常亮
|
|
battSwpeModeCounter = battSwpeModeCounter + 10;
|
|
battSwpeModeCounter = battSwpeModeCounter + 10;
|
|
if(bled_flg_swapBattDone==1)
|
|
if(bled_flg_swapBattDone==1)
|
|
{
|
|
{
|
|
bled_flg_swapBattDone = 0;
|
|
bled_flg_swapBattDone = 0;
|
|
- ebcd_st_ebcWork = 1; //切换到通讯状态
|
|
|
|
|
|
+ ebcd_st_ebcWork = CommuMode; //切换到通讯状态
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
else if(battSwpeModeCounter>=60*1000)
|
|
else if(battSwpeModeCounter>=60*1000)
|
|
{
|
|
{
|
|
- battSwpeModeCounter = 0;//切换到行车状态
|
|
|
|
|
|
+ battSwpeModeCounter = DriveMode;//切换到行车状态
|
|
ebcd_st_ebcWork = 0;
|
|
ebcd_st_ebcWork = 0;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -127,6 +126,16 @@ void LockAndUnlockCtrl()
|
|
battSwpeModeCounter = 0;
|
|
battSwpeModeCounter = 0;
|
|
bled_st_dataTrans = 0;
|
|
bled_st_dataTrans = 0;
|
|
}
|
|
}
|
|
|
|
+ if(bled_flg_unlockCmdForce)
|
|
|
|
+ {
|
|
|
|
+ CtrlFlg = Unlock;
|
|
|
|
+ bled_flg_unlockCmdForce = 0;
|
|
|
|
+ }
|
|
|
|
+ if(bled_flg_lockCmdForce)
|
|
|
|
+ {
|
|
|
|
+ CtrlFlg = Lock;
|
|
|
|
+ bled_flg_lockCmdForce = 0;
|
|
|
|
+ }
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|