Skip to content

Commit 819176f

Browse files
committed
main.c: Set Balanced[0] to MinCurrent when switching to state C. Remove SetCurrent when entering state B
1 parent 7fe3f69 commit 819176f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SmartEVSE-3/src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ void setState(uint8_t NewState) { //c
870870
#ifdef SMARTEVSE_VERSION //v3
871871
timerAlarmWrite(timerA, PWM_95, false); // Enable Timer alarm, set to diode test (95%)
872872
#endif
873-
SetCurrent(ChargeCurrent); // Enable PWM
873+
874874
#ifndef SMARTEVSE_VERSION //CH32
875875
TIM1->CH4CVR = PWM_96; // start ADC sampling at 96% (Diode Check)
876876
#endif
@@ -3138,7 +3138,7 @@ void Timer10ms_singlerun(void) {
31383138
BalancedMax[0] = ChargeCurrent;
31393139
if (IsCurrentAvailable()) {
31403140

3141-
Balanced[0] = 0; // For correct baseload calculation set current to zero
3141+
Balanced[0] = MinCurrent * 10; // Set Balanced[0] to MinCurrent (baseload calc might be off briefly)
31423142
CalcBalancedCurrent(1); // Calculate charge current for all connected EVSE's
31433143
DiodeCheck = 0; // (local variable)
31443144
setState(STATE_C); // switch to STATE_C

0 commit comments

Comments
 (0)