mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Merge pull request #3165 from ledvinap/fix-IOGetByTag-bf
IOGetByTag did not handle empty Tag correctly
This commit is contained in:
commit
a1df39b67b
1 changed files with 1 additions and 1 deletions
|
@ -389,7 +389,7 @@ IO_t IOGetByTag(ioTag_t tag)
|
|||
int portIdx = DEFIO_TAG_GPIOID(tag);
|
||||
int pinIdx = DEFIO_TAG_PIN(tag);
|
||||
|
||||
if (portIdx >= DEFIO_PORT_USED_COUNT)
|
||||
if (portIdx < 0 || portIdx >= DEFIO_PORT_USED_COUNT)
|
||||
return NULL;
|
||||
// check if pin exists
|
||||
if (!(ioDefUsedMask[portIdx] & (1 << pinIdx)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue