|
@@ -622,12 +622,17 @@ void PBU_RunMode_Process(PBU_RunMode_t RunMode)
|
|
|
LED_INIT();
|
|
|
|
|
|
//关机前,发送指令关灯,避免下次开机时灯会闪亮一下
|
|
|
- ControlCode_MC_WalkSby.GearSt = 0;
|
|
|
- ControlCode_MC_WalkSby.LightSwitch = 0xF0;
|
|
|
- SendData(ID_PBU_TO_MC, 0x0C, 0x3002, (uint8_t*)(&(ControlCode_MC_WalkSby.GearSt)));
|
|
|
- HAL_Delay(50);
|
|
|
- SendData(ID_PBU_TO_MC, 0x0C, 0x3002, (uint8_t*)(&(ControlCode_MC_WalkSby.GearSt)));
|
|
|
-
|
|
|
+ static uint8_t LightOffCommandCount=0;
|
|
|
+ if(LightOffCommandCount==0)
|
|
|
+ {
|
|
|
+ LightOffCommandCount=1;
|
|
|
+ ControlCode_MC_WalkSby.GearSt = 0;
|
|
|
+ ControlCode_MC_WalkSby.LightSwitch = 0xF0;
|
|
|
+ SendData(ID_PBU_TO_MC, 0x0C, 0x3002, (uint8_t*)(&(ControlCode_MC_WalkSby.GearSt)));
|
|
|
+ HAL_Delay(20);
|
|
|
+ SendData(ID_PBU_TO_MC, 0x0C, 0x3002, (uint8_t*)(&(ControlCode_MC_WalkSby.GearSt)));
|
|
|
+ HAL_Delay(20);
|
|
|
+ }
|
|
|
PowerOn_flag=0;
|
|
|
//关机前发送SHUTDOWN指令,收到所有设备关机就绪信号,或超时2s关机
|
|
|
if((PBU_PowerOff_Process.Ready_Status.Status & 0x01) != 0x01)//未收到所有设备的关机就绪信号
|
|
@@ -650,6 +655,7 @@ void PBU_RunMode_Process(PBU_RunMode_t RunMode)
|
|
|
HAL_IWDG_Refresh(&hiwdg1);
|
|
|
}while(*(Key_On_Off.ADC_result)<3000);
|
|
|
__set_FAULTMASK(1);//关闭所有中断
|
|
|
+ HAL_Delay(200);
|
|
|
HAL_NVIC_SystemReset();
|
|
|
}
|
|
|
//超时判断
|
|
@@ -665,6 +671,7 @@ void PBU_RunMode_Process(PBU_RunMode_t RunMode)
|
|
|
HAL_IWDG_Refresh(&hiwdg1);
|
|
|
}while(*(Key_On_Off.ADC_result)<3000);
|
|
|
__set_FAULTMASK(1);//关闭所有中断
|
|
|
+ HAL_Delay(200);
|
|
|
HAL_NVIC_SystemReset();
|
|
|
}
|
|
|
MC_Online_TimeCnt=SysTime_5ms;
|