Fix to prevent toggling between load states disabled and low SOC

This commit is contained in:
Martin Jaeger
2019-10-31 19:50:55 +01:00
parent cb0c3c8135
commit 20bc6d124b
+4 -2
View File
@@ -295,8 +295,10 @@ void LoadOutput::state_machine()
}
break;
case LOAD_STATE_OFF_LOW_SOC:
// wait configured time
if (time(NULL) - lvd_timestamp > lvd_recovery_delay) {
// wait at least configured time
if (time(NULL) - lvd_timestamp > lvd_recovery_delay &&
!(log_data.error_flags & (1 << ERR_BAT_UNDERVOLTAGE)))
{
state = LOAD_STATE_DISABLED; // switch to normal mode again
}
break;