Merge pull request #3165 from ledvinap/fix-IOGetByTag-bf
IOGetByTag did not handle empty Tag correctly
This commit is contained in:
commit
a1df39b67b
|
@ -389,7 +389,7 @@ IO_t IOGetByTag(ioTag_t tag)
|
||||||
int portIdx = DEFIO_TAG_GPIOID(tag);
|
int portIdx = DEFIO_TAG_GPIOID(tag);
|
||||||
int pinIdx = DEFIO_TAG_PIN(tag);
|
int pinIdx = DEFIO_TAG_PIN(tag);
|
||||||
|
|
||||||
if (portIdx >= DEFIO_PORT_USED_COUNT)
|
if (portIdx < 0 || portIdx >= DEFIO_PORT_USED_COUNT)
|
||||||
return NULL;
|
return NULL;
|
||||||
// check if pin exists
|
// check if pin exists
|
||||||
if (!(ioDefUsedMask[portIdx] & (1 << pinIdx)))
|
if (!(ioDefUsedMask[portIdx] & (1 << pinIdx)))
|
||||||
|
|
Loading…
Reference in New Issue