#include "cmmd.h" #include "ctrl.h" #include "WarnCtrl.h" #include "DC2AC.H" unsigned char Warning_flag; extern unsigned char StopWarning_flag; /////////////////////////////////////////// void wd_reset(void *p) { WWDG_SWReset(); } /* unsigned char nId; unsigned char cPos; unsigned char cMoving; unsigned char b_warning; //正在报警 union{ int Err; struct{ int eErrPhase:1; int eErrOverHeat:1; int eMAIN_POWER_ERROR:1; int eBAT_LOW_ERR:1; int eBAT_OVER_ERROR:1; int eBAT_SHORT:1; int eCOIL_SHORT_ERR:1; int eCOIL_BREAK_ERR:1; int eERR_SENSOR_SMOKE:1; int eERR_SENSOR_TEMP:1; int eERR_TOP_OVERROLL:1;//过卷 int eERR_BOT_OVERROLL:1;//过卷 int eERR_MOTOR_LINE:1;//电机短线检测 }; }; unsigned int ErrMute; unsigned char Cmd; //上位机 //////////////////////////////////////////////// */ /* enum COMMAND{CMMD_WARNING=0x01,CMMD_STOP_WARNING=0x02 ,CMMD_MOTOR_DOWN=0x03,CMMD_MOTOR_UP=0x04 ,CMMD_MOTOR_STOP=0x05,CMMD_INVERT=0x06,CMMD_MUTE=0x07}; */ void TaskParsaCmd(void) { if(IED.Cmd&0x80) return; switch(IED.Cmd) { case CMMD_WARNING: Warning_flag=1; StartWarning(); break; case CMMD_STOP_WARNING: StopWarning(); StopMotor(); StopWarning_flag=1; Warning_flag=0; GPIO_WriteLow(GPIOA, GPIO_PIN_2);//关闭烟温电源 break; case CMMD_MOTOR_DOWN: UNLockAllMotor(); StartTimer(TIMER_MODE_ONCEROUTINE,100L,MotorDown,0); // MovMotor(POS_BOT); break; case CMMD_MOTOR_UP: UNLockAllMotor(); // MovMotor(POS_TOP); StartTimer(TIMER_MODE_ONCEROUTINE,IED.MidTimeWait,MotorUp,0); break; case CMMD_MOTOR_STOP: StopAllTimer(); LockAllMotor(); StopMotor(); break; case CMMD_INVERT: StartTimer(TIMER_MODE_ONCEROUTINE,100L, ConvertDown1,0); // ConvertDown(1); break; case CMMD_MUTE: MuteError(); break; case CMMD_RESET: StartTimer(TIMER_MODE_ONCEROUTINE,100L, wd_reset,0); break; default: break; } IED.Cmd|=0x80; }