@@ -7,6 +7,8 @@ import MSP from "../msp";
7
7
import MSPCodes from "../msp/MSPCodes" ;
8
8
import serial from "../serial" ;
9
9
import * as d3 from 'd3' ;
10
+ import semver from 'semver' ;
11
+ import { API_VERSION_1_46 } from "../data_storage" ;
10
12
11
13
const sensors = { } ;
12
14
sensors . initialize = function ( callback ) {
@@ -15,6 +17,8 @@ sensors.initialize = function (callback) {
15
17
GUI . active_tab = 'sensors' ;
16
18
}
17
19
20
+ sensors . debugColumns = semver ( FC . CONFIG . apiVersion , API_VERSION_1_46 ) ? 8 : 4 ;
21
+
18
22
function initSensorData ( ) {
19
23
for ( let i = 0 ; i < 3 ; i ++ ) {
20
24
FC . SENSOR_DATA . accelerometer [ i ] = 0 ;
@@ -24,8 +28,7 @@ sensors.initialize = function (callback) {
24
28
FC . SENSOR_DATA . altitude = 0 ;
25
29
}
26
30
27
- // we now have 8 debug values
28
- for ( let i = 0 ; i < 8 ; i ++ ) {
31
+ for ( let i = 0 ; i < sensors . debugColumns ; i ++ ) {
29
32
FC . SENSOR_DATA . debug [ i ] = 0 ;
30
33
}
31
34
}
@@ -433,7 +436,7 @@ sensors.initialize = function (callback) {
433
436
}
434
437
435
438
function update_debug_graphs ( ) {
436
- for ( let i = 0 ; i < 8 ; i ++ ) {
439
+ for ( let i = 0 ; i < sensors . debugColumns ; i ++ ) {
437
440
updateGraphHelperSize ( debugHelpers [ i ] ) ;
438
441
439
442
// enable/disable graphs based on debug values
0 commit comments