mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Added check on motor being enabled in MSP output to ensure only motors enabled are shown in configurator
This commit is contained in:
parent
d5e20232be
commit
8015120866
1 changed files with 6 additions and 2 deletions
|
@ -649,10 +649,14 @@ static bool mspFcProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProcessFn
|
||||||
#endif
|
#endif
|
||||||
case MSP_MOTOR:
|
case MSP_MOTOR:
|
||||||
for (unsigned i = 0; i < 8; i++) {
|
for (unsigned i = 0; i < 8; i++) {
|
||||||
|
if (i >= MAX_SUPPORTED_MOTORS || !pwmGetMotors()[i].enabled) {
|
||||||
|
sbufWriteU16(dst, 0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (masterConfig.motorConfig.motorPwmProtocol == PWM_TYPE_DSHOT150 || masterConfig.motorConfig.motorPwmProtocol == PWM_TYPE_DSHOT600)
|
if (masterConfig.motorConfig.motorPwmProtocol == PWM_TYPE_DSHOT150 || masterConfig.motorConfig.motorPwmProtocol == PWM_TYPE_DSHOT600)
|
||||||
sbufWriteU16(dst, i < MAX_SUPPORTED_MOTORS ? constrain((motor[i] / 2) + 1000, 1000, 2000) : 0); // This is to get it working in the configurator
|
sbufWriteU16(dst, constrain((motor[i] / 2) + 1000, 1000, 2000)); // This is to get it working in the configurator
|
||||||
else
|
else
|
||||||
sbufWriteU16(dst, i < MAX_SUPPORTED_MOTORS ? motor[i] : 0);
|
sbufWriteU16(dst, motor[i]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MSP_RC:
|
case MSP_RC:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue