Skip to content

Commit

Permalink
Correctly generate list of flight modes
Browse files Browse the repository at this point in the history
  • Loading branch information
DzikuVx committed May 12, 2024
1 parent 8fca352 commit 3244df1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions js/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var FC = {
RC: null,
RC_tuning: null,
AUX_CONFIG: [],
AUX_CONFIG_IDS: null,
AUX_CONFIG_IDS: [],
MODE_RANGES: null,
ADJUSTMENT_RANGES: null,
SERVO_CONFIG: null,
Expand Down Expand Up @@ -202,10 +202,11 @@ var FC = {

this.generateAuxConfig = function () {
console.log('Generating AUX_CONFIG');

for ( let i = 0; i < FLIGHT_MODES.length; i++ ) {
if (this.AUX_CONFIG_IDS.indexOf(FLIGHT_MODES[i].permanentId) > -1) {
this.AUX_CONFIG.push(FLIGHT_MODES[i].boxName);
this.AUX_CONFIG = [];
for ( let i = 0; i < this.AUX_CONFIG_IDS.length; i++ ) {
let found = FLIGHT_MODES.find( mode => mode.permanentId === this.AUX_CONFIG_IDS[i] );
if (found) {
this.AUX_CONFIG.push(found.boxName);
}
}
};
Expand Down

0 comments on commit 3244df1

Please sign in to comment.