Skip to content

Commit

Permalink
evse.cpp: guard MaxMains in all circumstances (except when in Normal …
Browse files Browse the repository at this point in the history
…Mode)
  • Loading branch information
dingo35 committed Aug 22, 2024
1 parent 736d610 commit 4072e9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SmartEVSE-3/src/evse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,9 @@ void CalcBalancedCurrent(char mod) {
// ############### make sure the calculated IsetBalanced doesnt exceed any boundaries #################


// guard MaxMains
if (MainsMeter.Type && Mode != MODE_NORMAL) // Conditions in which MaxCircuit has to be considered
IsetBalanced = min((int) IsetBalanced, (MaxMains * 10) - Baseload); //limiting is per phase so no Nr_Of_Phases_Charging here!
// guard MaxCircuit
if (((LoadBl == 0 && EVMeter.Type && Mode != MODE_NORMAL) || LoadBl == 1) // Conditions in which MaxCircuit has to be considered
&& (IsetBalanced > (MaxCircuit * 10) - Baseload_EV))
Expand Down

0 comments on commit 4072e9d

Please sign in to comment.