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

Added default value processing for , .

This commit is contained in:
mikeller 2019-03-07 06:12:29 +13:00
parent 410507c56a
commit fb5c468f92
5 changed files with 260 additions and 70 deletions

View file

@ -54,14 +54,13 @@ static uint8_t timerIndexByTag(ioTag_t ioTag)
return 0;
}
const timerHardware_t *timerGetByTag(ioTag_t ioTag)
const timerHardware_t *timerGetByTagAndIndex(ioTag_t ioTag, unsigned timerIndex)
{
if (!ioTag) {
return NULL;
}
#if TIMER_CHANNEL_COUNT > 0
uint8_t timerIndex = timerIndexByTag(ioTag);
uint8_t index = 1;
for (unsigned i = 0; i < TIMER_CHANNEL_COUNT; i++) {
if (TIMER_HARDWARE[i].tag == ioTag) {
@ -72,11 +71,19 @@ const timerHardware_t *timerGetByTag(ioTag_t ioTag)
}
}
#else
UNUSED(timerIndexByTag);
UNUSED(timerIndex);
#endif
return NULL;
}
const timerHardware_t *timerGetByTag(ioTag_t ioTag)
{
uint8_t timerIndex = timerIndexByTag(ioTag);
return timerGetByTagAndIndex(ioTag, timerIndex);
}
ioTag_t timerioTagGetByUsage(timerUsageFlag_e usageFlag, uint8_t index)
{
#if !defined(USE_UNIFIED_TARGET) && USABLE_TIMER_CHANNEL_COUNT > 0