Skip to content

Commit

Permalink
Detect shorted CP to PE while in StateC as required by IEC 61851-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mstegen committed Oct 21, 2024
1 parent c5bc617 commit 5f391d1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion SmartEVSE-3/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,15 @@ void EVSEStates(void * parameter) {
DiodeCheck = 0;
GLCD_init(); // Re-init LCD (200ms delay); necessary because switching contactors can cause LCD to mess up
// Mark EVSE as inactive (still State B)
}
} else if (pilot != PILOT_6V) { // Pilot level at anything else is an error
if (++StateTimer > 50) { // make sure it's not a glitch, by delaying by 500mS (re-using StateTimer here)
StateTimer = 0; // Reset StateTimer for use in State B
setState(STATE_B);
DiodeCheck = 0;
GLCD_init(); // Re-init LCD (200ms delay); necessary because switching contactors can cause LCD to mess up
}

} else StateTimer = 0;

} // end of State C code

Expand Down

0 comments on commit 5f391d1

Please sign in to comment.