| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | } |
| | | }else { |
| | | RELAY1_OFF; |
| | | // RELAY2_OFF; |
| | | } |
| | | } |
| | | void Relay2Task(u16 min_dist) |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | } |
| | | }else { |
| | | // RELAY1_OFF; |
| | | RELAY2_OFF; |
| | | } |
| | | } |
| | | void main_logic(void) //主é»è¾å¨è¿éæ§è¡ |
| | |
| | | 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) |
| | | { |