File tree Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ <h2> 2.5.8 - DShot Logging and Minor Bug Fixes</h2>
57
57
< li > Add OSD and ESC features options to header dialog.</ li >
58
58
< li > Add new BF3.1.0 parameters to header dialog.</ li >
59
59
< li > Add user setting to show raw values on legend.</ li >
60
+ < li > Correct VBAT scaling for BF3.1.0.</ li >
60
61
</ ul >
61
62
62
63
< h2 > 2.5.7 - Minor Bug Fixes and Feature Improvements</ h2 >
Original file line number Diff line number Diff line change @@ -252,9 +252,15 @@ function FlightLog(logData) {
252
252
i ,
253
253
fieldNames = that . getMainFieldNames ( ) ,
254
254
sysConfig = that . getSysConfig ( ) ,
255
- refVoltage = that . vbatADCToMillivolts ( sysConfig . vbatref ) / 100 ,
256
255
found = false ;
257
256
257
+ var refVoltage ;
258
+ if ( sysConfig . firmwareType == FIRMWARE_TYPE_BETAFLIGHT && semver . gte ( sysConfig . firmwareVersion , '3.1.0' ) ) {
259
+ refVoltage = sysConfig . vbatref ;
260
+ } else {
261
+ refVoltage = that . vbatADCToMillivolts ( sysConfig . vbatref ) / 100 ;
262
+ }
263
+
258
264
//Are we even logging VBAT?
259
265
if ( ! fieldNameToIndex . vbatLatest ) {
260
266
numCells = false ;
@@ -1092,7 +1098,12 @@ FlightLog.prototype.getPIDPercentage = function(value) {
1092
1098
1093
1099
1094
1100
FlightLog . prototype . getReferenceVoltageMillivolts = function ( ) {
1095
- return this . vbatADCToMillivolts ( this . getSysConfig ( ) . vbatref ) ;
1101
+ if ( this . getSysConfig ( ) . firmwareType == FIRMWARE_TYPE_BETAFLIGHT && semver . gte ( this . getSysConfig ( ) . firmwareVersion , '3.1.0' ) ) {
1102
+ return this . getSysConfig ( ) . vbatref * 100 ;
1103
+ } else {
1104
+ return this . vbatADCToMillivolts ( this . getSysConfig ( ) . vbatref ) ;
1105
+ }
1106
+
1096
1107
} ;
1097
1108
1098
1109
FlightLog . prototype . vbatADCToMillivolts = function ( vbatADC ) {
Original file line number Diff line number Diff line change @@ -314,11 +314,19 @@ function FlightLogFieldPresenter() {
314
314
return flightLog . accRawToGs ( value ) . toFixed ( 2 ) + "g" ;
315
315
316
316
case 'vbatLatest' :
317
- return ( flightLog . vbatADCToMillivolts ( value ) / 1000 ) . toFixed ( 2 ) + "V" + ", " + ( flightLog . vbatADCToMillivolts ( value ) / 1000 / flightLog . getNumCellsEstimate ( ) ) . toFixed ( 2 ) + "V/cell" ;
318
-
317
+ if ( flightLog . getSysConfig ( ) . firmwareType == FIRMWARE_TYPE_BETAFLIGHT && semver . gte ( flightLog . getSysConfig ( ) . firmwareVersion , '3.1.0' ) ) {
318
+ return ( value / 10 ) . toFixed ( 2 ) + "V" + ", " + ( value / 10 / flightLog . getNumCellsEstimate ( ) ) . toFixed ( 2 ) + "V/cell" ;
319
+ } else {
320
+ return ( flightLog . vbatADCToMillivolts ( value ) / 1000 ) . toFixed ( 2 ) + "V" + ", " + ( flightLog . vbatADCToMillivolts ( value ) / 1000 / flightLog . getNumCellsEstimate ( ) ) . toFixed ( 2 ) + "V/cell" ;
321
+ }
322
+
319
323
case 'amperageLatest' :
320
- return ( flightLog . amperageADCToMillivolts ( value ) / 1000 ) . toFixed ( 2 ) + "A" + ", " + ( flightLog . amperageADCToMillivolts ( value ) / 1000 / flightLog . getNumMotors ( ) ) . toFixed ( 2 ) + "A/motor" ;
321
-
324
+ if ( flightLog . getSysConfig ( ) . firmwareType == FIRMWARE_TYPE_BETAFLIGHT && semver . gte ( flightLog . getSysConfig ( ) . firmwareVersion , '3.1.0' ) ) {
325
+ return ( value / 10 ) . toFixed ( 2 ) + "A" + ", " + ( value / 10 / flightLog . getNumMotors ( ) ) . toFixed ( 2 ) + "A/motor" ;
326
+ } else {
327
+ return ( flightLog . amperageADCToMillivolts ( value ) / 1000 ) . toFixed ( 2 ) + "A" + ", " + ( flightLog . amperageADCToMillivolts ( value ) / 1000 / flightLog . getNumMotors ( ) ) . toFixed ( 2 ) + "A/motor" ;
328
+ }
329
+
322
330
case 'heading[0]' :
323
331
case 'heading[1]' :
324
332
case 'heading[2]' :
You can’t perform that action at this time.
0 commit comments