| | |
| | | }else{ |
| | | power_low_flag=0; |
| | | gps_air780_power_change(gps_power_state,1);//gps原样,开启4G |
| | | 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); |
| | |
| | | gps_wait_count2=0; |
| | | gps_wait_count=0; |
| | | } |
| | | |
| | | //UWB状态检测 |
| | | |
| | | if(!power_low_flag)//低供电下不需要检测重连 |
| | | { |
| | | if(IfTCPConnected()) |
| | | { |
| | | TCP_reconnect_timer =0; |
| | |
| | | } |
| | | |
| | | } |
| | | } |
| | | HIDO_TimerTick(); |
| | | if(nomove_count<=g_com_map[NOMOVESLEEP_TIME])//防止溢出 |
| | | nomove_count++; |
| | |
| | | ip2 = (g_com_map[TCP_IP_2]>>12&0xf)*1000+(g_com_map[TCP_IP_2]>>8&0xf)*100+(g_com_map[TCP_IP_2]>>4&0xf)*10+(g_com_map[TCP_IP_2]&0xf); |
| | | 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)|10; |
| | | g_com_map[VERSION] = (1<<8)|6; |
| | | LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n",dev_id); |
| | | LOG_INFO(TRACE_MODULE_APP,"固件版本:UWB-4G车载手环 V%d.%d. \r\n",g_com_map[VERSION]>>8,g_com_map[VERSION]&0xff); |
| | | 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); |
| | | } |
| | | |
| | |
| | | int tt2; |
| | | int test1,test3; |
| | | uint32_t test4; |
| | | |
| | | uint32_t time_count; |
| | | int main(void) |
| | | { |
| | | board_clock_run(); |
| | |
| | | board_acceleration_detection_init(move_handler); |
| | | // LOG_INFO(TRACE_MODULE_APP, "测试进入app"); |
| | | board_4GUsart_detection_init(_4gUsart_handler); |
| | | |
| | | while (1) |
| | | { test4=gpio_pin_get_val(SCL_PIN); |
| | | |
| | |
| | | { |
| | | flag_secondtask = 0; |
| | | SecondTask(); |
| | | |
| | | // time_count++; |
| | | } |
| | | UserKeyTask(); |
| | | IMUTask(); |
| | |
| | | // }//yuan |
| | | |
| | | if(delaysleep_count==0) |
| | | if(!gps_power_state&&!gpio_pin_get_val(INPUT_5V_Pin)&&((IfTCPConnected()&&AIR780E_IsIPIdle()&&Socket_IsSendQueueEmpty(0))||((!flag_TCP_reconnectting)&&!IfTCPConnected()))) |
| | | if(!gps_power_state&&!gpio_pin_get_val(INPUT_5V_Pin)&&((IfTCPConnected()&&AIR780E_IsIPIdle()&&Socket_IsSendQueueEmpty(0))||((!flag_TCP_reconnectting)&&!IfTCPConnected())||power_low_flag)) |
| | | { |
| | | // test1=gpio_pin_get_val(_4G_USART_RX_Pin); |
| | | uint32_t lock; |