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:
parent
a2bbd31c9c
commit
60b1e99826
3 changed files with 22 additions and 10 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue