From 1d2d2dd7a04f470995ab1d4a18da72280d167835 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Mon, 19 Dec 2011 19:53:55 +0100 Subject: [PATCH 1/3] removed old obsolete BOOZ_BARO_RAW message --- conf/messages.xml | 6 +----- sw/airborne/firmwares/rotorcraft/telemetry.h | 18 ++++-------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/conf/messages.xml b/conf/messages.xml index d8322024b9..e529ee873a 100644 --- a/conf/messages.xml +++ b/conf/messages.xml @@ -1330,11 +1330,7 @@ - - - - - + diff --git a/sw/airborne/firmwares/rotorcraft/telemetry.h b/sw/airborne/firmwares/rotorcraft/telemetry.h index 2a4fca5919..d93f481239 100644 --- a/sw/airborne/firmwares/rotorcraft/telemetry.h +++ b/sw/airborne/firmwares/rotorcraft/telemetry.h @@ -174,23 +174,13 @@ extern uint8_t telemetry_mode_Main_DefaultChannel; &imu.mag_unscaled.z); \ } -/* FIXME: make that depend on board */ -#define PERIODIC_SEND_BOOZ_BARO_RAW(_chan) { \ - DOWNLINK_SEND_BOOZ2_BARO_RAW(_chan, \ - &baro_board.offset, \ - &baro.absolute, \ - &baro_board.value_filtered); \ +#define PERIODIC_SEND_BARO_RAW(_chan) { \ + DOWNLINK_SEND_BARO_RAW(_chan, \ + &baro.absolute, \ + &baro.differential); \ } -#define PERIODIC_SEND_BARO_RAW(_chan) { \ - DOWNLINK_SEND_BARO_RAW(_chan, \ - &baro.absolute, \ - &baro.differential); \ - } - - - #include "firmwares/rotorcraft/stabilization.h" #define PERIODIC_SEND_RATE_LOOP(_chan) { \ From a4208cfa0ac6fba110ea5e7ace7763fd926f3807 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Fri, 16 Dec 2011 12:15:56 +0100 Subject: [PATCH 2/3] baro_board module: only use ADS1114 for navgo and umarim --- conf/modules/baro_board.xml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/conf/modules/baro_board.xml b/conf/modules/baro_board.xml index 4ace2ff541..020bd730e5 100644 --- a/conf/modules/baro_board.xml +++ b/conf/modules/baro_board.xml @@ -9,11 +9,19 @@ - - - - + + +ifeq ($(BOARD), navgo) +ap.CFLAGS += -DUSE_I2C1 -DUSE_ADS1114_1 +ap.CFLAGS += -DADS1114_I2C_DEVICE=i2c1 +ap.srcs += peripherals/ads1114.c +else ifeq ($(BOARD), umarim) +ap.CFLAGS += -DUSE_I2C1 -DUSE_ADS1114_1 +ap.CFLAGS += -DADS1114_I2C_DEVICE=i2c1 +ap.srcs += peripherals/ads1114.c +endif + From 9d5413d4d91fcc5841fba54d24a4809622ef99f8 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Mon, 19 Dec 2011 20:31:34 +0100 Subject: [PATCH 3/3] removed sending of BARO_RAW message from baro_board, use normal ap_downlink and periodic send --- conf/modules/baro_board.xml | 1 - conf/telemetry/default_fixedwing_imu.xml | 7 ++++--- conf/telemetry/default_fixedwing_imu_9k6.xml | 1 + sw/airborne/boards/umarim/baro_board.c | 13 ------------- sw/airborne/boards/umarim/baro_board.h | 2 -- sw/airborne/firmwares/fixedwing/ap_downlink.h | 10 ++++++++++ 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/conf/modules/baro_board.xml b/conf/modules/baro_board.xml index 020bd730e5..2f57658e59 100644 --- a/conf/modules/baro_board.xml +++ b/conf/modules/baro_board.xml @@ -6,7 +6,6 @@ - diff --git a/conf/telemetry/default_fixedwing_imu.xml b/conf/telemetry/default_fixedwing_imu.xml index 1b83499095..f7f832e34d 100644 --- a/conf/telemetry/default_fixedwing_imu.xml +++ b/conf/telemetry/default_fixedwing_imu.xml @@ -69,13 +69,14 @@ + - - - + + + diff --git a/conf/telemetry/default_fixedwing_imu_9k6.xml b/conf/telemetry/default_fixedwing_imu_9k6.xml index df79bb466c..e97b9046a9 100644 --- a/conf/telemetry/default_fixedwing_imu_9k6.xml +++ b/conf/telemetry/default_fixedwing_imu_9k6.xml @@ -69,6 +69,7 @@ + diff --git a/sw/airborne/boards/umarim/baro_board.c b/sw/airborne/boards/umarim/baro_board.c index 87545deb09..5c87f41dc9 100644 --- a/sw/airborne/boards/umarim/baro_board.c +++ b/sw/airborne/boards/umarim/baro_board.c @@ -27,14 +27,6 @@ #include "subsystems/sensors/baro.h" -// Downlink -#include "mcu_periph/uart.h" -#include "messages.h" -#include "subsystems/datalink/downlink.h" - -#ifndef DOWNLINK_DEVICE -#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE -#endif /* Common Baro struct */ struct Baro baro; @@ -78,8 +70,3 @@ void baro_periodic( void ) { ads1114_read(&BARO_ABS_ADS); } -void baro_downlink_raw( void ) -{ - DOWNLINK_SEND_BARO_RAW(DefaultChannel,&baro.absolute,&baro.differential); -} - diff --git a/sw/airborne/boards/umarim/baro_board.h b/sw/airborne/boards/umarim/baro_board.h index e74b52c77d..ca0265c268 100644 --- a/sw/airborne/boards/umarim/baro_board.h +++ b/sw/airborne/boards/umarim/baro_board.h @@ -46,8 +46,6 @@ extern float baro_alt_offset; #define BaroAltHandler() { baro_alt = BARO_SENS*(baro_alt_offset - (float)baro.absolute); } #endif -extern void baro_downlink_raw( void ); - #define BARO_ABS_ADS ads1114_1 #define BaroAbs(_ads, _handler) { \ diff --git a/sw/airborne/firmwares/fixedwing/ap_downlink.h b/sw/airborne/firmwares/fixedwing/ap_downlink.h index c97aaa3608..d620d37734 100644 --- a/sw/airborne/firmwares/fixedwing/ap_downlink.h +++ b/sw/airborne/firmwares/fixedwing/ap_downlink.h @@ -239,6 +239,16 @@ extern uint8_t telemetry_mode_Ap_DefaultChannel; #define PERIODIC_SEND_SCP_STATUS(_chan) {} #endif +#ifdef BOARD_HAS_BARO +#define PERIODIC_SEND_BARO_RAW(_chan) { \ + DOWNLINK_SEND_BARO_RAW(_chan, \ + &baro.absolute, \ + &baro.differential); \ + } +#else +#define PERIODIC_SEND_BARO_RAW(_chan) {} +#endif + #ifdef MEASURE_AIRSPEED #define PERIODIC_SEND_AIRSPEED(_chan) DOWNLINK_SEND_AIRSPEED (_chan, &estimator_airspeed, &estimator_airspeed, &estimator_airspeed, &estimator_airspeed) #elif defined USE_AIRSPEED