mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 08:45:36 +03:00
Fixed problems with bitbanged Dshot and lazily allocated timers. (#8861)
Fixed problems with bitbanged Dshot and lazily allocated timers.
This commit is contained in:
commit
2a18209492
6 changed files with 32 additions and 2 deletions
|
@ -311,6 +311,10 @@ static void bbFindPacerTimer(void)
|
|||
for (unsigned timerIndex = 0; timerIndex < ARRAYLEN(bbTimerHardware); timerIndex++) {
|
||||
timer = &bbTimerHardware[timerIndex];
|
||||
int timNumber = timerGetTIMNumber(timer->tim);
|
||||
if ((motorConfig()->dev.useDshotBitbangedTimer == DSHOT_BITBANGED_TIMER_TIM1 && timNumber != 1)
|
||||
|| (motorConfig()->dev.useDshotBitbangedTimer == DSHOT_BITBANGED_TIMER_TIM8 && timNumber != 8)) {
|
||||
continue;
|
||||
}
|
||||
bool timerConflict = false;
|
||||
for (int channel = 0; channel < CC_CHANNELS_PER_TIMER; channel++) {
|
||||
const resourceOwner_e timerOwner = timerGetOwner(timNumber, CC_CHANNEL_FROM_INDEX(channel))->owner;
|
||||
|
@ -334,6 +338,7 @@ static void bbFindPacerTimer(void)
|
|||
if (dmaGetOwner(dmaIdentifier)->owner == OWNER_FREE &&
|
||||
!usedTimerChannels[timNumber][timer->channel]) {
|
||||
usedTimerChannels[timNumber][timer->channel] = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue