| | |
| | | { if(time32_incr - start_poll>20) |
| | | NVIC_SystemReset(); |
| | | UART_CheckReceive(); |
| | | UART_CheckSend(); |
| | | |
| | | }; |
| | | |
| | | /* Increment frame sequence number after transmission of the poll message (modulo 256). */ |
| | |
| | | poll_tx_ts = get_tx_timestamp_u64(); //è·å¾POLLåéæ¶é´T1 |
| | | resp_rx_ts = get_rx_timestamp_u64(); //è·å¾RESPONSEæ¥æ¶æ¶é´T4 |
| | | |
| | | memcpy(&anchor_dist_last_frm[tag_id], &rx_buffer[DIST_IDX], 4); |
| | | memcpy(&anchor_dist_last_frm[0], &rx_buffer[DIST_IDX], 4); |
| | | memcpy(&tx_final_msg[ANCHOR_ID_IDX], &rx_buffer[ANCHOR_ID_IDX], 4); |
| | | /* Compute final message transmission time. See NOTE 9 below. */ |
| | | final_tx_time = (resp_rx_ts + (RESP_RX_TO_FINAL_TX_DLY_UUS * UUS_TO_DWT_TIME)) >> 8;//计ç®finalå
åéæ¶é´ï¼T5=T4+Treply2 |
| | |
| | | #ifdef WORK_MODE_TAG |
| | | LED0_BLINK; |
| | | #endif |
| | | |
| | | #ifdef HEX_OUTPUT |
| | | usart_send[2] = frame_seq_nb++; |
| | | //usart_send[6] = tag_id_recv; |
| | | //usart_send[8] = g_com_map[DEV_ID]; |
| | | memcpy(&usart_send[3],&dev_id,4); |
| | | memcpy(&usart_send[7],&rx_buffer[ANCHOR_ID_IDX],4); |
| | | hex_dist = anchor_dist_last_frm[0]; |
| | | memcpy(&usart_send[11],&hex_dist,4); |
| | | usart_send[15] = battary; |
| | | usart_send[16] = button; |
| | | checksum = Checksum_u16(&usart_send[2],19); |
| | | memcpy(&usart_send[21],&checksum,2); |
| | | UART_PushFrame(usart_send,23); |
| | | #else |
| | | printf("Anchor ID: %d, Tag ID: %d, Dist = %d cm\n", g_com_map[DEV_ID_L]|g_com_map[DEV_ID_L]<<8, tag_id_recv, (uint16_t)dist_cm); |
| | | #endif |
| | | /* Poll DW1000 until TX frame sent event set. See NOTE 8 below. */ |
| | | if(result==0) |
| | | {while (!(dwt_read32bitreg(SYS_STATUS_ID) & SYS_STATUS_TXFRS))//䏿æ¥è¯¢è¯çç¶æç´å°åé宿 |