zhyinch
2022-03-28 96a63685fd53bd939772377296a9e732333e3748
Ô´Âë/ºËÐİå/Src/application/dw_app.c
@@ -480,6 +480,7 @@
double Ra, Rb, Da, Db;
int64_t tof_dtu;
u32 errortimes,goodtimes;
u8 tagpossend_flag;
u8 Anchor_RecNearPoll(u8 ancrec_nearbasepos) //0 mainbase  1 first near_base
{
   
@@ -496,7 +497,13 @@
         dwt_setrxaftertxdelay(RESP_TX_TO_FINAL_RX_DLY_UUS+(rec_nearbase_num+1-ancrec_nearbasepos)*DELAY_BETWEEN_TWO_FRAME_UUS);//设置发送完成后开启接收延迟时间
         dwt_setrxtimeout(FINAL_RX_TIMEOUT_UUS);//接收超时时间
         //dwt_readdiagnostics(&d1);
         if(tagpos[taglist_pos].tagid==tag_id_recv)
            {
                memcpy(&tx_nearresp_msg[TAGPOS_INDEX],&tagpos[taglist_pos],tagpos[taglist_pos].datalen+3);
                tagpossend_flag = 1;
            }else{
                tagpossend_flag = 0;
            }
         if(new_tagid)
         {
            tagdist_list[taglist_pos]=0x1ffff;   
@@ -536,8 +543,8 @@
            if(finalsend == 0)
                {
                    memcpy(&tx_nearresp_msg[MAXRANGE_DISTANCE],&g_com_map[MAXRANGDIST_INDEX],2);
                  dwt_writetxdata(28, tx_nearresp_msg, 0);//写入发送数据
                  dwt_writetxfctrl(28, 0);//设定发送长度
                  dwt_writetxdata(28+tagpossend_flag*(tagpos[taglist_pos].datalen+3), tx_nearresp_msg, 0);//д????????
                  dwt_writetxfctrl(28+tagpossend_flag*(tagpos[taglist_pos].datalen+3), 0);//?څ???????
            }
               
//          if(remotesend_state&&tag_id_recv==configremotetagID)
@@ -617,21 +624,21 @@
                    g_Tagdist[taglist_pos]=hex_dist;   
                    signalpower_list[taglist_pos] = ((uint8_t)firstpath_power<<8)|(uint8_t)((rx_power-firstpath_power)*10);
//            #ifndef USART_INTEGRATE_OUTPUT
//               usart_send[2] = 1;//正常模式
//               usart_send[3] = 17;//数据段长度
//               usart_send[4] = frame_seq_nb2;//数据段长度
//               memcpy(&usart_send[5],&tag_id_recv,2);
//               memcpy(&usart_send[7],&dev_id,2);
//               memcpy(&usart_send[9],&tagdist_list[taglist_pos],4);
//               usart_send[13] = battary;
//               usart_send[14] = button;
//               usart_send[15] = firstpath_power;
//               usart_send[16] = (rx_power-firstpath_power)*10;
//               usart_send[17] = tag_frequency;
//               usart_send[18] = tag_slotpos;
//               checksum = Checksum_u16(&usart_send[2],17);
//               memcpy(&usart_send[19],&checksum,2);
//            //   UART_PushFrame(usart_send,21);
               usart_send[2] = 1;//正常模式
               usart_send[3] = 17;//数据段长度
               usart_send[4] = frame_seq_nb2;//数据段长度
               memcpy(&usart_send[5],&tag_id_recv,2);
               memcpy(&usart_send[7],&dev_id,2);
               memcpy(&usart_send[9],&tagdist_list[taglist_pos],4);
               usart_send[13] = battary;
               usart_send[14] = button;
               usart_send[15] = firstpath_power;
               usart_send[16] = (rx_power-firstpath_power)*10;
               usart_send[17] = tag_frequency;
               usart_send[18] = tag_slotpos;
               checksum = Checksum_u16(&usart_send[2],17);
               memcpy(&usart_send[19],&checksum,2);
               //UART_PushFrame(usart_send,21);
//            #else      
//               memcpy(&usart_send_anc[4+6*anc_report_num],&tag_id_recv,2);
//               memcpy(&usart_send_anc[6+6*anc_report_num],&tagdist_list[taglist_pos],4);
@@ -912,9 +919,9 @@
                memcpy(&recnearbaselist_id,&rx_buffer[NEARBASEID_INDEX],rec_nearbase_num*2);
                memcpy(&recnearbaselist_dist,&rx_buffer[NEARBASEID_INDEX+rec_nearbase_num*2],rec_nearbase_num*4+4);
                memcpy(&rec_taganc_signalpower_list,&rx_buffer[NEARBASEID_INDEX+rec_nearbase_num*6+4],rec_nearbase_num*2+2);
           //     if(anc_id_recv == dev_id )
                if(anc_id_recv == dev_id||g_com_map[OUTPUTALLNEARPOLLMSG] == 1 )
                {
                usart_send[2] = 0x0c;//正常模式
                    usart_send[2] = 0x0c;//正常模式
               usart_send[3] = 15+8*(rec_nearbase_num+1);//数据段长度
               memcpy(&usart_send[4],&tag_id_recv,2);
                    usart_send[6] = rx_buffer[SEQUENCE_IDX];