From 89c4c16829bceedb31f66308f26accc8cfc980ed Mon Sep 17 00:00:00 2001 From: h_vogt Date: Mon, 22 Apr 2013 22:44:58 +0200 Subject: [PATCH] swload.c: reinstate the truncation code from swtrunc.c which was removed in the following commit: commit 0dae4607a01e2bbf93a925f5c37385ad9ce232f2 Date: Wed Apr 25 18:28:20 2001 +0000 Added a patch to csw and sw from Jon Engelbert dealing with negative histeresys --- src/spicelib/devices/sw/swload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/spicelib/devices/sw/swload.c b/src/spicelib/devices/sw/swload.c index 178cd8f98..72e16267f 100644 --- a/src/spicelib/devices/sw/swload.c +++ b/src/spicelib/devices/sw/swload.c @@ -138,6 +138,7 @@ SWload(GENmodel *inModel, CKTcircuit *ckt) // After analyzing the transient code, it seems that this is not a problem because state updating // occurs before the convergence loop in transient processing. *(ckt->CKTstates[0] + here->SWstate) = current_state; + *(ckt->CKTstates[0] + here->SWstate + 1) = v_ctrl; if ((current_state == REALLY_ON) || (current_state == HYST_ON)) g_now = model->SWonConduct;