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

FIX: Serial ESC communication when using digital protocols (#14214)

* FIX: Serial ESC communication when using digital protocols

* Fix error following rebase, and amending based on comments from @ledvinap
This commit is contained in:
Jay Blackman 2025-01-30 00:49:11 +11:00 committed by GitHub
parent b277364b2c
commit cd84e10fa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 100 additions and 62 deletions

View file

@ -126,6 +126,14 @@ static bool dshotPwmIsMotorEnabled(unsigned index)
return motors[index].enabled;
}
static IO_t pwmDshotGetMotorIO(unsigned index)
{
if (index >= dshotMotorCount) {
return IO_NONE;
}
return motors[index].io;
}
static FAST_CODE void dshotWriteInt(uint8_t index, uint16_t value)
{
pwmWriteDshotInt(index, value);
@ -150,6 +158,7 @@ static const motorVTable_t dshotPwmVTable = {
.shutdown = dshotPwmShutdown,
.requestTelemetry = pwmDshotRequestTelemetry,
.isMotorIdle = pwmDshotIsMotorIdle,
.getMotorIO = pwmDshotGetMotorIO,
};
bool dshotPwmDevInit(motorDevice_t *device, const motorDevConfig_t *motorConfig)