AP_RPM: set pin to input before attaching interrupt

this fixes input on AUX6 on CubeBlack
This commit is contained in:
Andrew Tridgell 2018-11-15 12:38:22 +11:00
parent 0669619cea
commit ce1b0fe533

View File

@ -136,6 +136,7 @@ void AP_RPM_Pin::update(void)
stm32_gpiosetevent(gpio, true, false, false,
state.instance==0?irq_handler0:irq_handler1);
#else // other HALs
hal.gpio->pinMode(last_pin, HAL_GPIO_INPUT);
hal.gpio->attach_interrupt(last_pin, state.instance==0?irq_handler0:irq_handler1,
HAL_GPIO_INTERRUPT_RISING);
#endif