| | |
| | | { |
| | | bat_percent = 0; |
| | | } |
| | | else if(fVoltage_mv > 4200) |
| | | else if(fVoltage_mv > 4100) |
| | | { |
| | | bat_percent = 100; |
| | | } |
| | |
| | | keystarttime2 = HIDO_TimerGetTick(); |
| | | } |
| | | } |
| | | uint8_t guanjiflag_count=0; |
| | | void MinuteTask(void) |
| | | { |
| | | PCA9555_Set_One_Value_Output(ADC_MINIUS,0);//拉低 |
| | | delay_ms(100); |
| | | adc_get(&sample[0], NUM_SAMPLES, adc_callback);//adc采样 |
| | | if(bat_percent<1) |
| | | { |
| | | guanjiflag_count++; |
| | | } |
| | | |
| | | } |
| | | void SecondTask(void) |
| | | { static uint8_t second_count; |
| | | if(second_count++>120) |
| | | if(second_count++>60) |
| | | { |
| | | second_count = 0; |
| | | MinuteTask(); |
| | |
| | | |
| | | g_com_map[MODBUS_MODE] = 0; |
| | | log_4g_enable_flag =1;//g_com_map[LOG_4G_ENABLE]; |
| | | g_com_map[VERSION] = (2<<8)|13; |
| | | g_com_map[VERSION] = (2<<8)|14; |
| | | |
| | | |
| | | LOG_INFO(TRACE_MODULE_APP,"设备ID: %x .\r\n",dev_id); |
| | |
| | | { |
| | | WT588E_PLAY(14); |
| | | } |
| | | if(bat_percent<1&&bat_percent_only_one&&jiancebat_percent_flag) |
| | | if(bat_percent<1&&bat_percent_only_one&&jiancebat_percent_flag&&(guanjiflag_count>9)) |
| | | { |
| | | WT588E_PLAY(15); |
| | | userkey_state=3; |