From 4b047625fc5edfee54c8521d3cd42f176dffabad Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 18 Jul 2020 08:10:09 +1000 Subject: [PATCH] AP_BoardConfig: use polarity for 3.3/5v selection --- libraries/AP_BoardConfig/board_drivers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_BoardConfig/board_drivers.cpp b/libraries/AP_BoardConfig/board_drivers.cpp index c73d0677eb..3b5139aa2a 100644 --- a/libraries/AP_BoardConfig/board_drivers.cpp +++ b/libraries/AP_BoardConfig/board_drivers.cpp @@ -428,9 +428,9 @@ void AP_BoardConfig::board_setup() #ifdef HAL_GPIO_PWM_VOLT_PIN if (_pwm_volt_sel == 0) { - hal.gpio->write(HAL_GPIO_PWM_VOLT_PIN, 1); //set pin for 3.3V PWM Output + hal.gpio->write(HAL_GPIO_PWM_VOLT_PIN, HAL_GPIO_PWM_VOLT_3v3); //set pin for 3.3V PWM Output } else if (_pwm_volt_sel == 1) { - hal.gpio->write(HAL_GPIO_PWM_VOLT_PIN, 0); //set pin for 5V PWM Output + hal.gpio->write(HAL_GPIO_PWM_VOLT_PIN, !HAL_GPIO_PWM_VOLT_3v3); //set pin for 5V PWM Output } #endif board_setup_uart();