From b045ec853979f7a1b359dc022730b9429f04ac3d Mon Sep 17 00:00:00 2001 From: WXK <287788329@qq.com> Date: 星期四, 02 三月 2023 09:23:02 +0800 Subject: [PATCH] 完善uwb升级功能,版本号v1.49 --- Src/application/dw_app.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Src/application/dw_app.c b/Src/application/dw_app.c index 6ce50a5..5d5a49f 100644 --- a/Src/application/dw_app.c +++ b/Src/application/dw_app.c @@ -71,7 +71,7 @@ #define FINAL_MSG_FINAL_TX_TS_IDX 18 #define FINAL_MSG_TS_LEN 4 static dwt_config_t config = { - 2, /* Channel number. */ + 5, /* Channel number. */ DWT_PRF_64M, /* Pulse repetition frequency. */ DWT_PLEN_128, /* Preamble length. */ DWT_PAC8, /* Preamble acquisition chunk size. Used in RX only. */ @@ -605,7 +605,7 @@ if(memcmp(&calCRC,&rec_remotepara[5],2)==0) { uint8_t pack_msgtype,pack_index,pack_length; pack_msgtype = rec_remotepara[0]; - pack_index = rec_remotepara[1]*2; + pack_index = rec_remotepara[1]; pack_length = rec_remotepara[2]; if(pack_msgtype==2) { @@ -613,7 +613,14 @@ { // motor_keeptime = rec_remotepara[3]; - }else{ + }else if(pack_index == CNT_UPDATE) + { + if(rec_remotepara[3]==2) + { + EnterUWBUpdateMode(); + } + } + else{ if(pack_index<200) { memcpy((uint8_t*)&g_com_map + pack_index, &rec_remotepara[3], pack_length); @@ -645,6 +652,7 @@ break; } } + delay_us(100); g_Resttimer=0; NearPoll(); dwt_entersleep(); -- Gitblit v1.9.3