AP_WheelEncoder: set pin to input before attaching interrupt

this fixes input on AUX6 on CubeBlack
This commit is contained in:
Andrew Tridgell 2018-11-08 15:20:17 +11:00
parent 0102016e54
commit 30d5ff2d3d
1 changed files with 1 additions and 0 deletions

View File

@ -48,6 +48,7 @@ void AP_WheelEncoder_Quadrature::update_pin(uint8_t &pin,
// install interrupt handler on rising or falling edge of gpio for pin a
if (new_pin != (uint8_t)-1) {
hal.gpio->pinMode(pin, HAL_GPIO_INPUT);
if (!hal.gpio->attach_interrupt(
pin,
FUNCTOR_BIND_MEMBER(&AP_WheelEncoder_Quadrature::irq_handler,