mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +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:
commit
1298d3d4c9
2 changed files with 9 additions and 1 deletions
|
@ -140,6 +140,13 @@ static void motorDisableNull(void)
|
|||
{
|
||||
}
|
||||
|
||||
static bool motorIsEnabledNull(uint8_t index)
|
||||
{
|
||||
UNUSED(index);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool motorUpdateStartNull(void)
|
||||
{
|
||||
return true;
|
||||
|
@ -181,6 +188,7 @@ static const motorVTable_t motorNullVTable = {
|
|||
.postInit = motorPostInitNull,
|
||||
.enable = motorEnableNull,
|
||||
.disable = motorDisableNull,
|
||||
.isMotorEnabled = motorIsEnabledNull,
|
||||
.updateStart = motorUpdateStartNull,
|
||||
.write = motorWriteNull,
|
||||
.writeInt = motorWriteIntNull,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue