diff --git a/libraries/AP_HAL_ChibiOS/AnalogIn.cpp b/libraries/AP_HAL_ChibiOS/AnalogIn.cpp index 16e8d3f188..353922c94a 100644 --- a/libraries/AP_HAL_ChibiOS/AnalogIn.cpp +++ b/libraries/AP_HAL_ChibiOS/AnalogIn.cpp @@ -356,12 +356,21 @@ void AnalogIn::update_power_flags(void) if (!palReadLine(HAL_GPIO_PIN_VDD_SERVO_VALID)) { flags |= MAV_POWER_STATUS_SERVO_VALID; } +#elif defined(HAL_GPIO_PIN_VDD_BRICK2_VALID) + // some boards defined BRICK2 instead of servo valid + if (!palReadLine(HAL_GPIO_PIN_VDD_BRICK2_VALID)) { + flags |= MAV_POWER_STATUS_SERVO_VALID; + } #endif - + #ifdef HAL_GPIO_PIN_VBUS if (palReadLine(HAL_GPIO_PIN_VBUS)) { flags |= MAV_POWER_STATUS_USB_CONNECTED; } +#elif defined(HAL_GPIO_PIN_nVBUS) + if (!palReadLine(HAL_GPIO_PIN_nVBUS)) { + flags |= MAV_POWER_STATUS_USB_CONNECTED; + } #endif #ifdef HAL_GPIO_PIN_VDD_5V_HIPOWER_OC diff --git a/libraries/AP_HAL_ChibiOS/hwdef/fmuv5/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/fmuv5/hwdef.dat index 39d09bf5b6..9f8258bad2 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/fmuv5/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/fmuv5/hwdef.dat @@ -220,7 +220,7 @@ define HAL_HEATER_GPIO_PIN 80 PG1 VDD_BRICK_VALID INPUT PULLUP PG2 VDD_BRICK2_VALID INPUT PULLUP -PG3 VBUS INPUT +PG3 nVBUS INPUT PULLUP PF13 VDD_5V_HIPOWER_OC INPUT PULLUP PE15 VDD_5V_PERIPH_OC INPUT PULLUP PB10 nSPI5_RESET_EXTERNAL1 OUTPUT HIGH