Skip to content

Commit a05bea3

Browse files
authored
Merge pull request #83 from martinbudden/bb_debug_names
Added GYRO_RAW to debug names and checked array bounds
2 parents 3c989fe + 64f5c91 commit a05bea3

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

js/flightlog_fielddefs.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ var
153153
FILTER_TYPE = makeReadOnly([
154154
"PT1",
155155
"BIQUAD",
156+
"FIR",
156157
]),
157158

158159
DEBUG_MODE = makeReadOnly([
@@ -177,7 +178,9 @@ var
177178
"DEBUG_ALTITUDE",
178179
"DEBUG_FFT",
179180
"DEBUG_FFT_TIME",
180-
"DEBUG_FFT_FREQ"
181+
"DEBUG_FFT_FREQ",
182+
"DEBUG_FRSKY_D_RX",
183+
"DEBUG_GYRO_RAW"
181184
]),
182185

183186
SUPER_EXPO_YAW = makeReadOnly([

js/flightlog_fields_presenter.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,23 @@ function FlightLogFieldPresenter() {
236236
'debug[1]':'center_freq[pitch]',
237237
'debug[2]':'center_freq[yaw]',
238238
'debug[3]':'Not used',
239-
}
240-
};
239+
},
240+
'DEBUG_FRSKY_D_RX' : {
241+
'debug[all]':'Debug FRSKY_D_RX',
242+
'debug[0]':'debug[0]',
243+
'debug[1]':'debug[1]',
244+
'debug[2]':'debug[2]',
245+
'debug[3]':'debug[3]',
246+
247+
},
248+
'DEBUG_GYRO_RAW' : {
249+
'debug[all]':'Debug Gyro Raw',
250+
'debug[0]':'gyro_raw[X]',
251+
'debug[1]':'gyro_raw[Y]',
252+
'debug[2]':'gyro_raw[Z]',
253+
'debug[3]':'Not Used',
254+
},
255+
};
241256

242257
function presentFlags(flags, flagNames) {
243258
var
@@ -481,7 +496,7 @@ function FlightLogFieldPresenter() {
481496
FlightLogFieldPresenter.fieldNameToFriendly = function(fieldName, debugMode) {
482497
if(debugMode) {
483498
if(fieldName.includes('debug')) {
484-
var debugFields = DEBUG_FRIENDLY_FIELD_NAMES[DEBUG_MODE[debugMode]];
499+
var debugFields = DEBUG_FRIENDLY_FIELD_NAMES[debugMode < DEBUG_MODE.length ? DEBUG_MODE[debugMode] : DEBUG_MODE[0]];
485500
return debugFields[fieldName];
486501
}
487502
}

0 commit comments

Comments
 (0)