Src/application/dw_app.c
@@ -92,14 +92,14 @@
   5,
#endif
   DWT_PRF_64M,     /* Pulse repetition frequency. */
   DWT_PLEN_128,    /* Preamble length. */
   DWT_PLEN_1024,    /* Preamble length. */
   DWT_PAC8,        /* Preamble acquisition chunk size. Used in RX only. */
   9,               /* TX preamble code. Used in TX only. */
   9,               /* RX preamble code. Used in RX only. */
   1,               /* Use non-standard SFD (Boolean) */
   DWT_BR_6M8,      /* Data rate. */
   DWT_PHRMODE_STD, /* PHY header mode. */
   (129 + 8 - 8)    /* SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */
   (1025 + 8 - 8)    /* SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */
};
//static uint8_t tx_poll_msg[20] = {0};
//static uint8_t tx_sync_msg[14] = {0};
@@ -175,7 +175,14 @@
//        *ts += ts_field[i] << (i * 8);
//    }
//}
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.
@@ -188,7 +195,7 @@
    /* Configure DW1000. See NOTE 6 below. */
    dwt_configure(&config);//配置DW1000
   SetNLOSNTMSettings();
   
    /* Apply default antenna delay value. See NOTE 1 below. */