WXK
2025-05-13 8dd2c20ddb32d065b877d66394e52a73c0376838
Src/application/dw_app.c
@@ -71,7 +71,7 @@
#define FINAL_MSG_FINAL_TX_TS_IDX 18
#define FINAL_MSG_TS_LEN 4
#define _UWB_4G
//#define _UWB_4G
static dwt_config_t config = {
#ifdef _UWB_4G
@@ -357,7 +357,7 @@
          if(distance>-10&&distance<1000)
            nearbase_distlist[i] = distance*100+anc_distoffset[i];
      }else{
         // nearbase_distlist[i] = 0x1ffff;
          nearbase_distlist[i] = 0x1ffff;
      }
    
    }
@@ -682,6 +682,7 @@
}
u8 regpoll_count;
u32 id;
uint32_t temp23;
void Tag_App(void)//发送模式(TAG标签)
{
   
@@ -696,6 +697,11 @@
            printf("UWB芯片ID错误");
            break;
        }
    }
    temp23 =  dwt_read32bitreg(CHAN_CTRL_ID) ;
    if(temp23!=0x4A7A0055&&temp23!=0x4A7A0022)  //通道状态监听,不正常重启。
    {
       NVIC_SystemReset();
    }
    delay_us(100);
   g_Resttimer=0;
@@ -713,6 +719,10 @@
            Registor_Poll();
        }
    }
    if(freqlost_count>FREQ_LOST_RESTART_TIME)       //1个小时无测距 设备重启一次
    {
        NVIC_SystemReset();
    }
   NearPoll();
   dwt_entersleep();
    bat_percent=Get_VDDVlotage();