| | |
| | | } |
| | | if(fVoltage_mv<3300) |
| | | { |
| | | power_low_flag=1; |
| | | gps_air780_power_change(gps_power_state,0);//gps原样,关闭4G |
| | | //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"); |
| | | }else{ |
| | | power_low_flag=0; |
| | | gps_air780_power_change(gps_power_state,1);//gps原样,开启4G |
| | | //power_low_flag=0; |
| | | //gps_air780_power_change(gps_power_state,1);//gps原样,开启4G |
| | | //LOG_INFO(TRACE_MODULE_APP, "电池电压正常,4G,GPS,正常工作\r\n"); |
| | | } |
| | | PCA9555_Set_One_Value_Output(ADC_MINIUS,1);//拉高 |
| | |
| | | second_count = 0; |
| | | MinuteTask(); |
| | | } |
| | | |
| | | //UWBOneSecondTask(); |
| | | // if(!power_low_flag) |
| | | // Gps_change(); |
| | | // else{ |
| | |
| | | // io_pull_set(SCL_PIN , IO_PULL_UP, IO_PULL_UP_LEVEL4); |
| | | //gps_air780_power_change(0,1);//开启gps,4G |
| | | //加速度计初始化必须在IO_control_init之前因为复用SDA引脚 |
| | | gpio_pin_clr(ADC_GND_ENABLE); |
| | | Program_Init(); |
| | | //uart_open(UART_ID1, &test_uart_cfg); |
| | | // uart1_change_from_gps_to_debug(); |
| | |
| | | power_init(); |
| | | //AIR780E_Reset(); //4G模块重启,耗时1.5秒,这个是无法同步的关键 |
| | | sleep_timer_open(true, SLEEP_TIMER_MODE_RELOAD, sleep_timer_callback); |
| | | sleep_timer_start(__MS_TO_32K_CNT(g_com_map[COM_INTERVAL]));//测试 |
| | | //sleep_timer_start(__MS_TO_32K_CNT(SLEEP_TIMER_NUM));//测试 |
| | | //sleep_timer_start(__MS_TO_32K_CNT(g_com_map[COM_INTERVAL]));//测试 |
| | | sleep_timer_start(__MS_TO_32K_CNT(SLEEP_TIMER_NUM));//测试 |
| | | // board_5V_input_init(voltage_input_handler); |
| | | PCA9555_Set_One_Value_Output(ADC_MINIUS,0);//拉低 |
| | | adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样 |