AP_HAL_ChibiOS: GPIO: read: support virtual read of IOMCU pins

This commit is contained in:
Iampete1 2024-07-28 17:38:26 +01:00 committed by Randy Mackay
parent bafaffb07e
commit d59b629e7f

View File

@ -241,6 +241,11 @@ uint8_t GPIO::read(uint8_t pin)
if (g) { if (g) {
return palReadLine(g->pal_line); return palReadLine(g->pal_line);
} }
#if HAL_WITH_IO_MCU
if (AP_BoardConfig::io_enabled() && iomcu.valid_GPIO_pin(pin)) {
return iomcu.read_virtual_GPIO(pin);
}
#endif
return 0; return 0;
} }