batteryservice_get_voltage_by_channel(&cur_vol,ADC_CHANNEL_BAT_VOLTAGE);
- if(bat_vol.percent > 0 && bat_vol.percent<=100 && (fabsf(cur_vol - bat_vol.avg_vol) < 0.25))
- history_percent = bat_vol.percent;
+ if (bat_vol.percent > 0 && bat_vol.percent <= 100) {
+ float threshold = get_charge_stat() ? 0.4f : 0.25f;
+ if (fabsf(cur_vol - bat_vol.avg_vol) < threshold) {
+ history_percent = bat_vol.percent;
+ }
+ }
// for(int i = 0; i < AVG_VOLTAGE_COUNT;i++)
// {
// printf("history_data[%d]:%.3f\n",i,bat_vol.history_data[i]);