Skip to content

Commit

Permalink
Header: fix voltage scale (#714)
Browse files Browse the repository at this point in the history
* Header: fix voltage scale

- fix Header voltage scale for 4.0.0 and later
- resolves: #679

* Update js/header_dialog.js

Co-authored-by: Mark Haslinghuis <[email protected]>

---------

Co-authored-by: Mark Haslinghuis <[email protected]>
  • Loading branch information
nerdCopter and haslinghuis authored Mar 5, 2024
1 parent 12dfd2b commit 7113208
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions js/header_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,15 @@ function HeaderDialog(dialog, onSave) {
setParameter('rcYawExpo' ,sysConfig.rc_expo[2],2);
setParameter('vbatscale' ,sysConfig.vbatscale,0);
setParameter('vbatref' ,sysConfig.vbatref,0);
setParameter('vbatmincellvoltage' ,sysConfig.vbatmincellvoltage,1);
setParameter('vbatmaxcellvoltage' ,sysConfig.vbatmaxcellvoltage,1);
setParameter('vbatwarningcellvoltage' ,sysConfig.vbatwarningcellvoltage,1);
if (activeSysConfig.firmwareType === FIRMWARE_TYPE_BETAFLIGHT && semver.gte(activeSysConfig.firmwareVersion, '4.0.0')) {
setParameter('vbatmincellvoltage' ,sysConfig.vbatmincellvoltage,2);
setParameter('vbatmaxcellvoltage' ,sysConfig.vbatmaxcellvoltage,2);
setParameter('vbatwarningcellvoltage' ,sysConfig.vbatwarningcellvoltage,2);
} else {
setParameter('vbatmincellvoltage' ,sysConfig.vbatmincellvoltage,1);
setParameter('vbatmaxcellvoltage' ,sysConfig.vbatmaxcellvoltage,1);
setParameter('vbatwarningcellvoltage' ,sysConfig.vbatwarningcellvoltage,1);
}
setParameter('minthrottle' ,sysConfig.minthrottle,0);
setParameter('maxthrottle' ,sysConfig.maxthrottle,0);
setParameter('currentMeterOffset' ,sysConfig.currentMeterOffset,0);
Expand Down

0 comments on commit 7113208

Please sign in to comment.