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-08 15:20:17 +11:00
parent 76a2cd1540
commit e862c349e8
1 changed files with 1 additions and 0 deletions

View File

@ -60,6 +60,7 @@ void AP_RPM_Pin::update(void)
// attach to new pin
last_pin = get_pin();
if (last_pin) {
hal.gpio->pinMode(last_pin, HAL_GPIO_INPUT);
if (!hal.gpio->attach_interrupt(
last_pin,
FUNCTOR_BIND_MEMBER(&AP_RPM_Pin::irq_handler, void, uint8_t, bool, uint32_t),