| | |
| | | uint8_t link_success_flag,motor_count; |
| | | uint16_t gps_wait_count; |
| | | uint8_t state5v = 1; |
| | | uint8_t motor_power_state=1,uwb_state,air780_power_state,gps_success_state,chaging_state,changed_state,air780_success_state,first_motor_in_flag; |
| | | uint8_t motor_power_state=1,uwb_state,air780_power_state,gps_success_state,red_charge_state,green_charge_state,air780_success_state,first_motor_in_flag; |
| | | float nomove_count=0; |
| | | static uint32_t sample[NUM_SAMPLES] = {0}; |
| | | uint8_t recev_error_num,send_messgae_count,send_flag,control_state; |
| | |
| | | nomove_count++; |
| | | } |
| | | uint8_t tt=1; |
| | | uint8_t flag_sleeptimer,flag_secondtask,secondtask_count,log_4g_enable_flag; |
| | | |
| | | uint8_t flag_sleeptimer,flag_secondtask,secondtask_count,log_4g_enable_flag,enbale_blink_flag; |
| | | static void sleep_timer_callback(void *dev, uint32_t time) |
| | | { |
| | | IO_control_init(); |
| | | if(tt) |
| | | //IO_control_init(); |
| | | if(enbale_blink_flag) |
| | | { |
| | | green_charge_state=0; |
| | | charge_red_on(); |
| | | } |
| | | UWBPoll(); |
| | | //车载poll |
| | | UWB_Tag_Poll(); |
| | |
| | | } |
| | | |
| | | flag_sleeptimer = 1; |
| | | |
| | | |
| | | charge_state_change();//充电状态判断 |
| | | |
| | | //马达震动逻辑 |
| | | if(g_com_map[MOTOR_ENABLE]) |
| | | { |
| | |
| | | }else{ |
| | | motor_power_state=1; |
| | | } |
| | | |
| | | if(enbale_blink_flag) |
| | | { |
| | | green_charge_state=0; |
| | | charge_red_off(); |
| | | } |
| | | if(delaysleep_count>0) |
| | | delaysleep_count--; |
| | | //GPS工作逻辑 |
| | |
| | | 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)|11; |
| | | 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,"服务器地址: %d.%d.%d.%d:%d.\r\n",ip0,ip1,ip2,ip3,port); |
| | |
| | | TCPClient_Poll(); |
| | | air780_led_off(); |
| | | } |
| | | |
| | | if(flag_secondtask) |
| | | { |
| | | flag_secondtask = 0; |