| | |
| | | { |
| | | 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马达停止工作\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, "电池电压正常,马达正常工作\r\n"); |
| | | } |
| | | //tt2=gpio_pin_get_val(ADC_GND_ENABLE); |
| | | // LOG_INFO(TRACE_MODULE_APP, "The voltage is %%%d \r\n",bat_percent); |
| | |
| | | void click_Task(void); |
| | | void MotorPoll(void) |
| | | { |
| | | if(active_flag) |
| | | { |
| | | if(change_by_distance()) |
| | | if(change_by_distance()&&active_flag) |
| | | { |
| | | if(motor_count++%2==0) |
| | | motor_power_state=0;//开启 |
| | | else{ |
| | | motor_power_state=1;//关闭 |
| | | } |
| | | } |
| | | }else{ |
| | | }else{ |
| | | motor_power_state=1;//关闭 |
| | | } |
| | | } |
| | |
| | | } |
| | | static void sleep_timer_callback(void *dev, uint32_t time) |
| | | { |
| | | // IO_control_init(); |
| | | IO_control_init(); |
| | | |
| | | MotorPoll(); |
| | | update_led_power_state(); |
| | |
| | | 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)|14; |
| | | g_com_map[VERSION] = (1<<8)|0; |
| | | 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,"固件版本: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); |
| | | } |
| | | |
| | |
| | | int16_t Voltage_input; |
| | | extern uint8_t uwb_rx_flag; |
| | | int main(void) |
| | | { |
| | | { |
| | | board_clock_run(); |
| | | boot_deinit(); |
| | | board_pins_config(); |