| | |
| | | #include "Usart.h" |
| | | #include "global_param.h" |
| | | #include "filters.h" |
| | | #include <stdio.h> |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | void Dw1000_App_Init(void) |
| | | { |
| | | g_com_map[DEV_ID]=0x00; |
| | | g_com_map[DEV_ID] = 0x04; |
| | | tx_poll_msg[MESSAGE_TYPE_IDX]=POLL; |
| | | tx_resp_msg[MESSAGE_TYPE_IDX]=RESPONSE; |
| | | tx_final_msg[MESSAGE_TYPE_IDX]=FINAL; |
| | |
| | | uint32_t final_tx_time; |
| | | |
| | | GPIO_ResetBits(SPIx_GPIO, SPIx_CS); |
| | | delay_us(250); |
| | | delay_us(2500); |
| | | GPIO_SetBits(SPIx_GPIO, SPIx_CS); |
| | | |
| | | /* Write frame data to DW1000 and prepare transmission. See NOTE 7 below. */ |
| | |
| | | dwt_entersleep(); |
| | | |
| | | } |
| | | |
| | | uint16_t g_Resttimer; |
| | | void Anchor_App(void) |
| | | { |
| | | uint32_t frame_len; |
| | |
| | | { |
| | | UART_CheckReceive(); |
| | | UART_CheckSend(); |
| | | g_Resttimer=0; |
| | | }; |
| | | |
| | | if (status_reg & SYS_STATUS_RXFCG)//鎴愬姛鎺ユ敹 |
| | |
| | | dis_after_filter=dist_cm; |
| | | g_Tagdist[tag_id_recv]=dist_cm; |
| | | g_flag_Taggetdist[tag_id_recv]=0; |
| | | printf("Anchor ID: %d, Tag ID: %d, Dist = %d cm\n", g_com_map[DEV_ID], tag_id_recv, (uint16_t)dis_after_filter); |
| | | //dis_after_filter = LP_Frac_Update(p_Dis_Filter, dist_cm); |
| | | |
| | | } |