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

Fixed 'timer show' for bitbanged Dshot timers.

This commit is contained in:
Michael Keller 2021-09-13 13:05:01 +12:00
parent a2bbd31c9c
commit 60b1e99826
3 changed files with 22 additions and 10 deletions

View file

@ -238,6 +238,18 @@ static bbPort_t *bbAllocMotorPort(int portIndex)
return bbPort;
}
const timerHardware_t *dshotBitbangTimerGetAllocatedByNumberAndChannel(int8_t timerNumber, uint16_t timerChannel)
{
for (int index = 0; index < usedMotorPorts; index++) {
const timerHardware_t *bitbangTimer = bbPorts[index].timhw;
if (bitbangTimer && timerGetTIMNumber(bitbangTimer->tim) == timerNumber && bitbangTimer->channel == timerChannel && bbPorts[index].owner.owner) {
return bitbangTimer;
}
}
return NULL;
}
const resourceOwner_t *dshotBitbangTimerGetOwner(const timerHardware_t *timer)
{
for (int index = 0; index < usedMotorPorts; index++) {
@ -280,7 +292,7 @@ static void bbAllocDma(bbPort_t *bbPort)
#endif
dmaIdentifier_e dmaIdentifier = dmaGetIdentifier(bbPort->dmaResource);
dmaInit(dmaIdentifier, OWNER_DSHOT_BITBANG, bbPort->owner.resourceIndex);
dmaInit(dmaIdentifier, bbPort->owner.owner, bbPort->owner.resourceIndex);
bbPort->dmaSource = timerDmaSource(timhw->channel);
bbPacer_t *bbPacer = bbFindMotorPacer(timhw->tim);