📄 sub_mc33984.h
字号:
if(MC33984_fault2.Bit.BIT3) MC33984_OUT[5].Bit.BIT2=0;
if(MC33984_fault2.Bit.BIT4) MC33984_OUT[6].Bit.BIT0=0;
if(MC33984_fault2.Bit.BIT5) MC33984_OUT[6].Bit.BIT2=0;
if(MC33984_fault2.Bit.BIT6) MC33984_OUT[7].Bit.BIT0=0;
if(MC33984_fault2.Bit.BIT7) MC33984_OUT[7].Bit.BIT2=0;
if(MC33984_fault3.Bit.BIT0) MC33984_OUT[8].Bit.BIT0=0;
if(MC33984_fault3.Bit.BIT1) MC33984_OUT[8].Bit.BIT2=0;
if(MC33984_fault3.Bit.BIT2) MC33984_OUT[9].Bit.BIT0=0;
if(MC33984_fault3.Bit.BIT3) MC33984_OUT[9].Bit.BIT2=0;
if(MC33984_fault3.Bit.BIT4) MC33984_OUT[10].Bit.BIT0=0;
if(MC33984_fault3.Bit.BIT5) MC33984_OUT[10].Bit.BIT2=0;
if(MC33984_fault3.Bit.BIT6) MC33984_OUT[11].Bit.BIT0=0;
if(MC33984_fault3.Bit.BIT7) MC33984_OUT[11].Bit.BIT2=0;
if(MC33984_fault4.Bit.BIT0) MC33984_OUT[12].Bit.BIT0=0;
if(MC33984_fault4.Bit.BIT1) MC33984_OUT[12].Bit.BIT2=0;
if(MC33984_fault4.Bit.BIT2) MC33984_OUT[13].Bit.BIT0=0;
if(MC33984_fault4.Bit.BIT3) MC33984_OUT[13].Bit.BIT2=0;
if(MC33984_fault4.Bit.BIT4) MC33984_OUT[14].Bit.BIT0=0;
if(MC33984_fault4.Bit.BIT5) MC33984_OUT[14].Bit.BIT2=0;
}
//////////////////////////////////////////////////////////////
//定义: (void)FAULT_CLR(void) //
//描述: 五秒后自动清除MC33984故障 //
//////////////////////////////////////////////////////////////
void FAULT_CLR(void)
{
if(fault_clk)
{
fault_clk=0;
//MC33984_fault1
if(MC33984_fault1.Byte!=0x00) //排气制动电磁阀
{
if(MC33984_fault1.Bit.BIT0)
{
fault1_count[0]++;
if(fault1_count[0]==10)
{
fault1_count[0]=0;
CAN_STR0.Bit.BIT0=0;
CAN_STR0.Bit.BIT1=0;
MC33984_fault1.Bit.BIT0=0;
}
}
if(MC33984_fault1.Bit.BIT1) //发动机仓灯
{
fault1_count[1]++;
if(fault1_count[1]==10)
{
fault1_count[1]=0;
CAN_STR0.Bit.BIT2=0;
CAN_STR0.Bit.BIT3=0;
MC33984_fault1.Bit.BIT1=0;
}
}
if(MC33984_fault1.Bit.BIT2) //左倒车灯
{
fault1_count[2]++;
if(fault1_count[2]==10)
{
fault1_count[2]=0;
CAN_STR0.Bit.BIT4=0;
CAN_STR0.Bit.BIT5=0;
MC33984_fault1.Bit.BIT2=0;
}
}
if(MC33984_fault1.Bit.BIT3) //右倒车灯
{
fault1_count[3]++;
if(fault1_count[3]==10)
{
fault1_count[3]=0;
CAN_STR0.Bit.BIT6=0;
CAN_STR0.Bit.BIT7=0;
MC33984_fault1.Bit.BIT3=0;
}
}
if(MC33984_fault1.Bit.BIT4) //左后雾灯
{
fault1_count[4]++;
if(fault1_count[4]==10)
{
fault1_count[4]=0;
CAN_STR1.Bit.BIT0=0;
CAN_STR1.Bit.BIT1=0;
MC33984_fault1.Bit.BIT4=0;
}
}
if(MC33984_fault1.Bit.BIT5) //右后雾灯
{
fault1_count[5]++;
if(fault1_count[5]==10)
{
fault1_count[5]=0;
CAN_STR1.Bit.BIT2=0;
CAN_STR1.Bit.BIT3=0;
MC33984_fault1.Bit.BIT5=0;
}
}
if(MC33984_fault1.Bit.BIT6) //电磁开关
{
fault1_count[6]++;
if(fault1_count[6]==10)
{
fault1_count[6]=0;
CAN_STR1.Bit.BIT4=0;
CAN_STR1.Bit.BIT5=0;
MC33984_fault1.Bit.BIT6=0;
}
}
if(MC33984_fault1.Bit.BIT7)
{ //预热继电器
fault1_count[7]++;
if(fault1_count[7]==10)
{
fault1_count[7]=0;
CAN_STR1.Bit.BIT6=0;
CAN_STR1.Bit.BIT7=0;
MC33984_fault1.Bit.BIT7=0;
}
}
}
//MC33984_fault2
if(MC33984_fault2.Byte!=0x00) //左后小灯
{
if(MC33984_fault2.Bit.BIT0)
{
fault2_count[0]++;
if(fault2_count[0]==10)
{
fault2_count[0]=0;
CAN_STR2.Bit.BIT0=0;
CAN_STR2.Bit.BIT1=0;
MC33984_fault2.Bit.BIT0=0;
}
}
if(MC33984_fault2.Bit.BIT1) //右后小灯
{
fault2_count[1]++;
if(fault2_count[1]==10)
{
fault2_count[1]=0;
CAN_STR2.Bit.BIT2=0;
CAN_STR2.Bit.BIT3=0;
MC33984_fault2.Bit.BIT1=0;
}
}
if(MC33984_fault2.Bit.BIT2) //启动继电器
{
fault2_count[2]++;
if(fault2_count[2]==10)
{
fault2_count[2]=0;
CAN_STR2.Bit.BIT4=0;
CAN_STR2.Bit.BIT5=0;
MC33984_fault2.Bit.BIT2=0;
}
}
if(MC33984_fault2.Bit.BIT3) //自动润滑电机
{
fault2_count[3]++;
if(fault2_count[3]==10)
{
fault2_count[3]=0;
CAN_STR2.Bit.BIT6=0;
CAN_STR2.Bit.BIT7=0;
MC33984_fault2.Bit.BIT3=0;
}
}
if(MC33984_fault2.Bit.BIT4) //牌照灯组
{
fault2_count[4]++;
if(fault2_count[4]==10)
{
fault2_count[4]=0;
CAN_STR3.Bit.BIT0=0;
CAN_STR3.Bit.BIT1=0;
MC33984_fault2.Bit.BIT4=0;
}
}
if(MC33984_fault2.Bit.BIT5) //空调电容箱电源
{
fault2_count[5]++;
if(fault2_count[5]==10)
{
fault2_count[5]=0;
CAN_STR3.Bit.BIT2=0;
CAN_STR3.Bit.BIT3=0;
MC33984_fault2.Bit.BIT5=0;
}
}
if(MC33984_fault2.Bit.BIT6) //左标志灯4
{
fault2_count[6]++;
if(fault2_count[6]==10)
{
fault2_count[6]=0;
CAN_STR3.Bit.BIT4=0;
CAN_STR3.Bit.BIT5=0;
MC33984_fault2.Bit.BIT6=0;
}
}
if(MC33984_fault2.Bit.BIT7) //左标志灯5
{
fault2_count[7]++;
if(fault2_count[7]==10)
{
fault2_count[7]=0;
CAN_STR3.Bit.BIT6=0;
CAN_STR3.Bit.BIT7=0;
MC33984_fault2.Bit.BIT7=0;
}
}
}
//MC33984_fault3
if(MC33984_fault3.Byte!=0x00) //右标志灯4
{
if(MC33984_fault3.Bit.BIT0)
{
fault3_count[0]++;
if(fault3_count[0]==10)
{
fault3_count[1]=0;
CAN_STR4.Bit.BIT0=0;
CAN_STR4.Bit.BIT1=0;
MC33984_fault3.Bit.BIT0=0;
}
}
if(MC33984_fault3.Bit.BIT1) //右标志灯5
{
fault3_count[1]++;
if(fault3_count[1]==10)
{
fault3_count[1]=0;
CAN_STR4.Bit.BIT2=0;
CAN_STR4.Bit.BIT3=0;
MC33984_fault3.Bit.BIT1=0;
}
}
if(MC33984_fault3.Bit.BIT2) //左刹车灯
{
fault3_count[2]++;
if(fault3_count[2]==10)
{
fault3_count[2]=0;
CAN_STR4.Bit.BIT4=0;
CAN_STR4.Bit.BIT5=0;
MC33984_fault3.Bit.BIT2=0;
}
}
if(MC33984_fault3.Bit.BIT3) //右刹车灯
{
fault3_count[3]++;
if(fault3_count[3]==10)
{
fault3_count[3]=0;
CAN_STR4.Bit.BIT6=0;
CAN_STR4.Bit.BIT7=0;
MC33984_fault3.Bit.BIT3=0;
}
}
if(MC33984_fault3.Bit.BIT4) //后左转向灯
{
fault3_count[4]++;
if(fault3_count[4]==10)
{
fault3_count[4]=0;
CAN_STR5.Bit.BIT0=0;
CAN_STR5.Bit.BIT1=0;
MC33984_fault3.Bit.BIT4=0;
}
}
if(MC33984_fault3.Bit.BIT5) //后右转向灯
{
fault3_count[5]++;
if(fault3_count[5]==10)
{
fault3_count[5]=0;
CAN_STR5.Bit.BIT2=0;
CAN_STR5.Bit.BIT3=0;
MC33984_fault3.Bit.BIT5=0;
}
}
if(MC33984_fault3.Bit.BIT6) //熄火电磁阀
{
fault3_count[6]++;
if(fault3_count[6]==10)
{
fault3_count[6]=0;
CAN_STR6.Bit.BIT2=0;
CAN_STR6.Bit.BIT3=0;
MC33984_fault3.Bit.BIT6=0;
}
}
if(MC33984_fault3.Bit.BIT7) //车速传感器电源
{
fault3_count[7]++;
if(fault3_count[7]==10)
{
fault3_count[7]=0;
CAN_STR5.Bit.BIT4=0;
CAN_STR5.Bit.BIT5=0;
MC33984_fault3.Bit.BIT7=0;
}
}
}
//MC33984_fault4
MC33984_fault4.Bit.BIT0=0;
MC33984_fault4.Bit.BIT1=0;
MC33984_fault4.Bit.BIT2=0;
MC33984_fault4.Bit.BIT3=0;
MC33984_fault4.Bit.BIT6=0; //NC
MC33984_fault4.Bit.BIT7=0; //NC
if(MC33984_fault4.Byte!=0x00)
{
if(MC33984_fault4.Bit.BIT4) //熄火器正
{
fault4_count[0]++;
if(fault4_count[0]==10)
{
fault4_count[0]=0;
CAN_STR5.Bit.BIT6=0;
CAN_STR5.Bit.BIT7=0;
MC33984_fault4.Bit.BIT4=0;
}
}
if(MC33984_fault4.Bit.BIT5) //熄火器反
{
fault4_count[1]++;
if(fault4_count[1]==10)
{
fault4_count[1]=0;
CAN_STR6.Bit.BIT0=0;
CAN_STR6.Bit.BIT1=0;
MC33984_fault4.Bit.BIT5=0;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -