1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

Moved IO_GPIOPortIdx to platform (#14127)

This commit is contained in:
Jay Blackman 2025-01-06 06:01:00 +11:00 committed by GitHub
parent d82cd5a28a
commit 69f8f71b77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -52,14 +52,6 @@ uint16_t IO_Pin(IO_t io)
return ioRec->pin;
}
int IO_GPIOPortIdx(IO_t io)
{
if (!io) {
return -1;
}
return (((size_t)IO_GPIO(io) - GPIOA_BASE) >> 10);
}
int IO_EXTI_PortSourceGPIO(IO_t io)
{
return IO_GPIOPortIdx(io);

View file

@ -68,3 +68,11 @@ IO_t IOGetByTag(ioTag_t tag)
offset += ioDefUsedOffset[portIdx];
return ioRecs + offset;
}
int IO_GPIOPortIdx(IO_t io)
{
if (!io) {
return -1;
}
return (((size_t)IO_GPIO(io) - GPIOA_BASE) >> 10);
}