| | |
| | | #include "lib_aoa.h" |
| | | #include "WS2812.h" |
| | | #include "PCA9555.h" |
| | | #include "GPS.h" |
| | | extern int simple_main(void); |
| | | extern int temp_main(void); |
| | | void Calibration_Time(void); |
| | |
| | | } |
| | | void OpenUWB(void) |
| | | { |
| | | // while(!mac_is_busy()) |
| | | // { |
| | | // while(!mac_is_busy()) |
| | | // { |
| | | flag_temp1=uwb_rx(0, 0,range_timeout_us);//提交接收请求 |
| | | uwb_rx_flag=1; |
| | | // } |
| | | // } |
| | | //LOG_INFO(TRACE_MODULE_APP,"打开uwb_rx\r\n"); |
| | | } |
| | | void UWBOneSecondTask(void) |
| | |
| | | if(uwb_losttimer>g_com_map[UWB_RNAGE_TIME]) |
| | | uwb_losttimer=g_com_map[UWB_RNAGE_TIME]+1;//防止溢出 |
| | | } |
| | | extern uint8_t heart_upload_time; |
| | | uint16_t count_hexupload; |
| | | void UWBSendUDPTask(void) |
| | | { |
| | | uint16_t checksum,tempdistarray[20]; |
| | |
| | | memcpy(&usart_send[17+taglist_num*4],&anchordata_bat,taglist_num); |
| | | checksum = Checksum_u16(&usart_send[2],15+5*taglist_num); |
| | | memcpy(&usart_send[17+5*taglist_num],&checksum,2); |
| | | HexToAsciiSendUDP(usart_send,19+5*taglist_num); |
| | | if(lounei_flag==0&&heart_upload_time%UPLOAD_4G_TIME==0) |
| | | { |
| | | HexToAsciiSendUDP(usart_send,19+5*taglist_num); |
| | | count_hexupload++; |
| | | } |
| | | taglist_num = 0; |
| | | // rxnum=0; |
| | | } |
| | |
| | | |
| | | case RANGE: |
| | | // time_flag=HIDO_TimerGetTick()-wltag_uwbtimer; |
| | | if(HIDO_TimerGetTick()-wltag_uwbtimer>2&&uwb_rx_flag==0) |
| | | if(HIDO_TimerGetTick()-wltag_uwbtimer>4&&uwb_rx_flag==0) |
| | | { |
| | | wltag_uwbtimer = HIDO_TimerGetTick(); |
| | | OpenUWB(); |