From eddac77c8fa85acccbf6eeff48b1ff760c70843a Mon Sep 17 00:00:00 2001 From: WXK <287788329@qq.com> Date: 星期三, 01 十一月 2023 15:33:01 +0800 Subject: [PATCH] 版本v2.7,大包字节uwb传输测试成功。 --- Src/main.c | 29 +++++++++++++++++++++++++++-- 1 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Src/main.c b/Src/main.c index fc3b023..a290b8a 100644 --- a/Src/main.c +++ b/Src/main.c @@ -234,7 +234,7 @@ hardware_pici= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+2); hardware_type= STMFLASH_ReadHalfWord(FLASH_HARDWARE_VERSION_MAP+4); //deca_sleep(1000); - g_com_map[VERSION] = (2<<8)|6; + g_com_map[VERSION] = (2<<8)|7; // g_com_map[DEV_ID]=0x7; #ifdef DEBUG_MODE @@ -354,6 +354,8 @@ { //SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader } +uint8_t i; +uint8_t uwb_tx[300]={0,}; /* USER CODE END 0 */ /** @@ -410,7 +412,10 @@ { Error_Handler(); } - + for(i=0;i<255;i++) + { + uwb_tx[i]=i; + } // HAL_Delay(2000); // mcu_sleep(); @@ -918,6 +923,25 @@ extern uint8_t tx_near_msg[80],stationary_flag,gotosleep_flag; float key_keeptime; extern float motor_ontime,button_delay; +uint32_t tagdisterror_list[TAG_NUM_IN_SYS]; +extern uint16_t taglist_num; +extern int32_t tagdist_list[TAG_NUM_IN_SYS]; +extern uint16_t tagid_list[TAG_NUM_IN_SYS]; +void Up_tagdisterror_list_Poll() +{ + static uint8_t r=0; + for(r=0;r<taglist_num;r++) + { + tagdisterror_list[r]++; + if(tagdisterror_list[r]>10) + { + tagdist_list[r]=0; + tagid_list[r]=0; + taglist_num=taglist_num-1; + tagdisterror_list[r]=0; + } + } +} void HAL_LPTIM_CompareMatchCallback(LPTIM_HandleTypeDef *hlptim) { static uint8_t i=0; @@ -928,6 +952,7 @@ if(button_delay<1) button_delay+=1/(float)tag_frequency; nomove_count+=1/(float)tag_frequency; +Up_tagdisterror_list_Poll(); if(motor_keeptime>0) { motor_keeptime-=1/(float)tag_frequency; -- Gitblit v1.9.3