From a89755d21f5c57d4f5b96fee03eab246995df341 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期四, 10 二月 2022 15:02:13 +0800 Subject: [PATCH] V2.46 修改丢包问题 --- 源码/核心板/Src/application/beep_logic_app.c | 136 ++++++++++++++++++++++---------------------- 1 files changed, 68 insertions(+), 68 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/beep_logic_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/beep_logic_app.c" index 1fd5085..4545b90 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/beep_logic_app.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/beep_logic_app.c" @@ -16,74 +16,74 @@ uint16_t min_dist; void main_logic(void) //主逻辑在这里执行 { - static uint8_t beep_state,timer_state,beep_timer,beep_ontime,beep_offtime; - uint16_t i; - //除UWB之外的其他代码... - static uint16_t beep_judge_cnt = 0; - if(beep_judge_cnt++ >= 100) - { - beep_judge_cnt = 0; - min_dist=0xffff; - for(i = 0; i < 255;i++) - { - if(g_Tagdist[i] < min_dist&&g_Tagdist[i]>g_com_map[ALARM_DISTANCE1]) - { - min_dist=g_Tagdist[i]; - } - - } - - if (min_dist <= g_com_map[ALARM_DISTANCE2]+distoffset1) - { - beep_ontime = ONTIME2; - beep_offtime = OFFTIME2; - beep_state=2; - distoffset1=0; - distoffset2=0; - } - else if (min_dist <= g_com_map[ALARM_DISTANCE3]+distoffset2) - { - beep_ontime = ONTIME3; - beep_offtime = OFFTIME3; - beep_state=1; - distoffset1=0; - distoffset2=0; - } - else{ - beep_state=0; - distoffset1=0; - distoffset2=0; - } - - if(beep_state!=0) - { - if(timer_state==1) - { - if(beep_timer++ < beep_ontime) - { - RELAY1_ON; - RELAY2_ON; - }else{ - timer_state=0; - beep_timer=0; - } - }else{ - if(beep_timer++ < beep_offtime) - { - RELAY1_OFF; - RELAY2_OFF; - }else{ - timer_state=1; - beep_timer=0; - } - - } - - } else { - RELAY1_OFF; - RELAY2_OFF; - } - } +// static uint8_t beep_state,timer_state,beep_timer,beep_ontime,beep_offtime; +// uint16_t i; +// //除UWB之外的其他代码... +// static uint16_t beep_judge_cnt = 0; +// if(beep_judge_cnt++ >= 100) +// { +// beep_judge_cnt = 0; +// min_dist=0xffff; +// for(i = 0; i < 255;i++) +// { +// if(g_Tagdist[i] < min_dist&&g_Tagdist[i]>g_com_map[ALARM_DISTANCE1]) +// { +// min_dist=g_Tagdist[i]; +// } +// +// } +// +// if (min_dist <= g_com_map[ALARM_DISTANCE2]+distoffset1) +// { +// beep_ontime = ONTIME2; +// beep_offtime = OFFTIME2; +// beep_state=2; +// distoffset1=0; +// distoffset2=0; +// } +// else if (min_dist <= g_com_map[ALARM_DISTANCE3]+distoffset2) +// { +// beep_ontime = ONTIME3; +// beep_offtime = OFFTIME3; +// beep_state=1; +// distoffset1=0; +// distoffset2=0; +// } +// else{ +// beep_state=0; +// distoffset1=0; +// distoffset2=0; +// } +// +// if(beep_state!=0) +// { +// if(timer_state==1) +// { +// if(beep_timer++ < beep_ontime) +// { +// RELAY1_ON; +// RELAY2_ON; +// }else{ +// timer_state=0; +// beep_timer=0; +// } +// }else{ +// if(beep_timer++ < beep_offtime) +// { +// RELAY1_OFF; +// RELAY2_OFF; +// }else{ +// timer_state=1; +// beep_timer=0; +// } +// +// } +// +// } else { +// RELAY1_OFF; +// RELAY2_OFF; +// } +// } } -- Gitblit v1.9.3