From 30d5ff2d3d35d6dd9ef97ad1e96c03265162b301 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 8 Nov 2018 15:20:17 +1100 Subject: [PATCH] AP_WheelEncoder: set pin to input before attaching interrupt this fixes input on AUX6 on CubeBlack --- libraries/AP_WheelEncoder/WheelEncoder_Quadrature.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/AP_WheelEncoder/WheelEncoder_Quadrature.cpp b/libraries/AP_WheelEncoder/WheelEncoder_Quadrature.cpp index 20ed2576ce..4b03289fc1 100644 --- a/libraries/AP_WheelEncoder/WheelEncoder_Quadrature.cpp +++ b/libraries/AP_WheelEncoder/WheelEncoder_Quadrature.cpp @@ -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,