Load: Clear ERR_LOAD_BUS_SRC_CURRENT if current is available again

Previously, the error was never cleared after it was set, which is obviously
a bad idea.
This commit is contained in:
Martin Jäger
2021-02-04 17:28:52 +01:00
parent 1b1ed838eb
commit bdf405fb7b
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -125,6 +125,10 @@ void LoadOutput::control()
flags_clear(&error_flags, ERR_LOAD_OVERVOLTAGE);
}
if (flags_check(&error_flags, ERR_LOAD_BUS_SRC_CURRENT) && bus->src_current_margin < 0) {
flags_clear(&error_flags, ERR_LOAD_BUS_SRC_CURRENT);
}
if (flags_check(&error_flags, ERR_LOAD_SHORT_CIRCUIT) && enable == false) {
// stay here until the charge controller is reset or load is manually switched off
flags_clear(&error_flags, ERR_LOAD_SHORT_CIRCUIT);