zhyinch
2021-08-25 458f6d4d74b74367125e16c2cb593252769fa7d6
Ô´Âë/ºËÐİå/Src/application/beep_logic_app.c
@@ -21,8 +21,8 @@
    static uint8_t beep_state,timer_state,beep_timer,beep_ontime,beep_offtime;
         if (min_dist <= g_com_map[ALARM_DISTANCE2]+distoffset1)
                {
                    beep_ontime = JDQ_time;
                    beep_offtime = JDQ_time;
                    beep_ontime = 1;
                    beep_offtime = 0;
                    beep_state=2;
                    distoffset1=0;
                    distoffset2=0;
@@ -64,6 +64,9 @@
                            }
                        
                    }
                }else {
                    RELAY1_OFF;
                 //    RELAY2_OFF;
                }
}
void Relay2Task(u16 min_dist)
@@ -72,8 +75,8 @@
    static uint8_t beep_state2,timer_state2,beep_timer2,beep_ontime2,beep_offtime2;
         if (min_dist <= g_com_map[RELAY2_DISTANCE2]+distoffset12)
                {
                    beep_ontime2 = JDQ_time;
                    beep_offtime2 = JDQ_time;
                    beep_ontime2 = 1;
                    beep_offtime2 = 0;
                    beep_state2=2;
                    distoffset12=0;
                    distoffset22=0;
@@ -115,6 +118,9 @@
                            }
                        
                    }
                }else {
                   // RELAY1_OFF;
                     RELAY2_OFF;
                }
}
void main_logic(void)   //主逻辑在这里执行
@@ -122,7 +128,7 @@
   uint16_t i;
   //除UWB之外的其他代码...
   static uint16_t beep_judge_cnt = 0;
    if(g_com_map[ALARM_DISTANCE1]!=0||g_com_map[ALARM_DISTANCE2]!=0||g_com_map[ALARM_DISTANCE3]!=0)
    if(g_com_map[ALARM_DISTANCE1]!=0||g_com_map[ALARM_DISTANCE2]!=0||g_com_map[ALARM_DISTANCE3]!=0||g_com_map[RELAY2_DISTANCE1]!=0||g_com_map[RELAY2_DISTANCE2]!=0||g_com_map[RELAY2_DISTANCE3]!=0)
    {
            if(beep_judge_cnt++ >= 100)
            {