From 3fd1d175bd6a1cf79088ec5bac2c889560efe22c Mon Sep 17 00:00:00 2001 From: Patrick Leiser Date: Thu, 17 Oct 2024 01:32:58 -0700 Subject: [PATCH] Fix handling of custom configuration with 8 motors, enabling motor testing on octocopters (#4213) * Fix handling of custom configuration with 8 motors Resolves issue #4212 * minor optimization since same check is done in for loop above * Formatting tweak for comment Co-authored-by: Mark Haslinghuis * substitute in equivalent but cleaner logic --------- Co-authored-by: Mark Haslinghuis --- src/js/tabs/motors.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/tabs/motors.js b/src/js/tabs/motors.js index 1ebb1fa466c..bee9d3a8908 100644 --- a/src/js/tabs/motors.js +++ b/src/js/tabs/motors.js @@ -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) {