diff --git a/src/spicelib/devices/csw/cswload.c b/src/spicelib/devices/csw/cswload.c index c63594ff1..5de4e4250 100644 --- a/src/spicelib/devices/csw/cswload.c +++ b/src/spicelib/devices/csw/cswload.c @@ -69,9 +69,9 @@ CSWload(GENmodel *inModel, CKTcircuit *ckt) /* if previous state was in hysteresis, then don't change the state.. */ if (previous_state == HYST_OFF || previous_state == HYST_ON) current_state = previous_state; - else if (previous_state == REALLY_ON) - current_state = HYST_OFF; else if (previous_state == REALLY_OFF) + current_state = HYST_OFF; + else if (previous_state == REALLY_ON) current_state = HYST_ON; else internalerror("bad value for previous region in swload"); @@ -99,9 +99,9 @@ CSWload(GENmodel *inModel, CKTcircuit *ckt) if (previous_state == HYST_OFF || previous_state == HYST_ON) current_state = previous_state; else if (previous_state == REALLY_ON) - current_state = HYST_OFF; - else if (previous_state == REALLY_OFF) current_state = HYST_ON; + else if (previous_state == REALLY_OFF) + current_state = HYST_OFF; else internalerror("bad value for previous region in cswload"); } diff --git a/src/spicelib/devices/sw/swload.c b/src/spicelib/devices/sw/swload.c index 0ac3e87b7..35df5a13b 100644 --- a/src/spicelib/devices/sw/swload.c +++ b/src/spicelib/devices/sw/swload.c @@ -74,9 +74,9 @@ SWload(GENmodel *inModel, CKTcircuit *ckt) if (previous_state == HYST_OFF || previous_state == HYST_ON) current_state = previous_state; else if (previous_state == REALLY_ON) - current_state = HYST_OFF; - else if (previous_state == REALLY_OFF) current_state = HYST_ON; + else if (previous_state == REALLY_OFF) + current_state = HYST_OFF; else internalerror("bad value for previous state in swload"); } @@ -99,9 +99,9 @@ SWload(GENmodel *inModel, CKTcircuit *ckt) if (previous_state == HYST_ON || previous_state == HYST_OFF) current_state = previous_state; else if (previous_state == REALLY_ON) - current_state = REALLY_OFF; + current_state = HYST_ON; else if (previous_state == REALLY_OFF) - current_state = REALLY_ON; + current_state = HYST_OFF; } }