| | |
| | | SINGLEPOLL, |
| | | }tag_state=STARTPOLL; |
| | | static dwt_config_t config = { |
| | | 3, /* Channel number. */ |
| | | 2, /* Channel number. */ |
| | | DWT_PRF_64M, /* Pulse repetition frequency. */ |
| | | DWT_PLEN_128, /* Preamble length. */ |
| | | DWT_PAC8, /* Preamble acquisition chunk size. Used in RX only. */ |
| | |
| | | // tyncpoll_time = (tagslotpos--%max_slotpos)*slottime; |
| | | } |
| | | } |
| | | void SendHuiZongData(void) |
| | | { |
| | | usart_send[2] = 0x0c;//正常模式 |
| | | usart_send[3] = 15+8*(nearbase_num+1);//数据段长度 |
| | | memcpy(&usart_send[4],&dev_id,2); |
| | | usart_send[6] = frame_seq_nb; |
| | | usart_send[7] = frame_seq_nb>>8; |
| | | usart_send[8] = bat_percent; |
| | | usart_send[9] = tx_near_msg[BUTTON_IDX]; |
| | | |
| | | memcpy(&usart_send[10],&intheight,2); |
| | | usart_send[12] = tag_frequency; |
| | | usart_send[13] = tagslotpos; |
| | | usart_send[14] = 0; |
| | | usart_send[15] = 0; |
| | | usart_send[16] = nearbase_num+1; |
| | | memcpy(&usart_send[17],&mainbase_id,2); |
| | | memcpy(&usart_send[19],&nearbaseid_list,2*nearbase_num); |
| | | memcpy(&usart_send[19+nearbase_num*2],&nearbase_distlist,4*nearbase_num+4); |
| | | memcpy(&usart_send[19+nearbase_num*6+4],&rec_anc_signalpower,2*nearbase_num+2); |
| | | |
| | | checksum = Checksum_u16(&usart_send[2],23+8*nearbase_num); |
| | | memcpy(&usart_send[25+8*nearbase_num],&checksum,2); |
| | | USART_puts(usart_send,27+8*nearbase_num); |
| | | //HexToAsciiSendUDP(usart_send,27+8*nearbase_num); |
| | | } |
| | | uint8_t pack_length = 0,pack_index = 0,pack_msgtype = 0; |
| | | void NearPoll(void) |
| | | { |
| | |
| | | nearbaseid_list0[i]=1; |
| | | } |
| | | } |
| | | SendHuiZongData(); |
| | | dwt_write32bitreg(SYS_STATUS_ID, SYS_STATUS_ALL_RX_ERR| SYS_STATUS_TXFRS |SYS_STATUS_RXFCG); |
| | | //HAL_GPIO_WritePin(LED0_GPIO, GPIO_PIN_9, GPIO_PIN_RESET); |
| | | |