From 79996986ad4977fda3e755b124fe62d7826f1782 Mon Sep 17 00:00:00 2001 From: Emile Castelnuovo Date: Mon, 7 Apr 2014 18:49:09 +0200 Subject: [PATCH] VRBRAIN: corrected ADC pins for volt and current sensing. --- libraries/AP_HAL_VRBRAIN/AnalogIn.cpp | 5 +++-- libraries/AP_HAL_VRBRAIN/AnalogIn.h | 12 ++++++------ libraries/AP_HAL_VRBRAIN/GPIO.h | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libraries/AP_HAL_VRBRAIN/AnalogIn.cpp b/libraries/AP_HAL_VRBRAIN/AnalogIn.cpp index 12aedc3ebb..0f32ba15cb 100644 --- a/libraries/AP_HAL_VRBRAIN/AnalogIn.cpp +++ b/libraries/AP_HAL_VRBRAIN/AnalogIn.cpp @@ -41,10 +41,11 @@ static const struct { float scaling; } pin_scaling[] = { #ifdef CONFIG_ARCH_BOARD_VRBRAIN_V4 - { 0, 3.3f/4096 }, + { 0, 3.3f/4096 }, { 10, 3.3f/4096 }, + { 11, 3.3f/4096 }, #elif CONFIG_ARCH_BOARD_VRBRAIN_V5 - { 0, 3.3f/4096 }, + { 0, 3.3f/4096 }, { 10, 3.3f/4096 }, { 11, 3.3f/4096 }, #elif CONFIG_ARCH_BOARD_VRHERO_V1 diff --git a/libraries/AP_HAL_VRBRAIN/AnalogIn.h b/libraries/AP_HAL_VRBRAIN/AnalogIn.h index 6a07008377..9c2ad61d00 100644 --- a/libraries/AP_HAL_VRBRAIN/AnalogIn.h +++ b/libraries/AP_HAL_VRBRAIN/AnalogIn.h @@ -12,14 +12,14 @@ #if defined(CONFIG_ARCH_BOARD_VRBRAIN_V4) // these are virtual pins that read from the ORB -#define VRBRAIN_ANALOG_ORB_BATTERY_VOLTAGE_PIN 100 -#define VRBRAIN_ANALOG_ORB_BATTERY_CURRENT_PIN 101 +#define VRBRAIN_ANALOG_ORB_BATTERY_VOLTAGE_PIN 10 +#define VRBRAIN_ANALOG_ORB_BATTERY_CURRENT_PIN 11 #elif defined(CONFIG_ARCH_BOARD_VRBRAIN_V5) -#define VRBRAIN_ANALOG_ORB_BATTERY_VOLTAGE_PIN 100 -#define VRBRAIN_ANALOG_ORB_BATTERY_CURRENT_PIN 101 +#define VRBRAIN_ANALOG_ORB_BATTERY_VOLTAGE_PIN 10 +#define VRBRAIN_ANALOG_ORB_BATTERY_CURRENT_PIN 11 #elif defined(CONFIG_ARCH_BOARD_VRHERO_V1) -#define VRBRAIN_ANALOG_ORB_BATTERY_VOLTAGE_PIN 100 -#define VRBRAIN_ANALOG_ORB_BATTERY_CURRENT_PIN 101 +#define VRBRAIN_ANALOG_ORB_BATTERY_VOLTAGE_PIN 10 +#define VRBRAIN_ANALOG_ORB_BATTERY_CURRENT_PIN 11 #endif class VRBRAIN::VRBRAINAnalogSource : public AP_HAL::AnalogSource { diff --git a/libraries/AP_HAL_VRBRAIN/GPIO.h b/libraries/AP_HAL_VRBRAIN/GPIO.h index 4c99139915..e1a682e945 100644 --- a/libraries/AP_HAL_VRBRAIN/GPIO.h +++ b/libraries/AP_HAL_VRBRAIN/GPIO.h @@ -23,8 +23,8 @@ # define HAL_GPIO_A_LED_PIN 27 # define HAL_GPIO_B_LED_PIN 26 # define HAL_GPIO_C_LED_PIN 25 - # define HAL_GPIO_LED_ON LOW - # define HAL_GPIO_LED_OFF HIGH + # define HAL_GPIO_LED_ON HIGH + # define HAL_GPIO_LED_OFF LOW #endif class VRBRAIN::VRBRAINGPIO : public AP_HAL::GPIO {