From 9d5413d4d91fcc5841fba54d24a4809622ef99f8 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Mon, 19 Dec 2011 20:31:34 +0100 Subject: [PATCH] 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