mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Added indication for N-channel timers to 'resource show all'.
This commit is contained in:
parent
864cf3f3b4
commit
9eda7b4735
5 changed files with 29 additions and 14 deletions
|
@ -245,11 +245,11 @@ static bbPort_t *bbAllocMotorPort(int portIndex)
|
|||
return bbPort;
|
||||
}
|
||||
|
||||
const resourceOwner_t *dshotBitbangTimerGetOwner(int8_t timerNumber, uint16_t timerChannel)
|
||||
const resourceOwner_t *dshotBitbangTimerGetOwner(const timerHardware_t *timer)
|
||||
{
|
||||
for (int index = 0; index < usedMotorPorts; index++) {
|
||||
const timerHardware_t *timer = bbPorts[index].timhw;
|
||||
if (timerGetTIMNumber(timer->tim) == timerNumber && timer->channel == timerChannel) {
|
||||
const timerHardware_t *bitbangTimer = bbPorts[index].timhw;
|
||||
if (bitbangTimer && bitbangTimer == timer) {
|
||||
return &bbPorts[index].owner;
|
||||
}
|
||||
}
|
||||
|
@ -351,7 +351,8 @@ static void bbFindPacerTimer(void)
|
|||
}
|
||||
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;
|
||||
const timerHardware_t *timer = timerGetAllocatedByNumberAndChannel(timNumber, CC_CHANNEL_FROM_INDEX(channel));
|
||||
const resourceOwner_e timerOwner = timerGetOwner(timer)->owner;
|
||||
if (timerOwner != OWNER_FREE && timerOwner != OWNER_DSHOT_BITBANG) {
|
||||
timerConflict = true;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue