From a1a8ad0cba66e2999f65385f5f8077a7dd8fa057 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期五, 08 十一月 2019 12:55:27 +0800 Subject: [PATCH] 增加数据溢出异常处理 --- 源码/核心板/Src/application/dw_app.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" index 8ef4487..85812fc 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" @@ -318,6 +318,7 @@ int8_t tag_delaytime; extern uint16_t sync_timer; u16 tmp_time; +int32_t temp_dist; void Tag_App(void)//发送模式(TAG标签) { uint32_t frame_len; @@ -418,7 +419,14 @@ tag_succ_times++; LED0_BLINK; - +// temp_dist=anchor_dist_last_frm[0]; +// if(anchor_dist_last_frm[0]>1000000) +// { +// temp_dist=anchor_dist_last_frm[0]-0xffffffff; +// temp_dist+=0xffff; +// anchor_dist_last_frm[0]=temp_dist; +// } + usart_send[2] = 1;//正常模式 usart_send[3] = 17;//数据段长度 @@ -602,6 +610,8 @@ // dist[TAG_ID] = LP(dis, TAG_ID); //LP 为低通滤波器,让数据更稳定 /*--------------------------以下为非测距逻辑------------------------*/ + //dist_cm=33000; + LED0_BLINK; //每成功一次通讯则闪烁一次 g_UWB_com_interval = 0; dis_after_filter=dist_cm; -- Gitblit v1.9.3