| | |
| | | { |
| | | input5v_time=1; |
| | | flag_secondtask = 1; |
| | | #ifdef UWB_1_5HZ |
| | | #ifdef UWB_1_5HZ |
| | | uwb_time_count++; |
| | | #endif |
| | | uwb_offtime_count++; |
| | |
| | | } |
| | | g_com_map[MODBUS_MODE] = 0; |
| | | log_4g_enable_flag=g_com_map[LOG_4G_ENABLE]; |
| | | g_com_map[VERSION] = (1<<8)|16; |
| | | g_com_map[VERSION] = (1<<8)|19; |
| | | |
| | | |
| | | 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,"固件版本:4G-GPS-URT 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",g_com_map[IP_0],g_com_map[IP_1],g_com_map[IP_2],g_com_map[IP_3],g_com_map[PORT]); |
| | | if(g_com_map[RTCMMODE_INDEX] == RTCMMODE_TCP) |
| | | { |
| | |
| | | { |
| | | if(state5v==1) |
| | | { |
| | | g_com_map[MODBUS_MODE] = 0; |
| | | state5v=0; |
| | | state5V_prase_flag=state5v; |
| | | gps_prase_flag=1;//恢复gps解析 |
| | | uart1_change_from_debug_to_gps();//测试 |
| | | g_com_map[MODBUS_MODE] = 0; |
| | | state5v=0; |
| | | state5V_prase_flag=state5v; |
| | | // gps_prase_flag=1;//恢复gps解析 |
| | | // uart1_change_from_debug_to_gps();//测试 |
| | | // PCA9555_Set_One_Value_Output(MCU_A,0);//输出低电平切换为GPS |
| | | PCA9555_Set_One_Value_Output(LED_POWER,0);//输出低电平关闭LED |
| | | // PCA9555_Set_One_Value_Output(TTS_ENABLE,0); |
| | | PCA9555_Set_One_Value_Output(AIR780E_ENBALE,0); |
| | | PCA9555_Set_One_Value_Output(GPS_POWER,0);//关GPS |
| | | delay_ms(200); |
| | | PCA9555_Set_One_Value_Output(PWR_ENABLE,0);//低电平关闭 |
| | | delay_us(1000000); |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | } |
| | | uint8_t send_gps_over=0; |
| | | char gps_str[19]= {"$CFGSYS,h00000010\r\n"}; |
| | | char gps_str2[20]= {"$CFGSAVE,h00000010\r\n"}; |
| | | char gps_str1[9]={"$CFGSYS\r\n"}; |
| | | void send_to_gps() |
| | | { |
| | | |
| | | // $CFGSAVE,h00000010 |
| | | |
| | | if(uwb_time_count>10&&send_gps_over==0) |
| | | { |
| | | send_gps_over=1; |
| | | uart_send(UART_ID1, gps_str,19, NULL); |
| | | } |
| | | if(uwb_time_count>13&&send_gps_over==1) |
| | | { |
| | | send_gps_over=2; |
| | | uart_send(UART_ID1, gps_str2,20, NULL); |
| | | } |
| | | if(uwb_time_count>15&&send_gps_over==2) |
| | | { |
| | | send_gps_over=3; |
| | | uart_send(UART_ID1, gps_str1,9, NULL); |
| | | } |
| | | |
| | | } |
| | | uint8_t flag_4guart_needinit=0; |
| | | uint8_t index1,index2,index3; |
| | | int16_t Voltage_input; |
| | |
| | | #endif |
| | | while (1) |
| | | { |
| | | |
| | | send_to_gps(); |
| | | uwb_app_poll(); |
| | | Internet_Poll(); |
| | | HIDO_TimerPoll(); |