1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

Merge pull request #8825 from jflyper/bfdev-fix-MOTOR_MSP-hard-fault-with-no-motors

Provide isMotorEnabled function for motorNullDevice
This commit is contained in:
Michael Keller 2019-09-06 19:47:48 +12:00 committed by GitHub
commit 1298d3d4c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -991,7 +991,7 @@ static bool mspProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst)
case MSP_MOTOR:
for (unsigned i = 0; i < 8; i++) {
#ifdef USE_MOTOR
if (i >= MAX_SUPPORTED_MOTORS || !motorIsMotorEnabled(i)) {
if (!motorIsEnabled() || i >= MAX_SUPPORTED_MOTORS || !motorIsMotorEnabled(i)) {
sbufWriteU16(dst, 0);
continue;
}