AP_RangeFinder: 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 c18c867fec
commit 76a2cd1540

View File

@ -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,