1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 19:10:32 +03:00

fix: missing sitl motor count (#14319)

- other platforms set it, sitl does not and configurator complains
This commit is contained in:
AJ 2025-03-26 22:25:24 +01:00 committed by GitHub
parent ad58b69c20
commit 06844745f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -644,14 +644,16 @@ bool motorPwmDevInit(motorDevice_t *device, const motorDevConfig_t *motorConfig,
if (!device) {
return false;
}
pwmMotorCount = device->count;
device->vTable = &vTable;
const uint8_t motorCount = device->count;
printf("Initialized motor count %d\n", motorCount);
pwmRawPkt.motorCount = motorCount;
printf("Initialized motor count %d\n", pwmMotorCount);
pwmRawPkt.motorCount = pwmMotorCount;
idlePulse = _idlePulse;
for (int motorIndex = 0; motorIndex < MAX_SUPPORTED_MOTORS && motorIndex < motorCount; motorIndex++) {
for (int motorIndex = 0; motorIndex < MAX_SUPPORTED_MOTORS && motorIndex < pwmMotorCount; motorIndex++) {
pwmMotors[motorIndex].enabled = true;
}