File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1967,7 +1967,7 @@ void EVSEStates(void * parameter) {
1967
1967
// uint8_t n;
1968
1968
uint8_t leftbutton = 5 ;
1969
1969
uint8_t DiodeCheck = 0 ;
1970
-
1970
+ uint16_t StateTimer = 0 ; // When switching from State B to C, make sure pilot is at 6v for 100ms
1971
1971
1972
1972
// infinite loop
1973
1973
while (1 ) {
@@ -2084,8 +2084,8 @@ void EVSEStates(void * parameter) {
2084
2084
if (pilot == PILOT_12V) { // Disconnected?
2085
2085
setState (STATE_A); // switch to STATE_A
2086
2086
2087
- } else if (pilot == PILOT_6V) {
2088
-
2087
+ } else if (pilot == PILOT_6V && ++StateTimer > 50 ) { // When switching from State B to C, make sure pilot is at 6V for at least 500ms
2088
+ // Fixes https://github.com/dingo35/SmartEVSE-3.5/issues/40
2089
2089
if ((DiodeCheck == 1 ) && (ErrorFlags == NO_ERROR) && (ChargeDelay == 0 )) {
2090
2090
if (EVMeter && ResetKwh) {
2091
2091
EnergyMeterStart = EnergyEV; // store kwh measurement at start of charging.
@@ -2117,8 +2117,9 @@ void EVSEStates(void * parameter) {
2117
2117
}
2118
2118
2119
2119
// PILOT_9V
2120
- } else {
2120
+ } else if (pilot == PILOT_9V) {
2121
2121
2122
+ StateTimer = 0 ; // Reset State B->C transition timer
2122
2123
if (ActivationMode == 0 ) {
2123
2124
setState (STATE_ACTSTART);
2124
2125
ActivationTimer = 3 ;
You can’t perform that action at this time.
0 commit comments