mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
Merge pull request #10863 from mikeller/add_n_channel_to_timer_show
This commit is contained in:
commit
8a18651319
6 changed files with 45 additions and 33 deletions
|
@ -1588,7 +1588,7 @@ static void cliSerialPassthrough(const char *cmdName, char *cmdline)
|
|||
for (unsigned i = 0; i < getMotorCount(); i++) {
|
||||
const ioTag_t tag = motorConfig()->dev.ioTags[i];
|
||||
if (tag) {
|
||||
const timerHardware_t *timerHardware = timerGetByTag(tag);
|
||||
const timerHardware_t *timerHardware = timerGetConfiguredByTag(tag);
|
||||
if (timerHardware) {
|
||||
IO_t io = IOGetByTag(tag);
|
||||
IOInit(io, OWNER_MOTOR, 0);
|
||||
|
@ -5645,7 +5645,7 @@ static void cliDmaopt(const char *cmdName, char *cmdline)
|
|||
#if defined(USE_TIMER_MGMT)
|
||||
timerIoConfig = timerIoConfigByTag(ioTag);
|
||||
#endif
|
||||
timer = timerGetByTag(ioTag);
|
||||
timer = timerGetConfiguredByTag(ioTag);
|
||||
}
|
||||
|
||||
// opt or list
|
||||
|
@ -5863,7 +5863,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;
|
||||
|
@ -5872,9 +5873,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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue