From f2358f2441a8084b0a4fe4ab9993dfcdb0687157 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 8 Feb 2016 19:52:46 +1100 Subject: [PATCH] HAL_PX4: changes for FMUv4 --- libraries/AP_HAL_PX4/AnalogIn.cpp | 6 +++--- libraries/AP_HAL_PX4/AnalogIn.h | 2 +- libraries/AP_HAL_PX4/GPIO.cpp | 2 ++ libraries/AP_HAL_PX4/RCInput.h | 5 +++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libraries/AP_HAL_PX4/AnalogIn.cpp b/libraries/AP_HAL_PX4/AnalogIn.cpp index 026f295fea..77ae1c1289 100644 --- a/libraries/AP_HAL_PX4/AnalogIn.cpp +++ b/libraries/AP_HAL_PX4/AnalogIn.cpp @@ -48,7 +48,7 @@ static const struct { { 11, 6.6f/4096 }, // analog airspeed input, 2:1 scaling { 12, 3.3f/4096 }, // analog2, on SPI port pin 3 { 13, 16.8f/4096 }, // analog3, on SPI port pin 4 -#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V2) +#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V2) || defined(CONFIG_ARCH_BOARD_PX4FMU_V4) { 2, 3.3f/4096 }, // 3DR Brick voltage, usually 10.1:1 // scaled from battery voltage { 3, 3.3f/4096 }, // 3DR Brick current, usually 17:1 scaled @@ -269,7 +269,7 @@ void PX4AnalogIn::_timer_tick(void) if (ret > 0) { // match the incoming channels to the currently active pins for (uint8_t i=0; iprintf("GPIO: Unable to open px4io\n"); } +#endif } void PX4GPIO::pinMode(uint8_t pin, uint8_t output) diff --git a/libraries/AP_HAL_PX4/RCInput.h b/libraries/AP_HAL_PX4/RCInput.h index cbb8e643ec..ebfeac073c 100644 --- a/libraries/AP_HAL_PX4/RCInput.h +++ b/libraries/AP_HAL_PX4/RCInput.h @@ -7,6 +7,11 @@ #include #include + +#ifndef RC_INPUT_MAX_CHANNELS +#define RC_INPUT_MAX_CHANNELS 18 +#endif + class PX4::PX4RCInput : public AP_HAL::RCInput { public: void init(void* machtnichts);