Skip to content

Commit

Permalink
substitute in equivalent but cleaner logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Patronics committed Oct 16, 2024
1 parent 5212985 commit 3607552
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/js/tabs/motors.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ motors.initialize = async function (callback) {
MSP.promise(MSPCodes.MSP_MOTOR).then(() => {
const mixer = FC.MIXER_CONFIG.mixer;
const motorCount = mixerList[mixer - 1].motors;
// initialize for models with zero motors
self.numberOfValidOutputs = motorCount;
// initialize with firmware supplied motor_count
self.numberOfValidOutputs = FC.MOTOR_CONFIG.motor_count;

for (let i = 0; i < FC.MOTOR_DATA.length; i++) {
if (FC.MOTOR_DATA[i] === 0) {
Expand All @@ -407,8 +407,6 @@ motors.initialize = async function (callback) {
return;
}
}
// if every item in the motor array (current size limit: 8) is populated, we have that many motors
self.numberOfValidOutputs = FC.MOTOR_DATA.length;
});
}

Expand Down

0 comments on commit 3607552

Please sign in to comment.