| | |
| | | |
| | | #define FZ_NEARBASENUM_INDEX 10 |
| | | #define FZ_NEARBASEID_INDEX 11 |
| | | #define TAG_NUM_IN_SYS 25 |
| | | //#define TAG_NUM_IN_SYS 25 |
| | | |
| | | #define TAG_KEEPTIMES 30 |
| | | #define REPORT_TAG_KEEPTIMES 5 |
| | |
| | | dwt_writetxdata(38, send_buffer, 0);//写入发送数据 |
| | | dwt_writetxfctrl(38, 0);//设定发送长度 |
| | | result = dwt_starttx(DWT_START_TX_DELAYED); |
| | | |
| | | // start_time=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | // timeout=100; //单位0.1ms |
| | | // end_time=start_time+(timeout<<2); |
| | | // if(end_time>=32768) |
| | | // { |
| | | // end_time-=32768; |
| | | // } |
| | | // current_time=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | while (!((status_reg = dwt_read32bitreg(SYS_STATUS_ID)) & SYS_STATUS_TXFRS ))///不断查询芯片状态直到接收成功或者出现错误 |
| | | |
| | | if(result==0) |
| | | { |
| | | // current_time=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | // if(current_time>=end_time&¤t_time<end_time+15000) |
| | | // break; |
| | | }; |
| | | tagofflinetime[taglist_pos] = 0; |
| | | // printf("测距成功,序号%d,距离%d\r\n",frame_seq_nb2,tagdist_list[taglist_pos]); |
| | | // delay_ms(10); |
| | | start_time=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | timeout=100; //单位0.1ms |
| | | end_time=start_time+(timeout<<2); |
| | | if(end_time>=32768) |
| | | { |
| | | end_time-=32768; |
| | | } |
| | | current_time=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | while (!((status_reg = dwt_read32bitreg(SYS_STATUS_ID)) & SYS_STATUS_TXFRS ))///不断查询芯片状态直到接收成功或者出现错误 |
| | | { |
| | | current_time=HAL_LPTIM_ReadCounter(&hlptim1); |
| | | if(current_time>=end_time&¤t_time<end_time+15000) |
| | | break; |
| | | }; |
| | | tagofflinetime[taglist_pos] = 0; |
| | | // printf("测距成功,序号%d,距离%d\r\n",frame_seq_nb2,tagdist_list[taglist_pos]); |
| | | // delay_ms(10); |
| | | } |
| | | } |
| | | uint8_t report_ancnum; |
| | | uint16_t report_ancdist[ANC_MAX_NUM],report_ancid[ANC_MAX_NUM]; |