mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-20 07:38:28 -04:00
AP_WheelEncoder: set pin to input before attaching interrupt
this fixes input on AUX6 on CubeBlack
This commit is contained in:
parent
0102016e54
commit
30d5ff2d3d
@ -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
|
// install interrupt handler on rising or falling edge of gpio for pin a
|
||||||
if (new_pin != (uint8_t)-1) {
|
if (new_pin != (uint8_t)-1) {
|
||||||
|
hal.gpio->pinMode(pin, HAL_GPIO_INPUT);
|
||||||
if (!hal.gpio->attach_interrupt(
|
if (!hal.gpio->attach_interrupt(
|
||||||
pin,
|
pin,
|
||||||
FUNCTOR_BIND_MEMBER(&AP_WheelEncoder_Quadrature::irq_handler,
|
FUNCTOR_BIND_MEMBER(&AP_WheelEncoder_Quadrature::irq_handler,
|
||||||
|
Loading…
Reference in New Issue
Block a user