1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 20:10:18 +03:00

Merge pull request #9484 from mikeller/remove_legacy_timer_index

Removed legacy timer index notation from CLI.
This commit is contained in:
Michael Keller 2020-02-17 08:11:03 +13:00 committed by GitHub
commit 82ed38a5dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5752,16 +5752,10 @@ static void cliTimer(char *cmdline)
return; return;
} }
} else if (strcasecmp(pch, "none") != 0) { } else if (strcasecmp(pch, "none") != 0) {
timerIndex = atoi(pch);
const timerHardware_t *timer = timerGetByTagAndIndex(ioTag, timerIndex + 1);
if (!timer) {
cliPrintErrorLinef("INVALID TIMER OPTION FOR %c%02d: '%s'", IO_GPIOPortIdxByTag(ioTag) + 'A', IO_GPIOPinIdxByTag(ioTag), pch); cliPrintErrorLinef("INVALID TIMER OPTION FOR %c%02d: '%s'", IO_GPIOPortIdxByTag(ioTag) + 'A', IO_GPIOPinIdxByTag(ioTag), pch);
return; return;
} }
}
int oldTimerIndex = isExistingTimerOpt ? timerIOConfig(timerIOIndex)->index - 1 : -1; int oldTimerIndex = isExistingTimerOpt ? timerIOConfig(timerIOIndex)->index - 1 : -1;
timerIOConfigMutable(timerIOIndex)->ioTag = timerIndex == TIMER_INDEX_UNDEFINED ? IO_TAG_NONE : ioTag; timerIOConfigMutable(timerIOIndex)->ioTag = timerIndex == TIMER_INDEX_UNDEFINED ? IO_TAG_NONE : ioTag;