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

Made the timerioTagGetByUsage zero based, as it is not used by users.

This commit is contained in:
blckmn 2018-05-06 09:37:19 +10:00
parent aad6efdf03
commit 88ed243d32
4 changed files with 5 additions and 5 deletions

View file

@ -60,10 +60,10 @@ const timerHardware_t *timerGetByTag(ioTag_t ioTag)
ioTag_t timerioTagGetByUsage(timerUsageFlag_e usageFlag, uint8_t index)
{
uint8_t currentIndex = 1;
uint8_t currentIndex = 0;
for (int i = 0; i < (int)USABLE_TIMER_CHANNEL_COUNT; i++) {
if ((timerHardware[i].usageFlags & usageFlag) == usageFlag) {
if (currentIndex == index || index == 0) {
if (currentIndex == index) {
return timerHardware[i].tag;
}
currentIndex++;