1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Initial IO remapping capability

This commit is contained in:
blckmn 2016-10-03 17:52:08 +11:00 committed by blckmn
parent 5f47fc311b
commit 46a6e560f1
28 changed files with 506 additions and 382 deletions

View file

@ -784,3 +784,18 @@ void timerForceOverflow(TIM_TypeDef *tim)
tim->EGR |= TIM_EGR_UG;
}
}
const timerHardware_t *timerGetByTag(ioTag_t tag, timerFlag_e flag)
{
for (uint8_t i = 0; i < USABLE_TIMER_CHANNEL_COUNT; i++) {
if (timerHardware[i].tag == tag) {
if (flag && (timerHardware[i].output & flag) == flag) {
return &timerHardware[i];
} else if (!flag && timerHardware[i].output == flag) {
// TODO: shift flag by one so not to be 0
return &timerHardware[i];
}
}
}
return NULL;
}