| | |
| | | extern int distance; |
| | | extern uint8_t anchordata_num; |
| | | uint32_t dev_id; |
| | | uint8_t group_id; |
| | | uint16_t group_id; |
| | | uint16_t tag_frequency; |
| | | uint16_t disoffset; |
| | | uint16_t warning_distance,prewarning_distance; |
| | |
| | | { |
| | | power_low_flag=1; |
| | | gps_air780_power_change(gps_power_state,0);//gps原样,关闭4G |
| | | LOG_INFO(TRACE_MODULE_APP, "电池电压低于3.3V,4G,GPS停止工作\r\n"); |
| | | //LOG_INFO(TRACE_MODULE_APP, "电池电压低于3.3V,4G,GPS停止工作\r\n"); |
| | | }else{ |
| | | power_low_flag=0; |
| | | gps_air780_power_change(gps_power_state,1);//gps原样,开启4G |
| | | LOG_INFO(TRACE_MODULE_APP, "电池电压正常,4G,GPS,正常工作\r\n"); |
| | | //LOG_INFO(TRACE_MODULE_APP, "电池电压正常,4G,GPS,正常工作\r\n"); |
| | | } |
| | | gpio_pin_set(ADC_GND_ENABLE);//在拉高 |
| | | // LOG_INFO(TRACE_MODULE_APP, "The voltage is %%%d \r\n",bat_percent); |
| | |
| | | { gpio_pin_clr(ADC_GND_ENABLE);//拉低 |
| | | adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样 |
| | | } |
| | | int16_t bind_count; |
| | | extern uint16_t temp_group_id; |
| | | void SecondTask(void) |
| | | {static uint8_t second_count; |
| | | if(second_count++>60) |
| | |
| | | MinuteTask(); |
| | | } |
| | | TagListUpdate_person_num_car(); |
| | | //in_table_log(); |
| | | |
| | | // if(!power_low_flag) |
| | | // Gps_change(); |
| | | // else{ |
| | | // gps_power_state=0;//关闭GPS |
| | | // update_led_power_state(); |
| | | // //初始化GPS计数数据 |
| | | // gps_need_data_flag=1; |
| | | // gps_wait_count2=0; |
| | | // gps_wait_count=0; |
| | | // } |
| | | // //UWB状态检测 |
| | | //if(!power_low_flag)//低供电下不需要检测重连 |
| | | // { |
| | | // if(IfTCPConnected()) |
| | | // { |
| | | // TCP_reconnect_timer =0; |
| | | // flag_TCP_reconnectting = 0; |
| | | // } else { |
| | | // if(TCP_reconnect_timer<30)//如果TCP没有连接,每隔10分钟尝试连接30秒 |
| | | // { |
| | | // flag_TCP_reconnectting = 1; |
| | | // } else { |
| | | // flag_TCP_reconnectting = 0; |
| | | // } |
| | | // if(TCP_reconnect_timer++>600) |
| | | // { |
| | | // TCP_reconnect_timer = 0; |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | if(g_com_map[BIND_START_INDEX]) |
| | | { |
| | | if(bind_count--<=0) |
| | | { |
| | | g_com_map[BIND_START_INDEX]=0; |
| | | if(temp_group_id!=0) |
| | | { |
| | | g_com_map[GROUP_ID]=temp_group_id; |
| | | save_com_map_to_flash(); |
| | | } |
| | | sys_reset(1); |
| | | } |
| | | } |
| | | HIDO_TimerTick(); |
| | | if(nomove_count<=g_com_map[NOMOVESLEEP_TIME])//防止溢出 |
| | | nomove_count++; |
| | |
| | | ip3 = (g_com_map[TCP_IP_3]>>12&0xf)*1000+(g_com_map[TCP_IP_3]>>8&0xf)*100+(g_com_map[TCP_IP_3]>>4&0xf)*10+(g_com_map[TCP_IP_3]&0xf); |
| | | port = g_com_map[TCP_PORT]; |
| | | g_com_map[VERSION] = (1<<8)|0; |
| | | LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n",dev_id); |
| | | LOG_INFO(TRACE_MODULE_APP,"固件版本:4G-GPS定位手环 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff); |
| | | LOG_INFO(TRACE_MODULE_APP,"服务器地址: %d.%d.%d.%d:%d.\r\n",ip0,ip1,ip2,ip3,port); |
| | | LOG_INFO(TRACE_MODULE_APP,"设备ID: %x 组ID %d.\r\n",dev_id,group_id); |
| | | LOG_INFO(TRACE_MODULE_APP,"固件版本:跟随基站 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff); |
| | | //LOG_INFO(TRACE_MODULE_APP,"服务器地址: %d.%d.%d.%d:%d.\r\n",ip0,ip1,ip2,ip3,port); |
| | | } |
| | | |
| | | |