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

Correct setting of parens
This commit is contained in:
Holger Vogt 2021-10-06 23:52:37 +02:00
parent 37ef831bc9
commit c895ca33f7
1 changed files with 1 additions and 1 deletions

View File

@ -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;