Overvoltage alert improved for PWM switching
Previously, the alert was sometimes erroneously triggered in PWM charger absorption phase (constant voltage, PWM switching). Now the overvoltage alert is inhibited during turn-on in each PWM cycle by an interrupt.
This commit is contained in:
@@ -337,6 +337,12 @@ void Charger::charge_control(BatConf *bat_conf)
|
||||
enter_state(CHG_STATE_IDLE);
|
||||
}
|
||||
|
||||
if (dev_stat.has_error(ERR_BAT_OVERVOLTAGE) &&
|
||||
port->voltage < (bat_conf->voltage_absolute_max - 0.5) * num_batteries)
|
||||
{
|
||||
dev_stat.clear_error(ERR_BAT_OVERVOLTAGE);
|
||||
}
|
||||
|
||||
// state machine
|
||||
switch (state) {
|
||||
case CHG_STATE_IDLE: {
|
||||
|
||||
Reference in New Issue
Block a user