From f8f53d880155bd8ed5e9f687243816a4fbe44284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Chavarr=C3=ADa=20Krauser?= Date: Tue, 25 Mar 2014 09:18:25 +0100 Subject: [PATCH] OP-1273 Adaptations to include MS4525DO PixHawk speed sensor --- flight/modules/Airspeed/airspeed.c | 7 +++++++ flight/pios/pios.h | 6 ++++++ .../targets/boards/revolution/firmware/inc/pios_config.h | 2 ++ flight/targets/boards/revolution/pios_board.h | 1 + make/apps-defs.mk | 1 + shared/uavobjectdefinition/airspeedsensor.xml | 4 ++++ shared/uavobjectdefinition/airspeedsettings.xml | 2 +- 7 files changed, 22 insertions(+), 1 deletion(-) diff --git a/flight/modules/Airspeed/airspeed.c b/flight/modules/Airspeed/airspeed.c index 395cee43a..078aef03f 100644 --- a/flight/modules/Airspeed/airspeed.c +++ b/flight/modules/Airspeed/airspeed.c @@ -41,6 +41,7 @@ #include "hwsettings.h" #include "airspeedsettings.h" #include "airspeedsensor.h" // object that will be updated by the module +#include "baro_airspeed_ms4525do.h" #include "baro_airspeed_etasv3.h" #include "baro_airspeed_mpxv.h" #include "gps_airspeed.h" @@ -165,6 +166,12 @@ static void airspeedTask(__attribute__((unused)) void *parameters) // Eagletree Airspeed v3 baro_airspeedGetETASV3(&airspeedData, &airspeedSettings); break; +#endif +#if defined(PIOS_INCLUDE_MS4525DO) + case AIRSPEEDSETTINGS_AIRSPEEDSENSORTYPE_PIXHAWKAIRSPEEDMS4525DO: + // PixHawk Airpeed based on MS4525DO + baro_airspeedGetMS4525DO(&airspeedData, &airspeedSettings); + break; #endif case AIRSPEEDSETTINGS_AIRSPEEDSENSORTYPE_GROUNDSPEEDBASEDWINDESTIMATION: gps_airspeedGet(&airspeedData, &airspeedSettings); diff --git a/flight/pios/pios.h b/flight/pios/pios.h index 15cdc294e..2142f8224 100644 --- a/flight/pios/pios.h +++ b/flight/pios/pios.h @@ -229,6 +229,12 @@ #include #endif +#ifdef PIOS_INCLUDE_MS4525DO +/* PixHawk Airspeed Sensor based on MS4525DO */ +#include +#endif + + #ifdef PIOS_INCLUDE_HCSR04 /* HC-SR04 Ultrasonic Sensor */ #include diff --git a/flight/targets/boards/revolution/firmware/inc/pios_config.h b/flight/targets/boards/revolution/firmware/inc/pios_config.h index 6ad54cc7e..c60e9a453 100644 --- a/flight/targets/boards/revolution/firmware/inc/pios_config.h +++ b/flight/targets/boards/revolution/firmware/inc/pios_config.h @@ -87,6 +87,8 @@ #define PIOS_INCLUDE_MS5611 #define PIOS_INCLUDE_MPXV #define PIOS_INCLUDE_ETASV3 +#define PIOS_INCLUDE_MS4525DO + /* #define PIOS_INCLUDE_HCSR04 */ /* PIOS receiver drivers */ diff --git a/flight/targets/boards/revolution/pios_board.h b/flight/targets/boards/revolution/pios_board.h index de47db80a..60d3cff53 100644 --- a/flight/targets/boards/revolution/pios_board.h +++ b/flight/targets/boards/revolution/pios_board.h @@ -125,6 +125,7 @@ extern uint32_t pios_i2c_mag_pressure_adapter_id; extern uint32_t pios_i2c_flexiport_adapter_id; #define PIOS_I2C_FLEXI_ADAPTER (pios_i2c_flexiport_adapter_id) #define PIOS_I2C_ETASV3_ADAPTER (PIOS_I2C_FLEXI_ADAPTER) +#define PIOS_I2C_MS4525DO_ADAPTER (PIOS_I2C_FLEXI_ADAPTER) // ------------------------- // PIOS_USART diff --git a/make/apps-defs.mk b/make/apps-defs.mk index bb5376223..20853c568 100644 --- a/make/apps-defs.mk +++ b/make/apps-defs.mk @@ -69,6 +69,7 @@ SRC += $(PIOSCOMMON)/pios_i2c_esc.c SRC += $(PIOSCOMMON)/pios_l3gd20.c SRC += $(PIOSCOMMON)/pios_mpu6000.c SRC += $(PIOSCOMMON)/pios_mpxv.c +SRC += $(PIOSCOMMON)/pios_ms4525do.c SRC += $(PIOSCOMMON)/pios_ms5611.c SRC += $(PIOSCOMMON)/pios_oplinkrcvr.c SRC += $(PIOSCOMMON)/pios_video.c diff --git a/shared/uavobjectdefinition/airspeedsensor.xml b/shared/uavobjectdefinition/airspeedsensor.xml index 8f55cbeae..f61cb63fc 100644 --- a/shared/uavobjectdefinition/airspeedsensor.xml +++ b/shared/uavobjectdefinition/airspeedsensor.xml @@ -3,7 +3,11 @@ The raw data from the dynamic pressure sensor with pressure, temperature and airspeed. + + + + diff --git a/shared/uavobjectdefinition/airspeedsettings.xml b/shared/uavobjectdefinition/airspeedsettings.xml index 3ed136b16..ea09bba2d 100644 --- a/shared/uavobjectdefinition/airspeedsettings.xml +++ b/shared/uavobjectdefinition/airspeedsettings.xml @@ -4,7 +4,7 @@ - +