From 7d3477c256ef93ce3190c1d7740c90ee941311cd Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期四, 07 四月 2022 21:00:49 +0800 Subject: [PATCH] V1.70 --- 源码/核心板/Src/application/dw_app.c | 36 +++++++++++++++++++----------------- 1 files changed, 19 insertions(+), 17 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" index 3245d47..33bb9a0 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/application/dw_app.c" @@ -1,5 +1,6 @@ #include "dw_app.h" #include "ADC.h" +#include "stm32f10x_it.h" #define TDFILTER enum enumtagstate { @@ -318,7 +319,7 @@ u8 exsistbase_list[MAX_NEARBASE_NUM],report_num,get_newbase=0,uwbrec_userdata[20],uwbrec_userdatalen; u16 temp_sync_timer1,temp_sync_timer2; extern u8 usartrec_userdatalen,heartbeat_timer; - void NearPoll(void) +void NearPoll(void) { static u8 mainbase_lost_count=0,flag_finalsend,flag_rxon; uint32_t temp1,temp2,dw_systime; @@ -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,9 +585,10 @@ // 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; + tag_state=NEARPOLL; } // tyncpoll_time=0; next_nearbase_num=0; -- Gitblit v1.9.3