Skip to content

Commit

Permalink
chore: motor count
Browse files Browse the repository at this point in the history
  • Loading branch information
chmelevskij committed Dec 19, 2021
1 parent 748e28b commit b1abc77
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/tabs/motors.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,17 @@ motors.initialize = function (callback) {
function validateMixerOutputs() {
MSP.promise(MSPCodes.MSP_MOTOR).then(() => {
const mixer = FC.MIXER_CONFIG.mixer;
const motors = mixerList[mixer - 1].motors;
const motorCount = mixerList[mixer - 1].motors;
// initialize for models with zero motors
self.numberOfValidOutputs = motors;
self.numberOfValidOutputs = motorCount;

for (let i = 0; i < FC.MOTOR_DATA.length; i++) {
if (FC.MOTOR_DATA[i] === 0) {
self.numberOfValidOutputs = i;
if (motors > self.numberOfValidOutputs && motors > 0) {
if (motorCount > self.numberOfValidOutputs && motorCount > 0) {
const msg = i18n.getMessage('motorsDialogMixerReset', {
mixerName: mixerList[mixer - 1].name,
mixerMotors: motors,
mixerMotors: motorCount,
outputs: self.numberOfValidOutputs,
});
showDialogMixerReset(msg);
Expand Down

0 comments on commit b1abc77

Please sign in to comment.