| | |
| | | #include "dw_app.h" |
| | | #include "ADC.h" |
| | | #define TDFILTER |
| | | //#define TDFILTER |
| | | enum enumtagstate |
| | | { |
| | | DISCPOLL, |
| | |
| | | } |
| | | } |
| | | } |
| | | void SetNLOSNTMSettings(void) |
| | | { |
| | | uint8_t temp; |
| | | temp = 7; |
| | | dwt_writetodevice(LDE_IF_ID,LDE_CFG1_OFFSET,1,&temp); |
| | | dwt_write16bitoffsetreg(LDE_IF_ID,LDE_CFG2_OFFSET,3); |
| | | // NTM = dwt_read32bitoffsetreg(LDE_IF_ID,LDE_CFG1_OFFSET) & LDE_CFG1_NSTDEV_MASK; |
| | | } |
| | | void Dw1000_Init(void) |
| | | { |
| | | /* Reset and initialise DW1000. |
| | |
| | | /* Configure DW1000. See NOTE 6 below. */ |
| | | dwt_configure(&config);//閰嶇疆DW1000 |
| | | |
| | | |
| | | SetNLOSNTMSettings(); |
| | | |
| | | /* Apply default antenna delay value. See NOTE 1 below. */ |
| | | dwt_setrxantennadelay(RX_ANT_DLY); //璁剧疆鎺ユ敹澶╃嚎寤惰繜 |
| | |
| | | dis_after_filter=dist_cm; |
| | | hex_dist = dist_cm+(int16_t)g_com_map[DIST_OFFSET]*10; |
| | | g_flag_Taggetdist[taglist_pos]=0; |
| | | if(hex_dist>-10000&&hex_dist<2000000) |
| | | if(hex_dist>0&&hex_dist<2000000) |
| | | { |
| | | if(abs(hex_dist-his_dist[taglist_pos])<15000||misdist_num[taglist_pos]>3) |
| | | if(abs(hex_dist-his_dist[taglist_pos])<10000||misdist_num[taglist_pos]>3) |
| | | { |
| | | int32_t filter_dist; |
| | | #ifdef TDFILTER |