zhyinch
2022-04-07 7d3477c256ef93ce3190c1d7740c90ee941311cd
源码/核心板/Src/application/dw_app.c
@@ -1,5 +1,6 @@
#include "dw_app.h"
#include "ADC.h"
#include "stm32f10x_it.h"
#define TDFILTER
enum enumtagstate
{
@@ -424,22 +425,22 @@
                           memcpy(&tmp_time,&rx_buffer[ANCTIMEUS],2);
                           
                           
                           if(g_com_map[DEV_ROLE]!=0)
                           {
                           sync_timer=temp_sync_timer1;
////                           memcpy(&tagslotpos,&rx_buffer[TAGSLOTPOS],2);
//                           if(g_com_map[DEV_ROLE]!=0)
//                           {
//                           sync_timer=temp_sync_timer1;
//////                           memcpy(&tagslotpos,&rx_buffer[TAGSLOTPOS],2);
////
//                           
                              tmp_time=tmp_time+650;
                           if(tmp_time>999)
                           {
                              tmp_time-=999;
                              sync_timer++;
                              if(sync_timer>=1000)
                                 {sync_timer=0;}
                           }
                           TIM3->CNT=tmp_time;
                        }
//                              tmp_time=tmp_time+650;
//                           if(tmp_time>999)
//                           {
//                              tmp_time-=999;
//                              sync_timer++;
//                              if(sync_timer>=1000)
//                                 {sync_timer=0;}
//                           }
//                           TIM3->CNT=tmp_time;
//                        }
                           current_slotnum=temp_sync_timer1/g_com_map[COM_INTERVAL];
//                           if(tagslotpos>max_slotpos)
//                              tagslotpos=tagslotpos%(max_slotpos+1);
@@ -584,6 +585,7 @@
//               temp_adc=Get_ADC_Value();
//               random_value=random_value|((temp_adc&0x01)<<i);
//            }
                pollsendtimer+=time32_incr%11;
            tagslotpos=GetRandomSlotPos(rec_tagpos_binary|tagpos_binary);
            tyncpoll_time = (tagslotpos--%max_slotpos)*slottime;
      tag_state=NEARPOLL;