From 13fa2c6eaab3b3ee51d447d2549f6e09c821dc60 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期一, 20 十二月 2021 12:14:04 +0800 Subject: [PATCH] 1 --- Src/application/dw_app.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Src/application/dw_app.c b/Src/application/dw_app.c index eb43c67..f19f2c4 100644 --- a/Src/application/dw_app.c +++ b/Src/application/dw_app.c @@ -176,7 +176,7 @@ Reset_DW1000();//重启DW1000 /* Target specific drive of RSTn line into DW1000 low for a period. */ Spi_ChangePrescaler(SPIx_PRESCALER_SLOW); //设置为快速模式 dwt_initialise(DWT_LOADUCODE);//初始化DW1000 - Spi_ChangePrescaler(SPIx_PRESCALER_FAST); //设置为快速模式 + //Spi_ChangePrescaler(SPIx_PRESCALER_FAST); //设置为快速模式 /* Configure DW1000. See NOTE 6 below. */ dwt_configure(&config);//配置DW1000 @@ -766,7 +766,7 @@ // tyncpoll_time = (tagslotpos--%max_slotpos)*slottime; } } - +uint8_t pack_length = 0,pack_index = 0,pack_msgtype = 0; void NearPoll(void) { @@ -824,7 +824,7 @@ } } dwt_starttx(DWT_START_TX_IMMEDIATE | DWT_RESPONSE_EXPECTED);//开启发送,发送完成后等待一段时间开启接收,等待时间在dwt_setrxaftertxdelay中设置 - HAL_GPIO_WritePin(LED1_G_GPIO_Port, LED1_G_Pin, GPIO_PIN_RESET); +// HAL_GPIO_WritePin(LED1_G_GPIO_Port, LED1_G_Pin, GPIO_PIN_RESET); // for(i=0;i<nearbase_num+1;i++) // { // nearbase_distlist[i] = 0x1ffff; @@ -985,7 +985,7 @@ {flag_finalsend = 2;} dwt_forcetrxoff(); dwt_write32bitreg(SYS_STATUS_ID,SYS_STATUS_RXFCG| SYS_STATUS_ALL_RX_ERR); - HAL_GPIO_WritePin(LED1_G_GPIO_Port, LED1_G_Pin, GPIO_PIN_SET); +// HAL_GPIO_WritePin(LED1_G_GPIO_Port, LED1_G_Pin, GPIO_PIN_SET); if(mainbase_lost_count==0) { #ifdef SWITCHBASE_DIST @@ -1017,7 +1017,7 @@ if(para_update) { - uint8_t pack_length = 0,pack_index = 0,pack_msgtype = 0; + pack_msgtype = rec_remotepara[0]; pack_index = rec_remotepara[1]; pack_length = rec_remotepara[2]; @@ -1147,8 +1147,6 @@ //LED0_ON; SPIx_CS_GPIO->BRR = SPIx_CS; delay_us(700); - // GetPressAndHeight(); - // intheight = Height*100; SPIx_CS_GPIO->BSRR = SPIx_CS; id = dwt_readdevid() ; while (DWT_DEVICE_ID != id) @@ -1162,6 +1160,8 @@ SCB->AIRCR = 0X05FA0000|(unsigned int)0x04; //软复位回到bootloader } } + + error_times = 0; switch(tag_state) { @@ -1187,6 +1187,8 @@ break; case NEARPOLL: NearPoll(); + //GetPressAndHeight(); + //intheight = Height*100; break; case SINGLEPOLL: Poll(); -- Gitblit v1.9.3