AP_BoardConfig: use polarity for 3.3/5v selection

This commit is contained in:
Andrew Tridgell 2020-07-18 08:10:09 +10:00
parent d283dd7d00
commit 4b047625fc

View File

@ -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();