1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

Added indication for N-channel timers to 'resource show all'.

This commit is contained in:
Michael Keller 2021-07-27 18:16:22 +12:00
parent 864cf3f3b4
commit 9eda7b4735
5 changed files with 29 additions and 14 deletions

View file

@ -5864,7 +5864,8 @@ static void showTimers(void)
cliPrintf("TIM%d:", timerNumber);
bool timerUsed = false;
for (unsigned timerIndex = 0; timerIndex < CC_CHANNELS_PER_TIMER; timerIndex++) {
const resourceOwner_t *timerOwner = timerGetOwner(timerNumber, CC_CHANNEL_FROM_INDEX(timerIndex));
const timerHardware_t *timer = timerGetAllocatedByNumberAndChannel(timerNumber, CC_CHANNEL_FROM_INDEX(timerIndex));
const resourceOwner_t *timerOwner = timerGetOwner(timer);
if (timerOwner->owner) {
if (!timerUsed) {
timerUsed = true;
@ -5873,9 +5874,9 @@ static void showTimers(void)
}
if (timerOwner->resourceIndex > 0) {
cliPrintLinef(" CH%d: %s %d", timerIndex + 1, ownerNames[timerOwner->owner], timerOwner->resourceIndex);
cliPrintLinef(" CH%d%s: %s %d", timerIndex + 1, timer->output & TIMER_OUTPUT_N_CHANNEL ? "N" : " ", ownerNames[timerOwner->owner], timerOwner->resourceIndex);
} else {
cliPrintLinef(" CH%d: %s", timerIndex + 1, ownerNames[timerOwner->owner]);
cliPrintLinef(" CH%d%s: %s", timerIndex + 1, timer->output & TIMER_OUTPUT_N_CHANNEL ? "N" : " ", ownerNames[timerOwner->owner]);
}
}
}