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:
parent
5f47fc311b
commit
46a6e560f1
28 changed files with 506 additions and 382 deletions
|
@ -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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue