zhyinch
2020-09-06 e3dedf3cc3d29191937ba908d1cee233eb0adb2d
Ô´Âë/ºËÐİå/Src/application/dw_app.c
@@ -46,16 +46,15 @@
#define POLL_TX_TO_RESP_RX_DLY_UUS 150
/* This is the delay from Frame RX timestamp to TX reply timestamp used for calculating/setting the DW1000's delayed TX function. This includes the
 * frame length of approximately 2.66 ms with above configuration. */
#define RESP_RX_TO_FINAL_TX_DLY_UUS 400
#define RESP_RX_TO_FINAL_TX_DLY_UUS 4100
/* Receive response timeout. See NOTE 5 below. */
#define RESP_RX_TIMEOUT_UUS 600
#define RESP_RX_TIMEOUT_UUS 4700
#define POLL_RX_TO_RESP_TX_DLY_UUS 420
#define POLL_RX_TO_RESP_TX_DLY_UUS 3600
/* This is the delay from the end of the frame transmission to the enable of the receiver, as programmed for the DW1000's wait for response feature. */
#define RESP_TX_TO_FINAL_RX_DLY_UUS 200
#define RESP_TX_TO_FINAL_RX_DLY_UUS 500
/* Receive final timeout. See NOTE 5 below. */
#define FINAL_RX_TIMEOUT_UUS 4300
#define SPEED_OF_LIGHT 299702547
/* Indexes to access some of the fields in the frames defined above. */
@@ -90,16 +89,16 @@
/*------------------------------------ Variables ------------------------------------------*/
/* Default communication configuration. We use here EVK1000's default mode (mode 3). */
static dwt_config_t config = {
   2,               /* Channel number. */
   DWT_PRF_64M,     /* Pulse repetition frequency. */
   DWT_PLEN_128,    /* 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. */
    2,               /* Channel number. */
    DWT_PRF_64M,     /* Pulse repetition frequency. */
    DWT_PLEN_1024,   /* Preamble length. */
    DWT_PAC32,       /* 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_110K,     /* Data rate. */
    DWT_PHRMODE_STD, /* PHY header mode. */
    (1025 + 64 - 32) /* SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */
};
/* Frames used in the ranging process. See NOTE 2 below. */
@@ -329,6 +328,7 @@
extern uint16_t sync_timer;
u16 tmp_time;
extern float dw_vbat;
extern u16 slottime,max_slotnum,current_slotpos,tyncpoll_time;
void Tag_App(void)//发送模式(TAG标签)
{
   uint32_t frame_len;
@@ -493,10 +493,10 @@
//   deca_sleep(10);
}
//   dwt_entersleep();
//   if(tag_succ_times<g_com_map[MIN_REPORT_ANC_NUM])
//   {
//   //poll_timer +=time32_incr&0x7+3;
//   }
   if(tag_succ_times<1)
   {
      tyncpoll_time=(current_slotpos--%max_slotnum)*slottime;
   }
   /* Execute a delay between ranging exchanges. */