1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

To enable display of pin mapping for config.h (#12363)

This commit is contained in:
J Blackman 2023-02-16 17:28:27 +11:00 committed by GitHub
parent 44abae2965
commit 17c7816a52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 2 deletions

View file

@ -5850,6 +5850,28 @@ static void alternateFunctionToString(const ioTag_t ioTag, const int index, char
}
}
#ifdef USE_TIMER_MAP_PRINT
static void showTimerMap(void)
{
cliPrintLinefeed();
cliPrintLine("Timer Mapping:");
for (unsigned int i = 0; i < MAX_TIMER_PINMAP_COUNT; i++) {
const ioTag_t ioTag = timerIOConfig(i)->ioTag;
if (!ioTag) {
continue;
}
cliPrintLinef(" TIMER_PIN_MAP(%d, P%c%d, %d, %d)",
i,
IO_GPIOPortIdxByTag(ioTag) + 'A', IO_GPIOPinIdxByTag(ioTag),
timerIOConfig(i)->index,
timerIOConfig(i)->dmaopt
);
}
}
#endif
static void showTimers(void)
{
cliPrintLinefeed();
@ -5901,6 +5923,12 @@ static void cliTimer(const char *cmdName, char *cmdline)
cliPrintErrorLinef(cmdName, "NOT IMPLEMENTED YET");
return;
#ifdef USE_TIMER_MAP_PRINT
} else if (strncasecmp(cmdline, "map", len) == 0) {
showTimerMap();
return;
#endif
} else if (strncasecmp(cmdline, "show", len) == 0) {
showTimers();