spicelib/devices/{sw,csw}, #9/, cleanup, rename missleading zero_stateGiven

This commit is contained in:
rlar 2018-03-10 13:50:20 +01:00
parent 1d998d0c42
commit 13bb4cac77
6 changed files with 8 additions and 8 deletions

View File

@ -44,7 +44,7 @@ typedef struct sCSWinstance {
double CSWcond; /* current conductance of switch */
unsigned CSWzero_stateGiven : 1; /* flag to indicate initial state */
unsigned CSWzero_state : 1; /* flag to indicate initial state */
#ifndef NONOISE
double CSWnVar[NSTATVARS];
#else

View File

@ -47,7 +47,7 @@ CSWload(GENmodel *inModel, CKTcircuit *ckt)
if (ckt->CKTmode & (MODEINITFIX | MODEINITJCT)) {
if (here->CSWzero_stateGiven) {
if (here->CSWzero_state) {
/* switch specified "on" */
if (i_ctrl > model->CSWiThreshold + fabs(model->CSWiHysteresis))
current_state = REALLY_ON;

View File

@ -23,11 +23,11 @@ CSWparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
break;
case CSW_IC_ON:
if (value->iValue)
here->CSWzero_stateGiven = TRUE;
here->CSWzero_state = TRUE;
break;
case CSW_IC_OFF:
if (value->iValue)
here->CSWzero_stateGiven = FALSE;
here->CSWzero_state = FALSE;
break;
default:
return E_BADPARM;

View File

@ -43,7 +43,7 @@ typedef struct sSWinstance {
double SWcond; /* conductance of the switch now */
unsigned SWzero_stateGiven : 1; /* flag to indicate initial state */
unsigned SWzero_state : 1; /* flag to indicate initial state */
#ifndef NONOISE
double SWnVar[NSTATVARS];
#else

View File

@ -49,7 +49,7 @@ SWload(GENmodel *inModel, CKTcircuit *ckt)
if (ckt->CKTmode & (MODEINITFIX | MODEINITJCT)) {
if (here->SWzero_stateGiven) {
if (here->SWzero_state) {
/* switch specified "on" */
if (v_ctrl > model->SWvThreshold + fabs(model->SWvHysteresis))
current_state = REALLY_ON;

View File

@ -20,11 +20,11 @@ SWparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
switch (param) {
case SW_IC_ON:
if (value->iValue)
here->SWzero_stateGiven = TRUE;
here->SWzero_state = TRUE;
break;
case SW_IC_OFF:
if (value->iValue)
here->SWzero_stateGiven = FALSE;
here->SWzero_state = FALSE;
break;
default:
return E_BADPARM;