From 76a2cd1540711a4270c03d384bced1e974d4fceb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 8 Nov 2018 15:20:17 +1100 Subject: [PATCH] AP_RangeFinder: set pin to input before attaching interrupt this fixes input on AUX6 on CubeBlack --- libraries/AP_RangeFinder/AP_RangeFinder_PWM.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_PWM.cpp b/libraries/AP_RangeFinder/AP_RangeFinder_PWM.cpp index c28c04c8d5..95cc91deb2 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_PWM.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder_PWM.cpp @@ -91,6 +91,7 @@ void AP_RangeFinder_PWM::check_pin() } // install interrupt handler on rising and falling edge + hal.gpio->pinMode(state.pin, HAL_GPIO_INPUT); if (!hal.gpio->attach_interrupt( state.pin, FUNCTOR_BIND_MEMBER(&AP_RangeFinder_PWM::irq_handler,