Browse Source

Pswitch: Fix a bug in resistance calculation when cntl_on < cntl_off

Correct setting of parens
pre-master-46
Holger Vogt 5 years ago
parent
commit
c895ca33f7
  1. 2
      src/xspice/icm/xtradev/pswitch/cfunc.mod

2
src/xspice/icm/xtradev/pswitch/cfunc.mod

@ -239,7 +239,7 @@ void cm_pswitch(ARGS) /* structure holding parms,
if(r<r_on) r=r_on;/* minimum resistance limiter */
}
} else {
inmean = (PARAM(cntl_on) - (INPUT(cntl_in)) / (PARAM(cntl_off) - PARAM(cntl_on))) - cntl_mean;
inmean = ((PARAM(cntl_on) - INPUT(cntl_in)) / (PARAM(cntl_off) - PARAM(cntl_on))) - cntl_mean;
if (INPUT(cntl_in) < cntl_on) {
r = r_on;
outOfLimit = 1;

Loading…
Cancel
Save