From 174ace99335bd33b53cd740e69037cb61f9f38b7 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Mon, 11 Feb 2013 19:32:01 +0100 Subject: [PATCH] [fixedwing] print used ahrs freqs, pass configure options on... --- .../firmwares/subsystems/fixedwing/autopilot.makefile | 8 ++++++++ conf/firmwares/subsystems/shared/imu_umarim.makefile | 2 ++ sw/airborne/firmwares/fixedwing/main_ap.c | 11 +++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/conf/firmwares/subsystems/fixedwing/autopilot.makefile b/conf/firmwares/subsystems/fixedwing/autopilot.makefile index b24a313122e..bb7c3104d5e 100644 --- a/conf/firmwares/subsystems/fixedwing/autopilot.makefile +++ b/conf/firmwares/subsystems/fixedwing/autopilot.makefile @@ -174,6 +174,14 @@ else ifeq ($(BOARD), lisa_l) ap_CFLAGS += -DUSE_I2C2 endif +# ahrs frequencies if configured +ifdef AHRS_PROPAGATE_FREQUENCY +ap_CFLAGS += -DAHRS_PROPAGATE_FREQUENCY=$(AHRS_PROPAGATE_FREQUENCY) +endif +ifdef AHRS_CORRECT_FREQUENCY +ap_CFLAGS += -DAHRS_CORRECT_FREQUENCY=$(AHRS_CORRECT_FREQUENCY) +endif + ###################################################################### ## diff --git a/conf/firmwares/subsystems/shared/imu_umarim.makefile b/conf/firmwares/subsystems/shared/imu_umarim.makefile index 256207aa19d..7fb6122c599 100644 --- a/conf/firmwares/subsystems/shared/imu_umarim.makefile +++ b/conf/firmwares/subsystems/shared/imu_umarim.makefile @@ -16,7 +16,9 @@ IMU_UMARIM_SRCS += peripherals/adxl345_i2c.c # with default UMARIM_GYRO_SMPLRT_DIV (gyro output 50Hz) # the AHRS_PROPAGATE_FREQUENCY needs to be adjusted accordingly AHRS_PROPAGATE_FREQUENCY ?= 50 +AHRS_CORRECT_FREQUENCY ?= 50 ap.CFLAGS += -DAHRS_PROPAGATE_FREQUENCY=$(AHRS_PROPAGATE_FREQUENCY) +ap.CFLAGS += -DAHRS_CORRECT_FREQUENCY=$(AHRS_CORRECT_FREQUENCY) ap.CFLAGS += $(IMU_UMARIM_CFLAGS) ap.srcs += $(IMU_UMARIM_SRCS) diff --git a/sw/airborne/firmwares/fixedwing/main_ap.c b/sw/airborne/firmwares/fixedwing/main_ap.c index d245c49efae..94205888422 100644 --- a/sw/airborne/firmwares/fixedwing/main_ap.c +++ b/sw/airborne/firmwares/fixedwing/main_ap.c @@ -86,20 +86,23 @@ #include "led.h" -#if USE_AHRS -#if USE_IMU +#if USE_AHRS && USE_IMU + #ifndef AHRS_PROPAGATE_FREQUENCY #define AHRS_PROPAGATE_FREQUENCY PERIODIC_FREQUENCY #endif +PRINT_CONFIG_VAR(AHRS_PROPAGATE_FREQUENCY) #ifndef AHRS_CORRECT_FREQUENCY #define AHRS_CORRECT_FREQUENCY PERIODIC_FREQUENCY #endif +PRINT_CONFIG_VAR(AHRS_CORRECT_FREQUENCY) + static inline void on_gyro_event( void ); static inline void on_accel_event( void ); static inline void on_mag_event( void ); volatile uint8_t ahrs_timeout_counter = 0; -#endif // USE_IMU -#endif // USE_AHRS + +#endif // USE_AHRS && USE_IMU #if USE_GPS static inline void on_gps_solution( void );