diff --git a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c index e4ef2f8..ba52fad 100644 --- a/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c +++ b/diaoerqiege/BHBF_Robot_Lifting_Lug/Core/Src/FSM.c @@ -70,10 +70,6 @@ void GF_Dispatch() IV_Control(); IO_Control(); - Mode_Control(); - - // 限位安全检测 - Limit_Detection(); // 急停 EmergencyStopControl(); @@ -92,21 +88,12 @@ void EmergencyStopControl() CurrentFrontEndState = HALT_STATE; StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE; } - else{ - + else + { + Mode_Control(); } } -uint8_t upper_limit_position = 0; -uint8_t lower_limit_position = 0; - -void Limit_Detection() -{ -// upper_limit_position = GF_BSP_GPIO_ReadIO(2); -// lower_limit_position = GF_BSP_GPIO_ReadIO(3); -} - - uint8_t Mode_Select_State = MANUAL_OPERATION; uint8_t Mode_Init = 0;// 初始化时第一次升刀的流程 @@ -285,7 +272,8 @@ int32_t knife_current_altitude = 0; // 激光1读数 void Automatic_Operation() { - MaxLaserSensor = 2000; +#if 0 + MaxLaserSensor = 2000;//临时加的保护 static int knife_flag = 1; uint8_t IsAllowRotation_AutoMode = 0; // 是否允许转刀 @@ -379,6 +367,23 @@ void Automatic_Operation() CurrentFrontEndState = HALT_STATE; StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE; } +#else + CurrentFrontEndState = HALT_STATE; + StrongGrindingMachineCurrentState = STRONG_GRINDING_MACHINE_HALT_STATE; + + if(GV.MK32_Key.CH7_SD == -1000) + { + CurrentMoveState = AUTO_FORWARD; + } + else if(GV.MK32_Key.CH7_SD == 1000) + { + CurrentMoveState = AUTO_BACKWARD; + } + else + { + CurrentMoveState = Move_HALT; + } +#endif }