Skip to content

Commit 347f047

Browse files
committed
main.cpp: remove check for 0V when disconnecting pilot, fixes #314. Do not disconnect pilot when swithing to PAUSE or OFF.
1 parent 0644465 commit 347f047

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

SmartEVSE-3/src/main.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ void setState(uint8_t NewState) { //c
811811
switch (NewState) {
812812
case STATE_B1:
813813
if (!ChargeDelay) setChargeDelay(3); // When entering State B1, wait at least 3 seconds before switching to another state.
814-
if (State != STATE_B1 && !PilotDisconnected) {
814+
if (State != STATE_B1 && !PilotDisconnected && AccessStatus == ON) { // Don't disconnect Pilot when switching to OFF or PAUSE
815815
PILOT_DISCONNECTED;
816816
PilotDisconnected = true;
817817
PilotDisconnectTime = 5; // Set PilotDisconnectTime to 5 seconds
@@ -3064,11 +3064,7 @@ void Timer10ms_singlerun(void) {
30643064
if (State == STATE_A || State == STATE_COMM_B || State == STATE_B1) {
30653065
// When the pilot line is disconnected, wait for PilotDisconnectTime, then reconnect
30663066
if (PilotDisconnected) {
3067-
#ifdef SMARTEVSE_VERSION //ESP32 v3
3068-
if (PilotDisconnectTime == 0 && pilot == PILOT_SHORT ) { // Pilot should be ~ 0V when disconnected
3069-
#else //CH32
3070-
if (PilotDisconnectTime == 0 && pilot == PILOT_3V ) { // Pilot should be ~ 3V when disconnected TODO is this ok?
3071-
#endif
3067+
if (PilotDisconnectTime == 0) { // Pilot is floating, don't check voltage as it could be anything
30723068
PILOT_CONNECTED;
30733069
PilotDisconnected = false;
30743070
_LOG_A("Pilot Connected\n");

0 commit comments

Comments
 (0)