| | |
| | | |
| | | static uint16_t sync_wg_id,rec_sync_count; |
| | | uint8_t lora_recbuffer[255],lora_recbuffer_len; |
| | | static uint16_t synclock_zero_count,wg_sync_polltime_100us,uwbpoll_time_count; |
| | | static uint16_t wg_sync_polltime_100us,uwbpoll_time_count; |
| | | int16_t synclock_zero_count; |
| | | uint16_t GetUwbPollCount(void) |
| | | { |
| | | uwbpoll_time_count = synclock_zero_count+g_com_map[UWBPOLLTIME_MS_IDX]*33; |
| | |
| | | memcpy(&wg_report_id,&lora_recbuffer[SOURCE_ID_IDX],2); |
| | | memcpy(&wg_sendtime_100us,&lora_recbuffer[SYSTIME_IDX],2); |
| | | synclock_zero_count = rec_sync_count-(wg_sendtime_100us+158)*3.27;//减去17ms 因为lora发送会延迟17ms收到 |
| | | if(synclock_zero_count<0) |
| | | while(synclock_zero_count<0) |
| | | synclock_zero_count+=32768; |
| | | sync_lost_count = 0; |
| | | if(lora_recbuffer[RANGE_STATE_IDX]) |