From 2b5aa9bc535d9810bea939594a33d02a44d7b6f1 Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Tue, 10 Jul 2018 18:24:26 -0700 Subject: [PATCH] Rover: Remove usage of analogPinToDigitalPin --- APMrover2/system.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/APMrover2/system.cpp b/APMrover2/system.cpp index d20a12585b..de26f64a7d 100644 --- a/APMrover2/system.cpp +++ b/APMrover2/system.cpp @@ -294,17 +294,13 @@ void Rover::notify_mode(const Mode *mode) */ uint8_t Rover::check_digital_pin(uint8_t pin) { - const int8_t dpin = hal.gpio->analogPinToDigitalPin(pin); - if (dpin == -1) { - return 0; - } // ensure we are in input mode - hal.gpio->pinMode(dpin, HAL_GPIO_INPUT); + hal.gpio->pinMode(pin, HAL_GPIO_INPUT); // enable pullup - hal.gpio->write(dpin, 1); + hal.gpio->write(pin, 1); - return hal.gpio->read(dpin); + return hal.gpio->read(pin); } /*