Skip to content

Commit 0684474

Browse files
authored
fix: missing sitl motor count (betaflight#14319)
- other platforms set it, sitl does not and configurator complains
1 parent ad58b69 commit 0684474

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/platform/SIMULATOR/sitl.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -644,14 +644,16 @@ bool motorPwmDevInit(motorDevice_t *device, const motorDevConfig_t *motorConfig,
644644
if (!device) {
645645
return false;
646646
}
647+
648+
pwmMotorCount = device->count;
647649
device->vTable = &vTable;
648-
const uint8_t motorCount = device->count;
649-
printf("Initialized motor count %d\n", motorCount);
650-
pwmRawPkt.motorCount = motorCount;
650+
651+
printf("Initialized motor count %d\n", pwmMotorCount);
652+
pwmRawPkt.motorCount = pwmMotorCount;
651653

652654
idlePulse = _idlePulse;
653655

654-
for (int motorIndex = 0; motorIndex < MAX_SUPPORTED_MOTORS && motorIndex < motorCount; motorIndex++) {
656+
for (int motorIndex = 0; motorIndex < MAX_SUPPORTED_MOTORS && motorIndex < pwmMotorCount; motorIndex++) {
655657
pwmMotors[motorIndex].enabled = true;
656658
}
657659

0 commit comments

Comments
 (0)