Fixed assignment of random timer for pins without configured timer option.

This commit is contained in:
mikeller 2019-04-25 14:05:57 +12:00
parent 1db881f595
commit ceae2d88b6
1 changed files with 5 additions and 1 deletions

View File

@ -81,7 +81,11 @@ const timerHardware_t *timerGetByTag(ioTag_t ioTag)
{ {
uint8_t timerIndex = timerIndexByTag(ioTag); uint8_t timerIndex = timerIndexByTag(ioTag);
return timerGetByTagAndIndex(ioTag, timerIndex); if (timerIndex) {
return timerGetByTagAndIndex(ioTag, timerIndex);
} else {
return NULL;
}
} }
ioTag_t timerioTagGetByUsage(timerUsageFlag_e usageFlag, uint8_t index) ioTag_t timerioTagGetByUsage(timerUsageFlag_e usageFlag, uint8_t index)